Search in sources :

Example 1 with TimerEvent

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

the class TimerEventImpl method registerType.

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

        public TimerEvent newInstance(ModelTypeInstanceContext instanceContext) {
            return new TimerEventImpl(instanceContext);
        }
    });
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    timerExpressionChild = sequenceBuilder.element(TimerExpression.class).build();
    timerStartChild = sequenceBuilder.element(StartTrigger.class).build();
    typeBuilder.build();
}
Also used : SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) TimerEvent(org.camunda.bpm.model.cmmn.instance.TimerEvent) TimerEvent(org.camunda.bpm.model.cmmn.instance.TimerEvent) Event(org.camunda.bpm.model.cmmn.instance.Event) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Example 2 with TimerEvent

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