@Override public String getCaseInstanceId() { return executionEntity.getCaseInstanceId(); }
@Override public String getCaseInstanceId() { return executionEntity.getCaseInstanceId(); }
public void setExecution(PvmExecutionImpl execution) { if (execution!=null) { this.execution = (ExecutionEntity) execution; this.executionId = this.execution.getId(); this.processInstanceId = this.execution.getProcessInstanceId(); this.processDefinitionId = this.execution.getProcessDefinitionId(); // get the process instance ExecutionEntity instance = this.execution.getProcessInstance(); if (instance != null) { // set case instance id on this task this.caseInstanceId = instance.getCaseInstanceId(); } } else { this.execution = null; this.executionId = null; this.processInstanceId = null; this.processDefinitionId = null; this.caseInstanceId = null; } }
public void setExecution(PvmExecutionImpl execution) { if (execution!=null) { this.execution = (ExecutionEntity) execution; this.executionId = this.execution.getId(); this.processInstanceId = this.execution.getProcessInstanceId(); this.processDefinitionId = this.execution.getProcessDefinitionId(); // get the process instance ExecutionEntity instance = this.execution.getProcessInstance(); if (instance != null) { // set case instance id on this task this.caseInstanceId = instance.getCaseInstanceId(); } } else { this.execution = null; this.executionId = null; this.processInstanceId = null; this.processDefinitionId = null; this.caseInstanceId = null; } }
public UserOperationLogContextEntryBuilder inContextOf(ExecutionEntity processInstance, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); entry.setRootProcessInstanceId(processInstance.getRootProcessInstanceId()); entry.setProcessInstanceId(processInstance.getProcessInstanceId()); entry.setProcessDefinitionId(processInstance.getProcessDefinitionId()); entry.setExecutionId(processInstance.getId()); entry.setCaseInstanceId(processInstance.getCaseInstanceId()); ResourceDefinitionEntity definition = processInstance.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } return this; }
public UserOperationLogContextEntryBuilder inContextOf(ExecutionEntity processInstance, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); entry.setRootProcessInstanceId(processInstance.getRootProcessInstanceId()); entry.setProcessInstanceId(processInstance.getProcessInstanceId()); entry.setProcessDefinitionId(processInstance.getProcessDefinitionId()); entry.setExecutionId(processInstance.getId()); entry.setCaseInstanceId(processInstance.getCaseInstanceId()); ResourceDefinitionEntity definition = processInstance.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } return this; }
@Override public String getCaseInstanceId() { return executionEntity.getCaseInstanceId(); }
protected void initProcessInstanceEvent(HistoricProcessInstanceEventEntity evt, ExecutionEntity execution, HistoryEventType eventType) { String processDefinitionId = execution.getProcessDefinitionId(); String processInstanceId = execution.getProcessInstanceId(); String executionId = execution.getId(); // the given execution is the process instance! String caseInstanceId = execution.getCaseInstanceId(); String tenantId = execution.getTenantId(); ProcessDefinitionEntity definition = execution.getProcessDefinition(); String processDefinitionKey = null; if (definition != null) { processDefinitionKey = definition.getKey(); } evt.setId(processInstanceId); evt.setEventType(eventType.getEventName()); evt.setProcessDefinitionKey(processDefinitionKey); evt.setProcessDefinitionId(processDefinitionId); evt.setProcessInstanceId(processInstanceId); evt.setExecutionId(executionId); evt.setBusinessKey(execution.getProcessBusinessKey()); evt.setCaseInstanceId(caseInstanceId); evt.setTenantId(tenantId); evt.setRootProcessInstanceId(execution.getRootProcessInstanceId()); if (execution.getSuperCaseExecution() != null) { evt.setSuperCaseInstanceId(execution.getSuperCaseExecution().getCaseInstanceId()); } if (execution.getSuperExecution() != null) { evt.setSuperProcessInstanceId(execution.getSuperExecution().getProcessInstanceId()); } }
protected void initProcessInstanceEvent(HistoricProcessInstanceEventEntity evt, ExecutionEntity execution, HistoryEventType eventType) { String processDefinitionId = execution.getProcessDefinitionId(); String processInstanceId = execution.getProcessInstanceId(); String executionId = execution.getId(); // the given execution is the process instance! String caseInstanceId = execution.getCaseInstanceId(); String tenantId = execution.getTenantId(); ProcessDefinitionEntity definition = execution.getProcessDefinition(); String processDefinitionKey = null; if (definition != null) { processDefinitionKey = definition.getKey(); } evt.setId(processInstanceId); evt.setEventType(eventType.getEventName()); evt.setProcessDefinitionKey(processDefinitionKey); evt.setProcessDefinitionId(processDefinitionId); evt.setProcessInstanceId(processInstanceId); evt.setExecutionId(executionId); evt.setBusinessKey(execution.getProcessBusinessKey()); evt.setCaseInstanceId(caseInstanceId); evt.setTenantId(tenantId); evt.setRootProcessInstanceId(execution.getRootProcessInstanceId()); if (execution.getSuperCaseExecution() != null) { evt.setSuperCaseInstanceId(execution.getSuperCaseExecution().getCaseInstanceId()); } if (execution.getSuperExecution() != null) { evt.setSuperProcessInstanceId(execution.getSuperExecution().getProcessInstanceId()); } }
assertEquals(caseInstanceId, processInstance.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.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.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.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); }
public UserOperationLogContextEntryBuilder inContextOf(ExecutionEntity processInstance, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); entry.setRootProcessInstanceId(processInstance.getRootProcessInstanceId()); entry.setProcessInstanceId(processInstance.getProcessInstanceId()); entry.setProcessDefinitionId(processInstance.getProcessDefinitionId()); entry.setExecutionId(processInstance.getId()); entry.setCaseInstanceId(processInstance.getCaseInstanceId()); ResourceDefinitionEntity definition = processInstance.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } return this; }
assertEquals(caseInstanceId, processInstance.getCaseInstanceId());
assertEquals(caseInstanceId, processInstance.getCaseInstanceId());
assertEquals(caseInstanceId, processInstance.getCaseInstanceId());
assertEquals(caseInstanceId, processInstance.getCaseInstanceId());
assertEquals(caseInstanceId, processInstance.getCaseInstanceId());