Search in sources :

Example 1 with HumanPerformer

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

the class ResourceRolesTest method testGetHumanPerformer.

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

Example 2 with HumanPerformer

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

the class HumanPerformerImpl method registerType.

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

        public HumanPerformer newInstance(ModelTypeInstanceContext instanceContext) {
            return new HumanPerformerImpl(instanceContext);
        }
    });
    typeBuilder.build();
}
Also used : HumanPerformer(org.camunda.bpm.model.bpmn.instance.HumanPerformer) Performer(org.camunda.bpm.model.bpmn.instance.Performer) 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

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