Output variables from CallActivity on BoundaryEvent trigger?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2012 11:25 AM
After triggering the boundary event, I'd like to read the published exit-code variable in the parent process, but tracing the Activiti Engine, it appears that handling the boundary event preempts publishing the call activity's internal exit-code variable to the output variable, so the output variable isn't pushed out to the parent (it is set in the child process, looking at the DB).
Is there a way to ensure that the parent process can read a variable from it's child call activity in the event a boundary event is triggered?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2012 12:23 PM
In my context, I also tried to do this. My interpretation of BPMN execution semantics is it should be possible to attach some date to an Error Event so this should be possible.
This is not supported yet by Activiti AFAIK.
To circumvent the issue, I defined a pattern from the design model (using sth like Bizagi) to the executable model (done with Activiti) which says to use instead of the Error Boundary Event in this case a return code, mapped in the subprocess call activity, and test it in a gateway right after the subprocess.
Regards
Michel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2012 03:43 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2012 11:03 AM
I decided to post the variable to the parent process and wait for another Activiti release to address writing to output variables on boundary events.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2012 10:00 AM
I am not sure, this is what is intended by specification. When an error occurs, it means that you were not able to do the job and output and variables are not valid. You can only send an error code to let the caller know what was the problem.
If you need variable data to produce the error code, it might be a good sign that error handling code is not in a good place. Maybe you can move the error processor to the scope of the variables, process variables and throw the error with error code. Something like the figure with the annotation " error handler has access to variables local to the subprocess" in Event Sub-Process section of activiti guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2012 11:55 AM
Here is also my next reply on the JIRA, I suggest to reopen it if you agree with this suggestion.
I agree with what was said before, ie that normal mapping should not occur when an Error Event is thrown in the subprocess.
However, I also had a deep look at the spec for BPMN :
http://www.omg.org/spec/BPMN/2.0/
In section 8.3.3, we see that the Error has an ItemDefinition which the same as the one used in figure to define the "payload" of a Message.
So my suggestion is to implement in Activiti a way to set for an error event this payload, by using the ItemDefinition class. This way the Error Event can have some data attached to it (same as the variables used for an Start Event message for instance), and this data can be used in the calling parent process to know some context information about the cause of the error.
Regards
Michel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2012 02:59 AM
If you need this, please file a Jira issue with a link to this forum post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2012 04:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2012 11:49 AM
Based on the spec, a BoundaryEvent is a CatchEvent and thus has a DataOutput and DataOuputAssociation.
I suggest to use something similar to the implementation of the WebserviceTask which also uses dataOutputAssociation.
See an example of such a BPMN file here : https://github.com/Activiti/Activiti/blob/master/modules/activiti-cxf/src/test/resources/org/activit...
I don't understand all of it yet, but I think this shares enough features to be used in the implementation of the BoundaryEvent in Activiti.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2013 08:49 AM
Something to take into account also is a ErrorEvent can be raised from within the Java code with the usage of the BpmnError exception. I suggest that this exception has a property of type Map to define the associated data.
