Search in sources :

Example 6 with CmmnModelInstance

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}");
}
Also used : ConditionExpression(org.camunda.bpm.model.cmmn.instance.ConditionExpression) CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance) Test(org.junit.Test)

Example 7 with CmmnModelInstance

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);
}
Also used : CasePlanModel(org.camunda.bpm.model.cmmn.instance.CasePlanModel) CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance) Test(org.junit.Test)

Example 8 with CmmnModelInstance

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());
}
Also used : CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance) Test(org.junit.Test)

Example 9 with CmmnModelInstance

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());
}
Also used : CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance) Test(org.junit.Test)

Example 10 with CmmnModelInstance

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);
}
Also used : TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) CaseDefinitionEntity(org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity) Definitions(org.camunda.bpm.model.cmmn.instance.Definitions) Deployment(org.camunda.bpm.engine.repository.Deployment) CmmnModelInstance(org.camunda.bpm.model.cmmn.CmmnModelInstance)

Aggregations

CmmnModelInstance (org.camunda.bpm.model.cmmn.CmmnModelInstance)22 Test (org.junit.Test)14 CasePlanModel (org.camunda.bpm.model.cmmn.instance.CasePlanModel)6 Case (org.camunda.bpm.model.cmmn.instance.Case)4 Sentry (org.camunda.bpm.model.cmmn.instance.Sentry)4 HumanTask (org.camunda.bpm.model.cmmn.instance.HumanTask)3 PlanItem (org.camunda.bpm.model.cmmn.instance.PlanItem)3 CaseDefinitionEntity (org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity)2 PluggableProcessEngineTestCase (org.camunda.bpm.engine.impl.test.PluggableProcessEngineTestCase)2 ConditionExpression (org.camunda.bpm.model.cmmn.instance.ConditionExpression)2 Event (org.camunda.bpm.model.cmmn.instance.Event)2 ExitCriterion (org.camunda.bpm.model.cmmn.instance.ExitCriterion)2 TimerEvent (org.camunda.bpm.model.cmmn.instance.TimerEvent)2 UserEvent (org.camunda.bpm.model.cmmn.instance.UserEvent)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 HashSet (java.util.HashSet)1 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)1 ResourceEntity (org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity)1