Search in sources :

Example 1 with Performer

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

the class PerformerImpl method registerType.

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

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

Example 2 with Performer

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

the class ResourceRolesTest method testGetPerformer.

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

Aggregations

Performer (org.camunda.bpm.model.bpmn.instance.Performer)2 ResourceRole (org.camunda.bpm.model.bpmn.instance.ResourceRole)2 HumanPerformer (org.camunda.bpm.model.bpmn.instance.HumanPerformer)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