use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-cmmn-model by camunda.
the class CreateModelTest method createCaseWithOneStageAndNestedHumanTask.
@Test
public void createCaseWithOneStageAndNestedHumanTask() {
// create process
Case caseInstance = createElement(definitions, "case-with-one-human-task", Case.class);
// create case plan model
CasePlanModel casePlanModel = createElement(caseInstance, "casePlanModel_1", CasePlanModel.class);
// create a stage
Stage stage = createElement(casePlanModel, "Stage_1", Stage.class);
// create elements
HumanTask humanTask = createElement(stage, "HumanTask_1", HumanTask.class);
// create a plan item
PlanItem planItem = createElement(stage, "PlanItem_1", PlanItem.class);
// set definition to human task
planItem.setDefinition(humanTask);
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-cmmn-model by camunda.
the class GenerateIdTest method shouldGenerateIdsOnCreate.
@Test
public void shouldGenerateIdsOnCreate() {
CmmnModelInstance modelInstance = Cmmn.createEmptyModel();
Definitions definitions = modelInstance.newInstance(Definitions.class);
assertThat(definitions.getId()).isNotNull();
Case caseElement = modelInstance.newInstance(Case.class);
assertThat(caseElement.getId()).isNotNull();
CasePlanModel casePlanModel = modelInstance.newInstance(CasePlanModel.class);
assertThat(casePlanModel.getId()).isNotNull();
HumanTask humanTask = modelInstance.newInstance(HumanTask.class);
assertThat(humanTask.getId()).isNotNull();
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetDescription.
@Test
public void shouldGetDescription() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();
String description = casePlanModel.getDescription();
assertThat(description).isEqualTo("This is a description...");
Collection<Documentation> documentations = casePlanModel.getDocumentations();
assertThat(documentations).isEmpty();
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldNotAbleToAddNewElement.
@Test
public void shouldNotAbleToAddNewElement() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();
HumanTask humanTask = modelInstance.newInstance(HumanTask.class);
casePlanModel.getPlanItemDefinitions().add(humanTask);
try {
Cmmn.writeModelToStream(System.out, modelInstance);
fail("cannot save cmmn 1.0 model");
} catch (Exception e) {
// expected exception
}
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetCasePlanModelExitCriterion.
@Test
public void shouldGetCasePlanModelExitCriterion() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();
Collection<Sentry> exitCriterias = casePlanModel.getExitCriterias();
assertThat(exitCriterias).hasSize(1);
Collection<Sentry> exitCriteria = casePlanModel.getExitCriteria();
assertThat(exitCriteria).hasSize(1);
Collection<ExitCriterion> exitCriterions = casePlanModel.getExitCriterions();
assertThat(exitCriterions).isEmpty();
}
Aggregations