Search in sources :

Example 6 with CasePlanModel

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);
}
Also used : ExpressionManager(org.camunda.bpm.engine.impl.el.ExpressionManager) TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) CasePlanModel(org.camunda.bpm.model.cmmn.instance.CasePlanModel) Definitions(org.camunda.bpm.model.cmmn.instance.Definitions) CmmnHandlerContext(org.camunda.bpm.engine.impl.cmmn.handler.CmmnHandlerContext) CaseDefinitionEntity(org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity) Case(org.camunda.bpm.model.cmmn.instance.Case) Before(org.junit.Before)

Example 7 with CasePlanModel

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;
}
Also used : CasePlanModel(org.camunda.bpm.model.cmmn.instance.CasePlanModel) CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance) Case(org.camunda.bpm.model.cmmn.instance.Case) PluggableProcessEngineTestCase(org.camunda.bpm.engine.impl.test.PluggableProcessEngineTestCase)

Example 8 with CasePlanModel

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);
}
Also used : DeploymentEntity(org.camunda.bpm.engine.impl.persistence.entity.DeploymentEntity) CasePlanModel(org.camunda.bpm.model.cmmn.instance.CasePlanModel) Definitions(org.camunda.bpm.model.cmmn.instance.Definitions) DefaultCmmnElementHandlerRegistry(org.camunda.bpm.engine.impl.cmmn.handler.DefaultCmmnElementHandlerRegistry) CmmnTransformer(org.camunda.bpm.engine.impl.cmmn.transformer.CmmnTransformer) CmmnTransform(org.camunda.bpm.engine.impl.cmmn.transformer.CmmnTransform) Case(org.camunda.bpm.model.cmmn.instance.Case) Before(org.junit.Before)

Example 9 with CasePlanModel

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);
    }
}
Also used : CasePlanModelHandler(org.camunda.bpm.engine.impl.cmmn.handler.CasePlanModelHandler) CasePlanModel(org.camunda.bpm.model.cmmn.instance.CasePlanModel) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)

Example 10 with CasePlanModel

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;
}
Also used : CasePlanModel(org.camunda.bpm.model.cmmn.instance.CasePlanModel) CaseDefinitionEntity(org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Case(org.camunda.bpm.model.cmmn.instance.Case)

Aggregations

CasePlanModel (org.camunda.bpm.model.cmmn.instance.CasePlanModel)15 Test (org.junit.Test)10 Case (org.camunda.bpm.model.cmmn.instance.Case)9 CmmnModelInstance (org.camunda.bpm.model.cmmn.CmmnModelInstance)6 HumanTask (org.camunda.bpm.model.cmmn.instance.HumanTask)5 Definitions (org.camunda.bpm.model.cmmn.instance.Definitions)4 PlanItem (org.camunda.bpm.model.cmmn.instance.PlanItem)3 CaseDefinitionEntity (org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity)2 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)2 Before (org.junit.Before)2 CasePlanModelHandler (org.camunda.bpm.engine.impl.cmmn.handler.CasePlanModelHandler)1 CmmnHandlerContext (org.camunda.bpm.engine.impl.cmmn.handler.CmmnHandlerContext)1 DefaultCmmnElementHandlerRegistry (org.camunda.bpm.engine.impl.cmmn.handler.DefaultCmmnElementHandlerRegistry)1 CmmnTransform (org.camunda.bpm.engine.impl.cmmn.transformer.CmmnTransform)1 CmmnTransformer (org.camunda.bpm.engine.impl.cmmn.transformer.CmmnTransformer)1 ExpressionManager (org.camunda.bpm.engine.impl.el.ExpressionManager)1 DeploymentEntity (org.camunda.bpm.engine.impl.persistence.entity.DeploymentEntity)1 TaskDefinition (org.camunda.bpm.engine.impl.task.TaskDefinition)1 PluggableProcessEngineTestCase (org.camunda.bpm.engine.impl.test.PluggableProcessEngineTestCase)1 Documentation (org.camunda.bpm.model.cmmn.instance.Documentation)1