use of org.camunda.bpm.model.cmmn.instance.HumanTask in project camunda-cmmn-model by camunda.
the class HumanTaskImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(HumanTask.class, CMMN_ELEMENT_HUMAN_TASK).namespaceUri(CMMN11_NS).extendsType(Task.class).instanceProvider(new ModelTypeInstanceProvider<HumanTask>() {
public HumanTask newInstance(ModelTypeInstanceContext instanceContext) {
return new HumanTaskImpl(instanceContext);
}
});
performerRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_PERFORMER_REF).idAttributeReference(Role.class).build();
/**
* camunda extensions
*/
camundaAssigneeAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_ASSIGNEE).namespace(CAMUNDA_NS).build();
camundaCandidateGroupsAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_GROUPS).namespace(CAMUNDA_NS).build();
camundaCandidateUsersAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_USERS).namespace(CAMUNDA_NS).build();
camundaDueDateAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DUE_DATE).namespace(CAMUNDA_NS).build();
camundaFollowUpDateAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_FOLLOW_UP_DATE).namespace(CAMUNDA_NS).build();
camundaFormKeyAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_FORM_KEY).namespace(CAMUNDA_NS).build();
camundaPriorityAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_PRIORITY).namespace(CAMUNDA_NS).build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
planningTableCollection = sequenceBuilder.elementCollection(PlanningTable.class).build();
planningTableChild = sequenceBuilder.element(PlanningTable.class).minOccurs(0).maxOccurs(1).build();
typeBuilder.build();
}
use of org.camunda.bpm.model.cmmn.instance.HumanTask in project camunda-cmmn-model by camunda.
the class CreateModelTest method createCaseWithOneHumanTask.
@Test
public void createCaseWithOneHumanTask() {
// create process
Case caseInstance = createElement(definitions, "case-with-one-human-task", Case.class);
// create case plan model
CasePlanModel casePlanModel = createElement(caseInstance, "casePlanModel_1", CasePlanModel.class);
// create elements
HumanTask humanTask = createElement(casePlanModel, "HumanTask_1", HumanTask.class);
// create a plan item
PlanItem planItem = createElement(casePlanModel, "PlanItem_1", PlanItem.class);
// set definition to human task
planItem.setDefinition(humanTask);
}
use of org.camunda.bpm.model.cmmn.instance.HumanTask in project camunda-cmmn-model by camunda.
the class GenerateIdTest method shouldNotGenerateIdsOnRead.
@Test
public void shouldNotGenerateIdsOnRead() {
CmmnModelInstance modelInstance = Cmmn.readModelFromStream(GenerateIdTest.class.getResourceAsStream("GenerateIdTest.cmmn"));
Definitions definitions = modelInstance.getDefinitions();
assertThat(definitions.getId()).isNull();
Case caseElement = modelInstance.getModelElementsByType(Case.class).iterator().next();
assertThat(caseElement.getId()).isNull();
CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();
assertThat(casePlanModel.getId()).isNull();
HumanTask humanTask = modelInstance.getModelElementsByType(HumanTask.class).iterator().next();
assertThat(humanTask.getId()).isNull();
}
use of org.camunda.bpm.model.cmmn.instance.HumanTask in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetTaskInputsOutputs.
@Test
public void shouldGetTaskInputsOutputs() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
HumanTask humanTask = modelInstance.getModelElementsByType(HumanTask.class).iterator().next();
Collection<InputsCaseParameter> inputs = humanTask.getInputs();
assertThat(inputs).hasSize(1);
Collection<InputCaseParameter> inputParameters = humanTask.getInputParameters();
assertThat(inputParameters).isEmpty();
Collection<OutputsCaseParameter> outputs = humanTask.getOutputs();
assertThat(outputs).hasSize(1);
Collection<OutputCaseParameter> outputParameters = humanTask.getOutputParameters();
assertThat(outputParameters).isEmpty();
}
use of org.camunda.bpm.model.cmmn.instance.HumanTask in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionName.
protected void initializeTaskDefinitionName(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
String name = getName(element);
if (name == null) {
HumanTask definition = getDefinition(element);
name = definition.getName();
}
if (name != null) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression nameExpression = expressionManager.createExpression(name);
taskDefinition.setNameExpression(nameExpression);
}
}
Aggregations