Skip to content

Commit a21779a

Browse files
#5 Problem writing OCRed file
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.
1 parent e5e5026 commit a21779a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

simple-ocr-repo/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>es.keensoft.alfresco</groupId>
66
<artifactId>simple-ocr-repo</artifactId>
7-
<version>1.0.0</version>
7+
<version>1.0.2</version>
88
<name>simple-ocr-repo Repository AMP project</name>
99
<packaging>amp</packaging>
1010
<description>Manages the lifecycle of the simple-ocr-repo Repository AMP (Alfresco Module Package)</description>

simple-ocr-repo/src/main/java/es/keensoft/alfresco/ocr/OCRExtractAction.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.alfresco.service.namespace.QName;
2828
import org.apache.commons.logging.Log;
2929
import org.apache.commons.logging.LogFactory;
30-
import org.springframework.extensions.surf.util.I18NUtil;
3130

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

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

72-
Boolean continueOnError = (Boolean)action.getParameterValue(PARAM_CONTINUE_ON_ERROR);
71+
Boolean continueOnError = (Boolean) action.getParameterValue(PARAM_CONTINUE_ON_ERROR);
7372
if (continueOnError == null) continueOnError = true;
7473

74+
// Asynchronous executions throw several "controlled" ConcurrencyFailureException,
75+
// so no error continuation must be allowed
76+
if (action.getExecuteAsychronously()) {
77+
continueOnError = false;
78+
}
79+
7580
try {
7681

7782
String originalMimeType = contentData.getMimetype();

0 commit comments

Comments
 (0)