use of org.camunda.bpm.model.cmmn.instance.CasePlanModel 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);
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-bpm-platform by camunda.
the class CmmnDeployerTest method createCmmnModelInstance.
protected static CmmnModelInstance createCmmnModelInstance() {
final CmmnModelInstance modelInstance = Cmmn.createEmptyModel();
org.camunda.bpm.model.cmmn.instance.Definitions definitions = modelInstance.newInstance(org.camunda.bpm.model.cmmn.instance.Definitions.class);
definitions.setTargetNamespace("http://camunda.org/examples");
modelInstance.setDefinitions(definitions);
Case caseElement = modelInstance.newInstance(Case.class);
caseElement.setId("a-case");
definitions.addChildElement(caseElement);
CasePlanModel casePlanModel = modelInstance.newInstance(CasePlanModel.class);
caseElement.setCasePlanModel(casePlanModel);
Cmmn.writeModelToStream(System.out, modelInstance);
return modelInstance;
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-bpm-platform by camunda.
the class CmmnTransformerTest method setup.
@Before
public void setup() {
CmmnTransformer transformerWrapper = new CmmnTransformer(null, new DefaultCmmnElementHandlerRegistry(), null);
transformer = new CmmnTransform(transformerWrapper);
deployment = new DeploymentEntity();
deployment.setId("aDeploymentId");
transformer.setDeployment(deployment);
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);
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-bpm-platform by camunda.
the class CmmnTransform method transformCasePlanModel.
protected void transformCasePlanModel(CasePlanModel casePlanModel) {
CasePlanModelHandler transformer = (CasePlanModelHandler) getPlanItemHandler(CasePlanModel.class);
CmmnActivity newActivity = transformer.handleElement(casePlanModel, context);
context.setParent(newActivity);
transformStage(casePlanModel, newActivity);
context.setParent(newActivity);
transformer.initializeExitCriterias(casePlanModel, newActivity, context);
for (CmmnTransformListener transformListener : transformListeners) {
transformListener.transformCasePlanModel((org.camunda.bpm.model.cmmn.impl.instance.CasePlanModel) casePlanModel, newActivity);
}
}
use of org.camunda.bpm.model.cmmn.instance.CasePlanModel in project camunda-bpm-platform by camunda.
the class CmmnTransform method transformCase.
protected CaseDefinitionEntity transformCase(Case element) {
// get CaseTransformer
CmmnElementHandler<Case, CmmnActivity> caseTransformer = getDefinitionHandler(Case.class);
CmmnActivity definition = caseTransformer.handleElement(element, context);
context.setCaseDefinition((CmmnCaseDefinition) definition);
context.setParent(definition);
CasePlanModel casePlanModel = element.getCasePlanModel();
transformCasePlanModel(casePlanModel);
for (CmmnTransformListener transformListener : transformListeners) {
transformListener.transformCase(element, (CmmnCaseDefinition) definition);
}
return (CaseDefinitionEntity) definition;
}
Aggregations