use of org.camunda.bpm.model.cmmn.instance.CaseRole in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetCaseRoles.
@Test
public void shouldGetCaseRoles() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
Case _case = modelInstance.getModelElementsByType(Case.class).iterator().next();
Collection<CaseRole> roles = _case.getCaseRoles();
assertThat(roles).hasSize(2);
CaseRoles caseRole = _case.getRoles();
assertThat(caseRole).isNull();
}
use of org.camunda.bpm.model.cmmn.instance.CaseRole in project camunda-bpm-platform by camunda.
the class HumanTaskPlanItemHandlerTest method testTaskDefinitionPeformerExpression.
@Test
public void testTaskDefinitionPeformerExpression() {
// given
CaseRole role = createElement(caseDefinition, "aRole", CaseRole.class);
role.setName("aPerformerRole");
humanTask.setPerformer(role);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
TaskDefinition taskDefinition = behavior.getTaskDefinition();
Expression assigneeExpression = taskDefinition.getAssigneeExpression();
assertNotNull(assigneeExpression);
assertEquals("aPerformerRole", assigneeExpression.getExpressionText());
}
use of org.camunda.bpm.model.cmmn.instance.CaseRole in project camunda-cmmn-model by camunda.
the class CaseRoleImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseRole.class, CMMN_ELEMENT_CASE_ROLES).namespaceUri(CMMN10_NS).extendsType(Role.class).instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider<CaseRole>() {
public CaseRole newInstance(ModelTypeInstanceContext instanceContext) {
return new CaseRoleImpl(instanceContext);
}
});
typeBuilder.build();
}
Aggregations