use of org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition in project camunda-bpm-platform by camunda.
the class CaseCallActivityBehavior method startInstance.
protected void startInstance(ActivityExecution execution, VariableMap variables, String businessKey) {
CmmnCaseDefinition definition = getCaseDefinitionToCall(execution, getCallableElement());
CmmnCaseInstance caseInstance = execution.createSubCaseInstance(definition, businessKey);
caseInstance.create(variables);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition 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.engine.impl.cmmn.model.CmmnCaseDefinition in project camunda-bpm-platform by camunda.
the class CallableElementUtil method getCaseDefinitionToCall.
public static CmmnCaseDefinition getCaseDefinitionToCall(VariableScope execution, BaseCallableElement callableElement) {
String caseDefinitionKey = callableElement.getDefinitionKey(execution);
String tenantId = callableElement.getDefinitionTenantId(execution);
DeploymentCache deploymentCache = getDeploymentCache();
CmmnCaseDefinition caseDefinition = null;
if (callableElement.isLatestBinding()) {
caseDefinition = deploymentCache.findDeployedLatestCaseDefinitionByKeyAndTenantId(caseDefinitionKey, tenantId);
} else if (callableElement.isDeploymentBinding()) {
String deploymentId = callableElement.getDeploymentId();
caseDefinition = deploymentCache.findDeployedCaseDefinitionByDeploymentAndKey(deploymentId, caseDefinitionKey);
} else if (callableElement.isVersionBinding()) {
Integer version = callableElement.getVersion(execution);
caseDefinition = deploymentCache.findDeployedCaseDefinitionByKeyVersionAndTenantId(caseDefinitionKey, version, tenantId);
}
return caseDefinition;
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition in project camunda-bpm-platform by camunda.
the class HumanTaskDicretionaryItemHandlerTest method testWithParent.
@Test
public void testWithParent() {
// given:
// a new activity as parent
CmmnCaseDefinition parent = new CmmnCaseDefinition("aParentActivity");
context.setParent(parent);
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
assertEquals(parent, activity.getParent());
assertTrue(parent.getActivities().contains(activity));
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition in project camunda-bpm-platform by camunda.
the class MilestoneDiscretionaryItemHandlerTest method testWithParent.
@Test
public void testWithParent() {
// given:
// a new activity as parent
CmmnCaseDefinition parent = new CmmnCaseDefinition("aParentActivity");
context.setParent(parent);
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
assertEquals(parent, activity.getParent());
assertTrue(parent.getActivities().contains(activity));
}
Aggregations