childExecution.setWorkflowId(workflowId);
childExecution.setRunId(runId);
final GenericActivityClient activityClient = parentDecisionContext.getActivityClient();
final WorkflowClock workflowClock = parentDecisionContext.getWorkflowClock();
WorkflowDefinitionFactory factory;
if (factoryFactory == null) {
throw new IllegalStateException("required property factoryFactory is null");
}
factory = factoryFactory.getWorkflowDefinitionFactory(workflowType);
if (factory == null) {
String cause = StartChildWorkflowExecutionFailedCause.WORKFLOW_TYPE_DOES_NOT_EXIST.toString();
throw new StartChildWorkflowFailedException(0, childExecution, workflowType, cause);
}
TestWorkflowContext workflowContext = new TestWorkflowContext();
workflowContext.setWorkflowExecution(childExecution);
workflowContext.setWorkflowType(parameters.getWorkflowType());
workflowContext.setParentWorkflowExecution(parentDecisionContext.getWorkflowContext().getWorkflowExecution());
workflowContext.setTagList(parameters.getTagList());
workflowContext.setTaskList(parameters.getTaskList());
DecisionContext context = new TestDecisionContext(activityClient, TestGenericWorkflowClient.this, workflowClock,
workflowContext);
//this, parameters, childExecution, workflowClock, activityClient);
final WorkflowDefinition childWorkflowDefinition = factory.getWorkflowDefinition(context);
final ChildWorkflowTryCatchFinally tryCatch = new ChildWorkflowTryCatchFinally(parameters, childExecution,
childWorkflowDefinition, context, result);
workflowContext.setRootTryCatch(tryCatch);
ChildWorkflowTryCatchFinally currentRun = workflowExecutions.get(workflowId);
if (currentRun != null) {