|| (workflow.getName() != null && workflow.getName().equals(""))) {
workflow.setName(graph.getExecutionType() + "-" + workflow.getId());
}
this.workflows.put(graph.getModelId(), workflow);
} else if (graph.getExecutionType().equals("condition")) {
WorkflowCondition cond = null;
if (graph.getModelIdRef() != null && !graph.getModelIdRef().equals("")) {
cond = this.conditions.get(graph.getModelIdRef());
} else {
cond = new WorkflowCondition();
cond.setConditionId(graph.getModelId());
cond.setConditionName(graph.getModelName());
cond.setConditionInstanceClassName(graph.getClazz());
cond.setTimeoutSeconds(graph.getTimeout());
cond.setOptional(graph.isOptional());
cond.setCondConfig(convertToConditionConfiguration(staticMetadata));
if (cond.getConditionName() == null
|| (cond.getConditionName() != null && cond.getConditionName()
.equals(""))) {
cond.setConditionName(cond.getConditionId());
}
this.conditions.put(graph.getModelId(), cond);
}
graph.setCond(cond);
if (graph.getParent() != null) {
if (graph.getParent().getWorkflow() != null) {
System.out.println("Adding condition: [" + cond.getConditionName()
+ "] to parent workflow: ["
+ graph.getParent().getWorkflow().getName() + "]");
graph.getParent().getWorkflow().getConditions().add(cond);
} else if (graph.getParent().getTask() != null) {
graph.getParent().getTask().getConditions().add(cond);