use of org.camunda.bpm.model.cmmn.instance.Event in project camunda-cmmn-model by camunda.
the class EventImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Event.class, CMMN_ELEMENT_EVENT).namespaceUri(CMMN10_NS).extendsType(PlanItemDefinition.class).instanceProvider(new ModelTypeInstanceProvider<Event>() {
public Event newInstance(ModelTypeInstanceContext instanceContext) {
return new EventImpl(instanceContext);
}
});
typeBuilder.build();
}
use of org.camunda.bpm.model.cmmn.instance.Event in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldNotAbleToAddCmmn10Element.
@Test
public void shouldNotAbleToAddCmmn10Element() {
CmmnModelInstance modelInstance = Cmmn.readModelFromStream(Cmmn10Test.class.getResourceAsStream("Cmmn11Test.cmmn"));
CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();
Event event = modelInstance.newInstance(Event.class);
casePlanModel.getPlanItemDefinitions().add(event);
try {
Cmmn.writeModelToStream(System.out, modelInstance);
fail("cannot save cmmn 1.1 model");
} catch (Exception e) {
// expected exception
}
}
use of org.camunda.bpm.model.cmmn.instance.Event 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();
}
Aggregations