@Override public String getRootProcessInstanceId() { return executionEntity.getRootProcessInstanceId(); }
@Override public String getRootProcessInstanceId() { return executionEntity.getRootProcessInstanceId(); }
@Override public void start(Map<String, Object> variables) { if (getSuperExecution() == null) { setRootProcessInstanceId(processInstanceId); } else { ExecutionEntity superExecution = getSuperExecution(); setRootProcessInstanceId(superExecution.getRootProcessInstanceId()); } // determine tenant Id if null provideTenantId(variables); super.start(variables); }
@Override public void start(Map<String, Object> variables) { if (getSuperExecution() == null) { setRootProcessInstanceId(processInstanceId); } else { ExecutionEntity superExecution = getSuperExecution(); setRootProcessInstanceId(superExecution.getRootProcessInstanceId()); } // determine tenant Id if null provideTenantId(variables); super.start(variables); }
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; }
public UserOperationLogContextEntryBuilder inContextOf(ExecutionEntity execution) { entry.setProcessInstanceId(execution.getProcessInstanceId()); entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); entry.setProcessDefinitionId(execution.getProcessDefinitionId()); ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) execution.getProcessDefinition(); entry.setProcessDefinitionKey(processDefinition.getKey()); entry.setDeploymentId(processDefinition.getDeploymentId()); return this; }
public UserOperationLogContextEntryBuilder inContextOf(ExecutionEntity execution) { entry.setProcessInstanceId(execution.getProcessInstanceId()); entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); entry.setProcessDefinitionId(execution.getProcessDefinitionId()); ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) execution.getProcessDefinition(); entry.setProcessDefinitionKey(processDefinition.getKey()); entry.setDeploymentId(processDefinition.getDeploymentId()); return this; }
public UserOperationLogContextEntryBuilder inContextOf(JobEntity job) { entry.setJobDefinitionId(job.getJobDefinitionId()); entry.setProcessInstanceId(job.getProcessInstanceId()); entry.setProcessDefinitionId(job.getProcessDefinitionId()); entry.setProcessDefinitionKey(job.getProcessDefinitionKey()); entry.setDeploymentId(job.getDeploymentId()); ExecutionEntity execution = job.getExecution(); if (execution != null) { entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); } return this; }
public UserOperationLogContextEntryBuilder inContextOf(JobEntity job) { entry.setJobDefinitionId(job.getJobDefinitionId()); entry.setProcessInstanceId(job.getProcessInstanceId()); entry.setProcessDefinitionId(job.getProcessDefinitionId()); entry.setProcessDefinitionKey(job.getProcessDefinitionKey()); entry.setDeploymentId(job.getDeploymentId()); ExecutionEntity execution = job.getExecution(); if (execution != null) { entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); } return this; }
protected void setReferenceToProcessInstance(HistoricDecisionInstanceEntity event, ExecutionEntity execution) { event.setProcessDefinitionKey(getProcessDefinitionKey(execution)); event.setProcessDefinitionId(execution.getProcessDefinitionId()); event.setRootProcessInstanceId(execution.getRootProcessInstanceId()); event.setProcessInstanceId(execution.getProcessInstanceId()); event.setExecutionId(execution.getId()); event.setActivityId(execution.getActivityId()); event.setActivityInstanceId(execution.getActivityInstanceId()); }
protected void setReferenceToProcessInstance(HistoricDecisionInstanceEntity event, ExecutionEntity execution) { event.setProcessDefinitionKey(getProcessDefinitionKey(execution)); event.setProcessDefinitionId(execution.getProcessDefinitionId()); event.setRootProcessInstanceId(execution.getRootProcessInstanceId()); event.setProcessInstanceId(execution.getProcessInstanceId()); event.setExecutionId(execution.getId()); event.setActivityId(execution.getActivityId()); event.setActivityInstanceId(execution.getActivityInstanceId()); }
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; }
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()); } }
public HistoryEvent createFormPropertyUpdateEvt(ExecutionEntity execution, String propertyId, String propertyValue, String taskId) { final IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator(); HistoricFormPropertyEventEntity historicFormPropertyEntity = newHistoricFormPropertyEvent(); historicFormPropertyEntity.setId(idGenerator.getNextId()); historicFormPropertyEntity.setEventType(HistoryEventTypes.FORM_PROPERTY_UPDATE.getEventName()); historicFormPropertyEntity.setTimestamp(ClockUtil.getCurrentTime()); historicFormPropertyEntity.setActivityInstanceId(execution.getActivityInstanceId()); historicFormPropertyEntity.setExecutionId(execution.getId()); historicFormPropertyEntity.setProcessDefinitionId(execution.getProcessDefinitionId()); historicFormPropertyEntity.setProcessInstanceId(execution.getProcessInstanceId()); historicFormPropertyEntity.setPropertyId(propertyId); historicFormPropertyEntity.setPropertyValue(propertyValue); historicFormPropertyEntity.setTaskId(taskId); historicFormPropertyEntity.setTenantId(execution.getTenantId()); historicFormPropertyEntity.setUserOperationId(Context.getCommandContext().getOperationId()); historicFormPropertyEntity.setRootProcessInstanceId(execution.getRootProcessInstanceId()); if (isHistoryRemovalTimeStrategyStart()) { provideRemovalTime(historicFormPropertyEntity); } ProcessDefinitionEntity definition = execution.getProcessDefinition(); if (definition != null) { historicFormPropertyEntity.setProcessDefinitionKey(definition.getKey()); } // initialize sequence counter initSequenceCounter(execution, historicFormPropertyEntity); return historicFormPropertyEntity; }
protected HistoricExternalTaskLogEntity initHistoricExternalTaskLog(ExternalTaskEntity entity, ExternalTaskState state) { HistoricExternalTaskLogEntity event = new HistoricExternalTaskLogEntity(); event.setTimestamp(ClockUtil.getCurrentTime()); event.setExternalTaskId(entity.getId()); event.setTopicName(entity.getTopicName()); event.setWorkerId(entity.getWorkerId()); event.setPriority(entity.getPriority()); event.setRetries(entity.getRetries()); event.setActivityId(entity.getActivityId()); event.setActivityInstanceId(entity.getActivityInstanceId()); event.setExecutionId(entity.getExecutionId()); event.setProcessInstanceId(entity.getProcessInstanceId()); event.setProcessDefinitionId(entity.getProcessDefinitionId()); event.setProcessDefinitionKey(entity.getProcessDefinitionKey()); event.setTenantId(entity.getTenantId()); event.setState(state.getStateCode()); ExecutionEntity execution = entity.getExecution(); if (execution != null) { event.setRootProcessInstanceId(execution.getRootProcessInstanceId()); if (isHistoryRemovalTimeStrategyStart()) { provideRemovalTime(event); } } return event; }
public HistoryEvent createFormPropertyUpdateEvt(ExecutionEntity execution, String propertyId, String propertyValue, String taskId) { final IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator(); HistoricFormPropertyEventEntity historicFormPropertyEntity = newHistoricFormPropertyEvent(); historicFormPropertyEntity.setId(idGenerator.getNextId()); historicFormPropertyEntity.setEventType(HistoryEventTypes.FORM_PROPERTY_UPDATE.getEventName()); historicFormPropertyEntity.setTimestamp(ClockUtil.getCurrentTime()); historicFormPropertyEntity.setActivityInstanceId(execution.getActivityInstanceId()); historicFormPropertyEntity.setExecutionId(execution.getId()); historicFormPropertyEntity.setProcessDefinitionId(execution.getProcessDefinitionId()); historicFormPropertyEntity.setProcessInstanceId(execution.getProcessInstanceId()); historicFormPropertyEntity.setPropertyId(propertyId); historicFormPropertyEntity.setPropertyValue(propertyValue); historicFormPropertyEntity.setTaskId(taskId); historicFormPropertyEntity.setTenantId(execution.getTenantId()); historicFormPropertyEntity.setUserOperationId(Context.getCommandContext().getOperationId()); historicFormPropertyEntity.setRootProcessInstanceId(execution.getRootProcessInstanceId()); if (isHistoryRemovalTimeStrategyStart()) { provideRemovalTime(historicFormPropertyEntity); } ProcessDefinitionEntity definition = execution.getProcessDefinition(); if (definition != null) { historicFormPropertyEntity.setProcessDefinitionKey(definition.getKey()); } // initialize sequence counter initSequenceCounter(execution, historicFormPropertyEntity); return historicFormPropertyEntity; }
protected HistoricExternalTaskLogEntity initHistoricExternalTaskLog(ExternalTaskEntity entity, ExternalTaskState state) { HistoricExternalTaskLogEntity event = new HistoricExternalTaskLogEntity(); event.setTimestamp(ClockUtil.getCurrentTime()); event.setExternalTaskId(entity.getId()); event.setTopicName(entity.getTopicName()); event.setWorkerId(entity.getWorkerId()); event.setPriority(entity.getPriority()); event.setRetries(entity.getRetries()); event.setActivityId(entity.getActivityId()); event.setActivityInstanceId(entity.getActivityInstanceId()); event.setExecutionId(entity.getExecutionId()); event.setProcessInstanceId(entity.getProcessInstanceId()); event.setProcessDefinitionId(entity.getProcessDefinitionId()); event.setProcessDefinitionKey(entity.getProcessDefinitionKey()); event.setTenantId(entity.getTenantId()); event.setState(state.getStateCode()); ExecutionEntity execution = entity.getExecution(); if (execution != null) { event.setRootProcessInstanceId(execution.getRootProcessInstanceId()); if (isHistoryRemovalTimeStrategyStart()) { provideRemovalTime(event); } } return event; }