Search in sources :

Example 1 with UserEvent

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

the class UserEventImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(UserEvent.class, CMMN_ELEMENT_USER_EVENT).namespaceUri(CMMN10_NS).extendsType(Event.class).instanceProvider(new ModelTypeInstanceProvider<UserEvent>() {

        public UserEvent newInstance(ModelTypeInstanceContext instanceContext) {
            return new UserEventImpl(instanceContext);
        }
    });
    typeBuilder.build();
}
Also used : ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) UserEvent(org.camunda.bpm.model.cmmn.instance.UserEvent) Event(org.camunda.bpm.model.cmmn.instance.Event) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext) UserEvent(org.camunda.bpm.model.cmmn.instance.UserEvent)

Example 2 with UserEvent

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

the class Cmmn10Test method shouldGetEvents.

@Test
public void shouldGetEvents() {
    CmmnModelInstance modelInstance = getCmmnModelInstance();
    Event event = modelInstance.getModelElementsByType(Event.class).iterator().next();
    assertThat(event).isNotNull();
    UserEvent userEvent = modelInstance.getModelElementsByType(UserEvent.class).iterator().next();
    assertThat(userEvent).isNotNull();
    TimerEvent timerEvent = modelInstance.getModelElementsByType(TimerEvent.class).iterator().next();
    assertThat(timerEvent).isNotNull();
}
Also used : TimerEvent(org.camunda.bpm.model.cmmn.instance.TimerEvent) Event(org.camunda.bpm.model.cmmn.instance.Event) UserEvent(org.camunda.bpm.model.cmmn.instance.UserEvent) TimerEvent(org.camunda.bpm.model.cmmn.instance.TimerEvent) CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance) UserEvent(org.camunda.bpm.model.cmmn.instance.UserEvent) Test(org.junit.Test)

Aggregations

Event (org.camunda.bpm.model.cmmn.instance.Event)2 UserEvent (org.camunda.bpm.model.cmmn.instance.UserEvent)2 CmmnModelInstance (org.camunda.bpm.model.cmmn.CmmnModelInstance)1 TimerEvent (org.camunda.bpm.model.cmmn.instance.TimerEvent)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