Source:
<code>public ProcessInstance createProcessInstance(Process process, CorrelationKey correlationKey, InternalKnowledgeRuntime kruntime, Map<String, Object> parameters) { ProcessInstance processInstance = (ProcessInstance) createProcessInstance(); processInstance.setKnowledgeRuntime( kruntime ); processInstance.setProcess( process ); if (correlationKey != null) { processInstance.getMetaData().put("CorrelationKey", correlationKey); } InternalRuntimeManager manager = (InternalRuntimeManager) kruntime.getEnvironment().get("RuntimeManager"); if (manager != null) { processInstance.setDeploymentId(manager.getIdentifier()); } ((InternalProcessRuntime) kruntime.getProcessRuntime()).getProcessInstanceManager() .addProcessInstance( processInstance, correlationKey ); <START> if (parameters.containsKey("ParentProcessCaseId")) { <END> processInstance.getMetaData().put("ParentProcessInstanceId", (Long) parameters.get("ParentProcessCaseId")); } VariableScope variableScope = (VariableScope) ((ContextContainer) process).getDefaultContext( VariableScope.VARIABLE_SCOPE ); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) processInstance.getContextInstance( VariableScope.VARIABLE_SCOPE ); if ( parameters != null ) { if ( variableScope != null ) { for ( Map.Entry<String, Object> entry : parameters.entrySet() ) { variableScope.validateVariable(process.getName(), entry.getKey(), entry.getValue()); variableScopeInstance.setVariable( entry.getKey(), entry.getValue() ); } } else { throw new IllegalArgumentException( "This process does not support parameters!" ); } } return processInstance; }</code><technical_language>@elguardian tests failing _parameters_ is null. Need check this in line 57</technical_language>

Target:
public ProcessInstance createProcessInstance(Process process, CorrelationKey correlationKey, InternalKnowledgeRuntime kruntime, Map<String, Object> parameters) { ProcessInstance processInstance = (ProcessInstance) createProcessInstance(); processInstance.setKnowledgeRuntime( kruntime ); processInstance.setProcess( process ); if (correlationKey != null) { processInstance.getMetaData().put("CorrelationKey", correlationKey); } InternalRuntimeManager manager = (InternalRuntimeManager) kruntime.getEnvironment().get("RuntimeManager"); if (manager != null) { processInstance.setDeploymentId(manager.getIdentifier()); } ((InternalProcessRuntime) kruntime.getProcessRuntime()).getProcessInstanceManager() .addProcessInstance( processInstance, correlationKey ); if (parameters != null && parameters.containsKey("ParentInstanceId")) { processInstance.getMetaData().put("ParentProcessInstanceId", (Long) parameters.get("ParentInstanceId")); } VariableScope variableScope = (VariableScope) ((ContextContainer) process).getDefaultContext( VariableScope.VARIABLE_SCOPE ); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) processInstance.getContextInstance( VariableScope.VARIABLE_SCOPE ); if ( parameters != null ) { if ( variableScope != null ) { for ( Map.Entry<String, Object> entry : parameters.entrySet() ) { variableScope.validateVariable(process.getName(), entry.getKey(), entry.getValue()); variableScopeInstance.setVariable( entry.getKey(), entry.getValue() ); } } else { throw new IllegalArgumentException( "This process does not support parameters!" ); } } return processInstance; }