Search in sources :

Example 1 with CaseRoles

use of org.camunda.bpm.model.cmmn.instance.CaseRoles 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();
}
Also used : CaseRoles(org.camunda.bpm.model.cmmn.instance.CaseRoles) CaseRole(org.camunda.bpm.model.cmmn.instance.CaseRole) CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance) Case(org.camunda.bpm.model.cmmn.instance.Case) Test(org.junit.Test)

Example 2 with CaseRoles

use of org.camunda.bpm.model.cmmn.instance.CaseRoles in project camunda-cmmn-model by camunda.

the class CaseRolesImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseRoles.class, CMMN_ELEMENT_CASE_ROLES).namespaceUri(CMMN11_NS).instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider<CaseRoles>() {

        public CaseRoles newInstance(ModelTypeInstanceContext instanceContext) {
            return new CaseRolesImpl(instanceContext);
        }
    });
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    roleCollection = sequenceBuilder.elementCollection(Role.class).build();
    typeBuilder.build();
}
Also used : CaseRoles(org.camunda.bpm.model.cmmn.instance.CaseRoles) SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

CaseRoles (org.camunda.bpm.model.cmmn.instance.CaseRoles)2 CmmnModelInstance (org.camunda.bpm.model.cmmn.CmmnModelInstance)1 Case (org.camunda.bpm.model.cmmn.instance.Case)1 CaseRole (org.camunda.bpm.model.cmmn.instance.CaseRole)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1 Test (org.junit.Test)1