I'm calling sub process from main process. I'm using Alfresco Activiti 7.1.0.M3.1. Sub process starting without a problem, but when I'm trying to get variables in it with execution.getVariables() or execution.getVariable("par1") I get nothing. (empty map or null) This is the way I'm setting variable in main process:
<callActivity id="callactivity1" name="Call activity" calledElement="myProcess2" > <extensionElements> <activiti:in source="var1i" target="par1"></activiti:in> <activiti:out source="par1" target="var1i"></activiti:out> <activiti:executionListener event="start" delegateExpression="${executionListener}"></activiti:executionListener> <activiti:executionListener event="end" delegateExpression="${executionListener}"></activiti:executionListener> </extensionElements> </callActivity>
I found a flag in callActivity: callActivity.isInheritVariables() with this flag true (it can't be set from Eclipse, only from java), then variables passing to sub process but with the same names as in main process (var1i). And when I change this variable in sub process, it doesn't return to main.
I read carefully docs: https://www.activiti.org/userguide/#bpmnCallActivity and doing exactly as it written in it. It doesn't seemed to work.
There is no part in runtime where
callActivity.getOutParameters()
or
callActivity.getInParameters()
is taken. So it seemed not to work at all.
I see the only way to write own implementation CallActivityBehavior and to set it to engine, and it will work, but in docs it should work from default configuration.
I checked methods that should do all the work in engine. And they do nothing.
org.activiti.engine.impl.bpmn.behavior.CallActivityBehavior
protected Map<String, Object> calculateInboundVariables(DelegateExecution execution,
ProcessDefinition processDefinition) {
return new HashMap<String, Object>();
}
protected Map<String, Object> calculateOutBoundVariables(DelegateExecution execution,
Map<String, Object> subProcessVariables) {
return new HashMap<String, Object>();
}
I just checked the latest version in maven: 7.1.0.M6. The same code.
In what version this will be fixed? Or maybe I'm wrong and missing something?
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.