use of org.camunda.bpm.model.cmmn.CmmnModelInstance in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetCaseRoles.
@Test
public void shouldGetCaseRoles() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
Case _case = modelInstance.getModelElementsByType(Case.class).iterator().next();
Collection<CaseRole> roles = _case.getCaseRoles();
assertThat(roles).hasSize(2);
CaseRoles caseRole = _case.getRoles();
assertThat(caseRole).isNull();
}
use of org.camunda.bpm.model.cmmn.CmmnModelInstance 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.CmmnModelInstance in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetTaskInputsOutputs.
@Test
public void shouldGetTaskInputsOutputs() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
HumanTask humanTask = modelInstance.getModelElementsByType(HumanTask.class).iterator().next();
Collection<InputsCaseParameter> inputs = humanTask.getInputs();
assertThat(inputs).hasSize(1);
Collection<InputCaseParameter> inputParameters = humanTask.getInputParameters();
assertThat(inputParameters).isEmpty();
Collection<OutputsCaseParameter> outputs = humanTask.getOutputs();
assertThat(outputs).hasSize(1);
Collection<OutputCaseParameter> outputParameters = humanTask.getOutputParameters();
assertThat(outputParameters).isEmpty();
}
use of org.camunda.bpm.model.cmmn.CmmnModelInstance in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetMultipleIfPartConditions.
@Test
public void shouldGetMultipleIfPartConditions() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
Sentry sentry = modelInstance.getModelElementsByType(Sentry.class).iterator().next();
IfPart ifPart = sentry.getIfPart();
assertThat(ifPart).isNotNull();
Collection<ConditionExpression> conditions = ifPart.getConditions();
assertThat(conditions).hasSize(2);
ConditionExpression condition = ifPart.getCondition();
assertThat(condition).isNotNull();
}
use of org.camunda.bpm.model.cmmn.CmmnModelInstance 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