workflow.getTasks().add(getTask(getTmpPath()));
inst.setParentChildWorkflow(workflow);
inst.setPriority(Priority.getPriority(priority));
inst.setCurrentTaskId(workflow.getTasks().get(0).getTaskId());
inst.setParentChildWorkflow(workflow);
WorkflowProcessorBuilder builder = WorkflowProcessorBuilder
.aWorkflowProcessor().withLifecycleManager(lifecycleManager)
.withPriority(priority).withInstance(inst);
TaskProcessor taskProcessor = (TaskProcessor) builder
.build(TaskProcessor.class);
taskProcessor.getWorkflowInstance().setState(lifecycleManager.getDefaultLifecycle().createState(
stateName, categoryName, ""));
return taskProcessor;
}