Skip to content

Commit

Permalink
#5 Problem writing OCRed file
Browse files Browse the repository at this point in the history
When executed in asynchronous mode, Alfresco catch several
ConcurrencyFailureException throws till action can be executed. As
“continueOnError” was true by default, the action was skipped at first
exception.
  • Loading branch information
angelborroy-ks committed Apr 16, 2016
1 parent e5e5026 commit a21779a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion simple-ocr-repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>es.keensoft.alfresco</groupId>
<artifactId>simple-ocr-repo</artifactId>
<version>1.0.0</version>
<version>1.0.2</version>
<name>simple-ocr-repo Repository AMP project</name>
<packaging>amp</packaging>
<description>Manages the lifecycle of the simple-ocr-repo Repository AMP (Alfresco Module Package)</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.alfresco.service.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.surf.util.I18NUtil;

import es.keensoft.alfresco.ocr.model.OCRdModel;

Expand Down Expand Up @@ -69,9 +68,15 @@ protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
// Exclude folders and other nodes without content
if (contentData != null) {

Boolean continueOnError = (Boolean)action.getParameterValue(PARAM_CONTINUE_ON_ERROR);
Boolean continueOnError = (Boolean) action.getParameterValue(PARAM_CONTINUE_ON_ERROR);
if (continueOnError == null) continueOnError = true;

// Asynchronous executions throw several "controlled" ConcurrencyFailureException,
// so no error continuation must be allowed
if (action.getExecuteAsychronously()) {
continueOnError = false;
}

try {

String originalMimeType = contentData.getMimetype();
Expand Down

0 comments on commit a21779a

Please sign in to comment.