Search in sources :

Example 1 with PotentialOwner

use of org.camunda.bpm.model.bpmn.instance.PotentialOwner in project camunda-bpmn-model by camunda.

the class ResourceRolesTest method testGetPotentialOwner.

@Test
public void testGetPotentialOwner() {
    UserTask userTask = modelInstance.getModelElementById("_9");
    Collection<ResourceRole> resourceRoles = userTask.getResourceRoles();
    assertThat(resourceRoles.size()).isEqualTo(1);
    ResourceRole resourceRole = resourceRoles.iterator().next();
    assertThat(resourceRole instanceof PotentialOwner).isTrue();
    assertThat(resourceRole.getName()).isEqualTo("Task potential owner");
}
Also used : ResourceRole(org.camunda.bpm.model.bpmn.instance.ResourceRole) UserTask(org.camunda.bpm.model.bpmn.instance.UserTask) PotentialOwner(org.camunda.bpm.model.bpmn.instance.PotentialOwner) Test(org.junit.Test)

Example 2 with PotentialOwner

use of org.camunda.bpm.model.bpmn.instance.PotentialOwner in project camunda-bpmn-model by camunda.

the class PotentialOwnerImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PotentialOwner.class, BPMN_ELEMENT_POTENTIAL_OWNER).namespaceUri(BPMN20_NS).extendsType(HumanPerformer.class).instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider<PotentialOwner>() {

        public PotentialOwner newInstance(ModelTypeInstanceContext instanceContext) {
            return new PotentialOwnerImpl(instanceContext);
        }
    });
    typeBuilder.build();
}
Also used : PotentialOwner(org.camunda.bpm.model.bpmn.instance.PotentialOwner) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext) HumanPerformer(org.camunda.bpm.model.bpmn.instance.HumanPerformer)

Aggregations

PotentialOwner (org.camunda.bpm.model.bpmn.instance.PotentialOwner)2 HumanPerformer (org.camunda.bpm.model.bpmn.instance.HumanPerformer)1 ResourceRole (org.camunda.bpm.model.bpmn.instance.ResourceRole)1 UserTask (org.camunda.bpm.model.bpmn.instance.UserTask)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 Test (org.junit.Test)1