public void execute(ActivityExecution execution) {
ExecutionImpl executionImpl = (ExecutionImpl) execution;
RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
ClientProcessDefinition processDefinition = null;
if (subProcessId!=null) {
processDefinition = repositorySession.findProcessDefinitionById(subProcessId);
} else {
processDefinition = repositorySession.findProcessDefinitionByKey(subProcessKey);
}
ExecutionImpl subProcessInstance = (ExecutionImpl) processDefinition.createProcessInstance(null, execution);
for (String swimlaneName: swimlaneMappings.keySet()) {
String subSwimlaneName = swimlaneMappings.get(swimlaneName);
SwimlaneImpl subSwimlane = subProcessInstance.createSwimlane(subSwimlaneName);
SwimlaneImpl swimlane = executionImpl.getSwimlane(swimlaneName);