use of org.activiti.workflow.simple.converter.listener.WorkflowDefinitionConversionListener in project Activiti by Activiti.
the class WorkflowDefinitionConversion method convert.
/**
* Call this method to actually execute the conversion of the {@link WorkflowDefinition}
* which was provided in the constructor.
*/
public void convert() {
if (workflowDefinition == null) {
throw new SimpleWorkflowException("Cannot start conversion: need to set a WorkflowDefinition first!");
}
this.incrementalIdMapping = new HashMap<String, Integer>();
this.additionalArtifacts = new HashMap<String, Object>();
// Create new process
bpmnModel = new BpmnModel();
process = new Process();
bpmnModel.addProcess(process);
// Let conversion listeners know initialization is finished
if (conversionFactory.getAllWorkflowDefinitionConversionListeners() != null) {
for (WorkflowDefinitionConversionListener conversionListener : conversionFactory.getAllWorkflowDefinitionConversionListeners()) {
conversionListener.beforeStepsConversion(this);
}
}
// Convert each step
convertSteps(workflowDefinition.getSteps());
// Let conversion listeners know step conversion is done
if (conversionFactory.getAllWorkflowDefinitionConversionListeners() != null) {
for (WorkflowDefinitionConversionListener conversionListener : conversionFactory.getAllWorkflowDefinitionConversionListeners()) {
conversionListener.afterStepsConversion(this);
}
}
// Add DI information to bpmn model
BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
bpmnAutoLayout.execute();
}
use of org.activiti.workflow.simple.converter.listener.WorkflowDefinitionConversionListener in project Activiti by Activiti.
the class WorkflowDefinitionConversionFactory method initDefaultWorkflowDefinitionConversionListeners.
protected void initDefaultWorkflowDefinitionConversionListeners() {
List<WorkflowDefinitionConversionListener> listeners = new ArrayList<WorkflowDefinitionConversionListener>();
listeners.add(new DefaultWorkflowDefinitionConversionListener());
setDefaultWorkflowDefinitionConversionListeners(listeners);
}
Aggregations