cancel
Showing results for 
Search instead for 
Did you mean: 

Call Activiti // Expression?

dognose
Champ in-the-making
Champ in-the-making
Hello,

we are using a Call Activity to invoke another process  from within a process.
Since we have an additional "versioning" on top the versioning provided by activiti,
we have processKeys containing a version.

Now, if we trigger a subprocess, using a call activiti we want to call the latest version of the
process. Therefore we have a Service, providing us this information. However if i enter a
Expression in the Called Element field:

#{processVersionService.getLatestProcessKey('SomeProcessKey')} //would return 'SomeProcessKey_v2' i.e.

i receive the error:

Unable to complete Task.: org.activiti.engine.ActivitiException: no processes deployed with key '#{processVersionService.getLatestProcessKey('SomeProcessKey')}'

so, the EL-Expression is not evaluated within that field, right? Any Ideas on how we can "achieve" that?
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
I checked the code and I see this:

<code>
String expressionRegex = "\\$+\\{+.+\\}";
   
    CallActivityBehavior callActivityBehaviour = null;
    if (StringUtils.isNotEmpty(callActivity.getCalledElement()) && callActivity.getCalledElement().matches(expressionRegex)) {
      callActivityBehaviour = new CallActivityBehavior(expressionManager.createExpression(callActivity.getCalledElement()));
    } else {
      callActivityBehaviour = new CallActivityBehavior(callActivity.getCalledElement());
    }
</code>

thus, can you try the same expression but with a $ instead of a # ?

dognose
Champ in-the-making
Champ in-the-making
Thank you, that does the trick Smiley Happy

Should have looked at the source myself.