Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,20 @@ protected void doMoveExecutionState(ProcessInstanceChangeState processInstanceCh
if (moveExecutionContainer.isMoveToSubProcessInstance()) {
CallActivity callActivity = moveExecutionContainer.getCallActivity();
Process subProcess = moveExecutionContainer.getSubProcessModel().getProcessById(moveExecutionContainer.getSubProcessDefKey());
ExecutionEntity callActivityInstanceExecution = createCallActivityInstance(callActivity, moveExecutionContainer.getSubProcessDefinition(), newChildExecutions.get(0), subProcess.getInitialFlowElement().getId(), commandContext);
if (subProcess == null) {
throw new FlowableException("Could not find sub process with key '" + moveExecutionContainer.getSubProcessDefKey()
+ "' in the sub process model. Call activity '" + callActivity.getId() + "' references a sub process that could not be resolved.");
}
FlowElement initialFlowElement = subProcess.getInitialFlowElement();
if (initialFlowElement == null) {
throw new FlowableException("No initial flow element found in sub process '" + subProcess.getId()
+ "'. The sub process definition may be missing a start event.");
}
if (newChildExecutions.isEmpty()) {
throw new FlowableException("No child executions were created for the sub process instance move to call activity '"
+ callActivity.getId() + "'.");
}
ExecutionEntity callActivityInstanceExecution = createCallActivityInstance(callActivity, moveExecutionContainer.getSubProcessDefinition(), newChildExecutions.get(0), initialFlowElement.getId(), commandContext);
List<ExecutionEntity> moveExecutions = moveExecutionContainer.getExecutions();

MoveExecutionEntityContainer subProcessMoveExecutionEntityContainer = new MoveExecutionEntityContainer(moveExecutions,
Expand Down Expand Up @@ -849,6 +862,10 @@ protected List<ExecutionEntity> createEmbeddedSubProcessAndExecutions(Collection

// The default parent execution is retrieved from the match with the first source execution
ExecutionEntity defaultContinueParentExecution = moveExecutionEntityContainer.getContinueParentExecution(movingExecutions.get(0).getId());
if (defaultContinueParentExecution == null) {
throw new FlowableException("No continue parent execution found for execution '" + movingExecutions.get(0).getId()
+ "'. This may indicate that the parent execution could not be resolved during the state change.");
}
Set<String> movingExecutionIds = movingExecutions.stream().map(ExecutionEntity::getId).collect(Collectors.toSet());

// Build the subProcess hierarchy
Expand Down