cancel
Showing results for 
Search instead for 
Did you mean: 

Need a way to skip process where isExecutable='false'

farrukh_najmi
Champ in-the-making
Champ in-the-making
In my application I have a BPMN file that has a mix of executable and non-executable processes.
I need to make the BpmnParse class skip processing of any process that sets isExecuatble='false'
so I avoid problems during its being processed.

A proposed solution is that BpmnParse.parseProcessDefinitions() be modified to check if process/@isExecutable is set and is false.
If so, parser should skip processing that process.

Below is a simple patch that implements the proposed solution. It has passed the junit regresion test suite.
Does this seem reasonable? If so, shall I go ahead and file a JIRA RFE?


Index: modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java
===================================================================
— modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java   (revision 977)
+++ modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java   (working copy)
@@ -342,7 +342,19 @@
   public void parseProcessDefinitions(Element definitionsElement) {
     // TODO: parse specific definitions signalData (id, imports, etc)
     for (Element processElement : definitionsElement.elements("process")) {
-      processDefinitions.add(parseProcess(processElement));
+      boolean processProcess = true;
+      String isExecutableStr = processElement.attribute("isExecutable");
+      if (isExecutableStr != null) {
+        boolean isExecutable = Boolean.parseBoolean(isExecutableStr);
+        if (!isExecutable) {
+          processProcess = false;
+        }
+      }
+
+      //Only process executable processes
+      if (processProcess) {
+        processDefinitions.add(parseProcess(processElement));
+      }
     }
   }
9 REPLIES 9

falko_menge
Champ in-the-making
Champ in-the-making
As an alternative, you can use a transformation of Activiti Cycle to extract a particular Pool from a Collaboration. The developer-friendly tab in the Cycle web frontend uses it. However, you can also use the Java libraries of the Cycle backend directly.

tombaeyens
Champ in-the-making
Champ in-the-making
is process/@isExecutable a BPMN attribute?  if yes, then create a jira issue for it.

falko_menge
Champ in-the-making
Champ in-the-making
Yes, process/@isExecutable is defined in the BPMN schema as:
<xsd:attribute name="isExecutable" type="xsd:boolean"/>

farrukh_najmi
Champ in-the-making
Champ in-the-making
is process/@isExecutable a BPMN attribute?  if yes, then create a jira issue for it.

Issue filed with patch attached at:

http://jira.codehaus.org/browse/ACT-249

Many thanks.

sebastian_s
Champ in-the-making
Champ in-the-making
I have the same problem since when deploying process definitions consisting of several processes/pools all of the pools are treated as if they were executable.

sebastian_s
Champ in-the-making
Champ in-the-making
Since isExecutable is defined in the spec: Could the supplied patch be included in the next release (not 5.9 but 5.10) ?

trademak
Star Contributor
Star Contributor
Hi,

I already tried to apply the patch, but as I commented just now in the JIRA issue I ran into a lot of unit test errors.

Best regards,

sebastian_s
Champ in-the-making
Champ in-the-making
Hello Tijs,

did you apply the patch to the trunk? I try to find the time to look into the failing tests and then get back.

Sebastian

sebastian_s
Champ in-the-making
Champ in-the-making
I found the reason for the 2 failing tests. Details are in JIRA.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.