use of org.camunda.bpm.model.cmmn.instance.Task in project camunda-cmmn-model by camunda.
the class TaskImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Task.class, CMMN_ELEMENT_TASK).namespaceUri(CMMN11_NS).extendsType(PlanItemDefinition.class).instanceProvider(new ModelTypeInstanceProvider<Task>() {
public Task newInstance(ModelTypeInstanceContext instanceContext) {
return new TaskImpl(instanceContext);
}
});
isBlockingAttribute = typeBuilder.booleanAttribute(CMMN_ATTRIBUTE_IS_BLOCKING).defaultValue(true).build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
inputsCollection = sequenceBuilder.elementCollection(InputsCaseParameter.class).build();
outputsCollection = sequenceBuilder.elementCollection(OutputsCaseParameter.class).build();
inputParameterCollection = sequenceBuilder.elementCollection(InputCaseParameter.class).build();
outputParameterCollection = sequenceBuilder.elementCollection(OutputCaseParameter.class).build();
typeBuilder.build();
}
use of org.camunda.bpm.model.cmmn.instance.Task in project camunda-bpm-platform by camunda.
the class TaskItemHandler method initializeBlocking.
protected void initializeBlocking(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) {
Task task = (Task) getDefinition(element);
activity.setProperty("isBlocking", task.isBlocking());
}
use of org.camunda.bpm.model.cmmn.instance.Task in project camunda-bpm-platform by camunda.
the class CmmnTransform method transformPlanItem.
protected void transformPlanItem(PlanItem planItem, CmmnActivity parent) {
PlanItemDefinition definition = planItem.getDefinition();
ItemHandler planItemTransformer = null;
if (definition instanceof HumanTask) {
planItemTransformer = getPlanItemHandler(HumanTask.class);
} else if (definition instanceof ProcessTask) {
planItemTransformer = getPlanItemHandler(ProcessTask.class);
} else if (definition instanceof CaseTask) {
planItemTransformer = getPlanItemHandler(CaseTask.class);
} else if (definition instanceof DecisionTask) {
planItemTransformer = getPlanItemHandler(DecisionTask.class);
} else if (definition instanceof Task) {
planItemTransformer = getPlanItemHandler(Task.class);
} else if (definition instanceof Stage) {
planItemTransformer = getPlanItemHandler(Stage.class);
} else if (definition instanceof Milestone) {
planItemTransformer = getPlanItemHandler(Milestone.class);
} else if (definition instanceof EventListener) {
planItemTransformer = getPlanItemHandler(EventListener.class);
}
if (planItemTransformer != null) {
CmmnActivity newActivity = planItemTransformer.handleElement(planItem, context);
if (definition instanceof Stage) {
Stage stage = (Stage) definition;
transformStage(stage, newActivity);
context.setParent(parent);
} else if (definition instanceof HumanTask) {
HumanTask humanTask = (HumanTask) definition;
// According to the specification: A HumanTask can only contain
// one planningTable, the XSD allows multiple planningTables!
Collection<PlanningTable> planningTables = humanTask.getPlanningTables();
for (PlanningTable planningTable : planningTables) {
transformPlanningTable(planningTable, parent);
}
}
for (CmmnTransformListener transformListener : transformListeners) {
if (definition instanceof HumanTask) {
transformListener.transformHumanTask(planItem, (HumanTask) definition, newActivity);
} else if (definition instanceof ProcessTask) {
transformListener.transformProcessTask(planItem, (ProcessTask) definition, newActivity);
} else if (definition instanceof CaseTask) {
transformListener.transformCaseTask(planItem, (CaseTask) definition, newActivity);
} else if (definition instanceof DecisionTask) {
transformListener.transformDecisionTask(planItem, (DecisionTask) definition, newActivity);
} else if (definition instanceof Task) {
transformListener.transformTask(planItem, (Task) definition, newActivity);
} else if (definition instanceof Stage) {
transformListener.transformStage(planItem, (Stage) definition, newActivity);
} else if (definition instanceof Milestone) {
transformListener.transformMilestone(planItem, (Milestone) definition, newActivity);
} else if (definition instanceof EventListener) {
transformListener.transformEventListener(planItem, (EventListener) definition, newActivity);
}
}
}
}
Aggregations