use of org.camunda.bpm.model.cmmn.CmmnModelInstance in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldGetExpressionTextContent.
@Test
public void shouldGetExpressionTextContent() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
ConditionExpression expression = modelInstance.getModelElementsByType(ConditionExpression.class).iterator().next();
assertThat(expression.getBody()).isEqualTo("${value >= 100}");
assertThat(expression.getText()).isEqualTo("${value >= 100}");
}
use of org.camunda.bpm.model.cmmn.CmmnModelInstance in project camunda-cmmn-model by camunda.
the class Cmmn10Test method shouldReturnCmmn11Namespace.
@Test
public void shouldReturnCmmn11Namespace() {
CmmnModelInstance modelInstance = getCmmnModelInstance();
CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();
assertThat(casePlanModel.getElementType().getTypeNamespace()).isEqualTo(CmmnModelConstants.CMMN11_NS);
}
use of org.camunda.bpm.model.cmmn.CmmnModelInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionCmdsTenantCheckTest method getCmmnModelInstanceDisabledTenantCheck.
@Test
public void getCmmnModelInstanceDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
CmmnModelInstance modelInstance = repositoryService.getCmmnModelInstance(caseDefinitionId);
assertThat(modelInstance, notNullValue());
}
use of org.camunda.bpm.model.cmmn.CmmnModelInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionCmdsTenantCheckTest method getCmmnModelInstanceWithAuthenticatedTenant.
@Test
public void getCmmnModelInstanceWithAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
CmmnModelInstance modelInstance = repositoryService.getCmmnModelInstance(caseDefinitionId);
assertThat(modelInstance, notNullValue());
}
use of org.camunda.bpm.model.cmmn.CmmnModelInstance 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);
}
Aggregations