use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class GetStartFormCmd method execute.
public StartFormData execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
ensureNotNull("No process definition found for id '" + processDefinitionId + "'", "processDefinition", processDefinition);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadProcessDefinition(processDefinition);
}
StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
ensureNotNull("No startFormHandler defined in process '" + processDefinitionId + "'", "startFormHandler", startFormHandler);
return startFormHandler.createStartFormData(processDefinition);
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class DefaultHistoryEventProducer method initActivityInstanceEvent.
protected void initActivityInstanceEvent(HistoricActivityInstanceEventEntity evt, ExecutionEntity execution, PvmScope eventSource, String activityInstanceId, String parentActivityInstanceId, HistoryEventType eventType) {
evt.setId(activityInstanceId);
evt.setEventType(eventType.getEventName());
evt.setActivityInstanceId(activityInstanceId);
evt.setParentActivityInstanceId(parentActivityInstanceId);
evt.setProcessDefinitionId(execution.getProcessDefinitionId());
evt.setProcessInstanceId(execution.getProcessInstanceId());
evt.setExecutionId(execution.getId());
evt.setTenantId(execution.getTenantId());
ProcessDefinitionEntity definition = execution.getProcessDefinition();
if (definition != null) {
evt.setProcessDefinitionKey(definition.getKey());
}
evt.setActivityId(eventSource.getId());
evt.setActivityName((String) eventSource.getProperty("name"));
evt.setActivityType((String) eventSource.getProperty("type"));
// update sub process reference
ExecutionEntity subProcessInstance = execution.getSubProcessInstance();
if (subProcessInstance != null) {
evt.setCalledProcessInstanceId(subProcessInstance.getId());
}
// update sub case reference
CaseExecutionEntity subCaseInstance = execution.getSubCaseInstance();
if (subCaseInstance != null) {
evt.setCalledCaseInstanceId(subCaseInstance.getId());
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class DefaultHistoryEventProducer method initHistoricIncidentEvent.
protected void initHistoricIncidentEvent(HistoricIncidentEventEntity evt, Incident incident, HistoryEventType eventType) {
// init properties
evt.setId(incident.getId());
evt.setProcessDefinitionId(incident.getProcessDefinitionId());
evt.setProcessInstanceId(incident.getProcessInstanceId());
evt.setExecutionId(incident.getExecutionId());
evt.setCreateTime(incident.getIncidentTimestamp());
evt.setIncidentType(incident.getIncidentType());
evt.setActivityId(incident.getActivityId());
evt.setCauseIncidentId(incident.getCauseIncidentId());
evt.setRootCauseIncidentId(incident.getRootCauseIncidentId());
evt.setConfiguration(incident.getConfiguration());
evt.setIncidentMessage(incident.getIncidentMessage());
evt.setTenantId(incident.getTenantId());
evt.setJobDefinitionId(incident.getJobDefinitionId());
IncidentEntity incidentEntity = (IncidentEntity) incident;
ProcessDefinitionEntity definition = incidentEntity.getProcessDefinition();
if (definition != null) {
evt.setProcessDefinitionKey(definition.getKey());
}
// init event type
evt.setEventType(eventType.getEventName());
// init state
IncidentState incidentState = IncidentState.DEFAULT;
if (HistoryEventTypes.INCIDENT_DELETE.equals(eventType)) {
incidentState = IncidentState.DELETED;
} else if (HistoryEventTypes.INCIDENT_RESOLVE.equals(eventType)) {
incidentState = IncidentState.RESOLVED;
}
evt.setIncidentState(incidentState.getStateCode());
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class DefaultHistoryEventProducer method initProcessInstanceEvent.
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);
if (execution.getSuperCaseExecution() != null) {
evt.setSuperCaseInstanceId(execution.getSuperCaseExecution().getCaseInstanceId());
}
if (execution.getSuperExecution() != null) {
evt.setSuperProcessInstanceId(execution.getSuperExecution().getProcessInstanceId());
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class DefaultHistoryEventProducer method initTaskInstanceEvent.
protected void initTaskInstanceEvent(HistoricTaskInstanceEventEntity evt, TaskEntity taskEntity, HistoryEventType eventType) {
String processDefinitionKey = null;
ProcessDefinitionEntity definition = taskEntity.getProcessDefinition();
if (definition != null) {
processDefinitionKey = definition.getKey();
}
String processDefinitionId = taskEntity.getProcessDefinitionId();
String processInstanceId = taskEntity.getProcessInstanceId();
String executionId = taskEntity.getExecutionId();
String caseDefinitionKey = null;
CaseDefinitionEntity caseDefinition = taskEntity.getCaseDefinition();
if (caseDefinition != null) {
caseDefinitionKey = caseDefinition.getKey();
}
String caseDefinitionId = taskEntity.getCaseDefinitionId();
String caseExecutionId = taskEntity.getCaseExecutionId();
String caseInstanceId = taskEntity.getCaseInstanceId();
String tenantId = taskEntity.getTenantId();
evt.setId(taskEntity.getId());
evt.setEventType(eventType.getEventName());
evt.setTaskId(taskEntity.getId());
evt.setProcessDefinitionKey(processDefinitionKey);
evt.setProcessDefinitionId(processDefinitionId);
evt.setProcessInstanceId(processInstanceId);
evt.setExecutionId(executionId);
evt.setCaseDefinitionKey(caseDefinitionKey);
evt.setCaseDefinitionId(caseDefinitionId);
evt.setCaseExecutionId(caseExecutionId);
evt.setCaseInstanceId(caseInstanceId);
evt.setAssignee(taskEntity.getAssignee());
evt.setDescription(taskEntity.getDescription());
evt.setDueDate(taskEntity.getDueDate());
evt.setFollowUpDate(taskEntity.getFollowUpDate());
evt.setName(taskEntity.getName());
evt.setOwner(taskEntity.getOwner());
evt.setParentTaskId(taskEntity.getParentTaskId());
evt.setPriority(taskEntity.getPriority());
evt.setTaskDefinitionKey(taskEntity.getTaskDefinitionKey());
evt.setTenantId(tenantId);
ExecutionEntity execution = taskEntity.getExecution();
if (execution != null) {
evt.setActivityInstanceId(execution.getActivityInstanceId());
}
}
Aggregations