06-29-2012 02:07 AM
11-27-2016 06:52 AM
11-27-2016 10:50 AM
01-21-2019 11:59 AM
I needed to be able to get the value of expressions in a delegate used by a sub-process and have any parent process variables mentioned within the expressions replaced with the variable values. (And without specifying every parent process variable as an in parameter.) I found I could do it using the super execution:
protected Expression colourText; // Where colourText = "My ${colour} test string";
public void execute(DelegateExecution currentExecution) {
// Get parent process execution if there's a parent otherwise use the execution of the current process.
// This allows the delegate to be used in the root process or a sub-process
DelegateExecution execution = ((ExecutionEntity)currentExecution).getSuperExecution();
if (execution == null) {
execution = currentExecution;
}String text = null;
Object value = colourText.getValue(execution);
if (value != null) {
text = value.toString(); // This will be "My red test string" if the parent process has colour set to red.
}
}
This worked with Activiti 5.21.0
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.