public UserOperationLogContextEntryBuilder inContextOf(TaskEntity task, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); ResourceDefinitionEntity definition = task.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } else if (task.getCaseDefinitionId() != null) { definition = task.getCaseDefinition(); entry.setDeploymentId(definition.getDeploymentId()); } entry.setProcessDefinitionId(task.getProcessDefinitionId()); entry.setProcessInstanceId(task.getProcessInstanceId()); entry.setExecutionId(task.getExecutionId()); entry.setCaseDefinitionId(task.getCaseDefinitionId()); entry.setCaseInstanceId(task.getCaseInstanceId()); entry.setCaseExecutionId(task.getCaseExecutionId()); entry.setTaskId(task.getId()); ExecutionEntity execution = task.getExecution(); if (execution != null) { entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); } return this; }
public UserOperationLogContextEntryBuilder inContextOf(TaskEntity task, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); ResourceDefinitionEntity definition = task.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } else if (task.getCaseDefinitionId() != null) { definition = task.getCaseDefinition(); entry.setDeploymentId(definition.getDeploymentId()); } entry.setProcessDefinitionId(task.getProcessDefinitionId()); entry.setProcessInstanceId(task.getProcessInstanceId()); entry.setExecutionId(task.getExecutionId()); entry.setCaseDefinitionId(task.getCaseDefinitionId()); entry.setCaseInstanceId(task.getCaseInstanceId()); entry.setCaseExecutionId(task.getCaseExecutionId()); entry.setTaskId(task.getId()); ExecutionEntity execution = task.getExecution(); if (execution != null) { entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); } return this; }
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testCallProcessAsConstant() { // given String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }
assertEquals(caseInstanceId, task.getCaseInstanceId());
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testCallProcessAsExpressionStartsWithHash.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testCallProcessAsExpressionStartsWithHash() { // given // a deployed case definition String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE, Variables.createVariables().putValue("process", "oneTaskProcess")).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testCallProcessAsExpressionStartsWithDollar.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testCallProcessAsExpressionStartsWithDollar() { // given // a deployed case definition String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE, Variables.createVariables().putValue("process", "oneTaskProcess")).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testInputBusinessKey.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testInputBusinessKey() { // given String businessKey = "myBusinessKey"; String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE, businessKey).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); // the business key has been set assertEquals(businessKey, processInstance.getBusinessKey()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }
String caseInstanceId = taskEntity.getCaseInstanceId(); String tenantId = taskEntity.getTenantId();
String caseInstanceId = taskEntity.getCaseInstanceId(); String tenantId = taskEntity.getTenantId();
assertEquals(caseInstanceId, task.getCaseInstanceId());
assertEquals(caseInstanceId, task.getCaseInstanceId());
assertEquals(caseInstanceId, task.getCaseInstanceId());
assertEquals(caseInstanceId, task.getCaseInstanceId());
assertEquals(caseInstanceId, task.getCaseInstanceId());
public UserOperationLogContextEntryBuilder inContextOf(TaskEntity task, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); ResourceDefinitionEntity definition = task.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } else if (task.getCaseDefinitionId() != null) { definition = task.getCaseDefinition(); entry.setDeploymentId(definition.getDeploymentId()); } entry.setProcessDefinitionId(task.getProcessDefinitionId()); entry.setProcessInstanceId(task.getProcessInstanceId()); entry.setExecutionId(task.getExecutionId()); entry.setCaseDefinitionId(task.getCaseDefinitionId()); entry.setCaseInstanceId(task.getCaseInstanceId()); entry.setCaseExecutionId(task.getCaseExecutionId()); entry.setTaskId(task.getId()); ExecutionEntity execution = task.getExecution(); if (execution != null) { entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); } return this; }
assertEquals(caseInstanceId, task.getCaseInstanceId());
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testCallProcessAsConstant() { // given String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testCallProcessAsExpressionStartsWithHash.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testCallProcessAsExpressionStartsWithHash() { // given // a deployed case definition String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE, Variables.createVariables().putValue("process", "oneTaskProcess")).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testCallProcessAsExpressionStartsWithDollar.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testCallProcessAsExpressionStartsWithDollar() { // given // a deployed case definition String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE, Variables.createVariables().putValue("process", "oneTaskProcess")).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testInputBusinessKey.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testInputBusinessKey() { // given String businessKey = "myBusinessKey"; String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE, businessKey).getId(); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId(); // then // there exists a process instance ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance(); assertNotNull(processInstance); // the case instance id is set on called process instance assertEquals(caseInstanceId, processInstance.getCaseInstanceId()); // the super case execution id is equals the processTaskId assertEquals(processTaskId, processInstance.getSuperCaseExecutionId()); // the business key has been set assertEquals(businessKey, processInstance.getBusinessKey()); TaskEntity task = (TaskEntity) queryTask(); // the case instance id has been also set on the task assertEquals(caseInstanceId, task.getCaseInstanceId()); // the case execution id should be null assertNull(task.getCaseExecutionId()); // complete //////////////////////////////////////////////////////// taskService.complete(task.getId()); assertProcessEnded(processInstance.getId()); close(caseInstanceId); assertCaseEnded(caseInstanceId); }