use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-cmmn-model by camunda.
the class GenerateIdTest method shouldNotGenerateIdsOnRead.
@Test
public void shouldNotGenerateIdsOnRead() {
CmmnModelInstance modelInstance = Cmmn.readModelFromStream(GenerateIdTest.class.getResourceAsStream("GenerateIdTest.cmmn"));
Definitions definitions = modelInstance.getDefinitions();
assertThat(definitions.getId()).isNull();
Case caseElement = modelInstance.getModelElementsByType(Case.class).iterator().next();
assertThat(caseElement.getId()).isNull();
CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();
assertThat(casePlanModel.getId()).isNull();
HumanTask humanTask = modelInstance.getModelElementsByType(HumanTask.class).iterator().next();
assertThat(humanTask.getId()).isNull();
}
use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-bpm-platform by camunda.
the class CmmnTransform method transformCaseDefinitions.
protected void transformCaseDefinitions() {
Definitions definitions = model.getDefinitions();
Collection<Case> cases = definitions.getCases();
for (Case currentCase : cases) {
context.setCaseDefinition(null);
context.setParent(null);
CmmnCaseDefinition caseDefinition = transformCase(currentCase);
caseDefinitions.add((CaseDefinitionEntity) caseDefinition);
}
}
use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-bpm-platform by camunda.
the class CmmnTransform method transformRootElement.
protected void transformRootElement() {
transformImports();
transformCaseDefinitions();
Definitions definitions = model.getDefinitions();
for (CmmnTransformListener transformListener : transformListeners) {
transformListener.transformRootElement(definitions, caseDefinitions);
}
}
use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-bpm-platform by camunda.
the class CaseHandler method initializeActivity.
protected void initializeActivity(Case element, CmmnActivity activity, CmmnHandlerContext context) {
CaseDefinitionEntity definition = (CaseDefinitionEntity) activity;
Deployment deployment = context.getDeployment();
definition.setKey(element.getId());
definition.setName(element.getName());
definition.setDeploymentId(deployment.getId());
definition.setTaskDefinitions(new HashMap<String, TaskDefinition>());
definition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(element.getCamundaHistoryTimeToLiveString()));
CmmnModelInstance model = context.getModel();
Definitions definitions = model.getDefinitions();
String category = definitions.getTargetNamespace();
definition.setCategory(category);
}
use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-bpm-platform by camunda.
the class CmmnElementHandlerTest method setup.
@Before
public void setup() {
modelInstance = Cmmn.createEmptyModel();
definitions = modelInstance.newInstance(Definitions.class);
definitions.setTargetNamespace("http://camunda.org/examples");
modelInstance.setDefinitions(definitions);
caseDefinition = createElement(definitions, "aCaseDefinition", Case.class);
casePlanModel = createElement(caseDefinition, "aCasePlanModel", CasePlanModel.class);
context = new CmmnHandlerContext();
CaseDefinitionEntity caseDefinition = new CaseDefinitionEntity();
caseDefinition.setTaskDefinitions(new HashMap<String, TaskDefinition>());
context.setCaseDefinition(caseDefinition);
ExpressionManager expressionManager = new ExpressionManager();
context.setExpressionManager(expressionManager);
}
Aggregations