use of org.activiti.engine.ActivitiObjectNotFoundException in project Activiti by Activiti.
the class DeleteIdentityLinkForProcessInstanceCmd method execute.
public Void execute(CommandContext commandContext) {
ExecutionEntity processInstance = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);
if (processInstance == null) {
throw new ActivitiObjectNotFoundException("Cannot find process instance with id " + processInstanceId, ExecutionEntity.class);
}
processInstance.deleteIdentityLink(userId, groupId, type);
commandContext.getHistoryManager().createProcessInstanceIdentityLinkComment(processInstanceId, userId, groupId, type, false);
return null;
}
use of org.activiti.engine.ActivitiObjectNotFoundException in project Activiti by Activiti.
the class DeploymentManager method findDeployedLatestProcessDefinitionByKeyAndTenantId.
public ProcessDefinitionEntity findDeployedLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) {
ProcessDefinitionEntity processDefinition = Context.getCommandContext().getProcessDefinitionEntityManager().findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);
if (processDefinition == null) {
throw new ActivitiObjectNotFoundException("no processes deployed with key '" + processDefinitionKey + "' for tenant identifier '" + tenantId + "'", ProcessDefinition.class);
}
processDefinition = resolveProcessDefinition(processDefinition);
return processDefinition;
}
use of org.activiti.engine.ActivitiObjectNotFoundException in project Activiti by Activiti.
the class DeploymentManager method findDeployedLatestProcessDefinitionByKey.
public ProcessDefinitionEntity findDeployedLatestProcessDefinitionByKey(String processDefinitionKey) {
ProcessDefinitionEntity processDefinition = Context.getCommandContext().getProcessDefinitionEntityManager().findLatestProcessDefinitionByKey(processDefinitionKey);
if (processDefinition == null) {
throw new ActivitiObjectNotFoundException("no processes deployed with key '" + processDefinitionKey + "'", ProcessDefinition.class);
}
processDefinition = resolveProcessDefinition(processDefinition);
return processDefinition;
}
use of org.activiti.engine.ActivitiObjectNotFoundException in project Activiti by Activiti.
the class GetTaskVariableCmd method execute.
public Object execute(CommandContext commandContext) {
if (taskId == null) {
throw new ActivitiIllegalArgumentException("taskId is null");
}
if (variableName == null) {
throw new ActivitiIllegalArgumentException("variableName is null");
}
TaskEntity task = commandContext.getTaskEntityManager().findTaskById(taskId);
if (task == null) {
throw new ActivitiObjectNotFoundException("task " + taskId + " doesn't exist", Task.class);
}
Object value;
if (isLocal) {
value = task.getVariableLocal(variableName, false);
} else {
value = task.getVariable(variableName, false);
}
return value;
}
use of org.activiti.engine.ActivitiObjectNotFoundException in project Activiti by Activiti.
the class HasExecutionVariableCmd method execute.
public Boolean execute(CommandContext commandContext) {
if (executionId == null) {
throw new ActivitiIllegalArgumentException("executionId is null");
}
if (variableName == null) {
throw new ActivitiIllegalArgumentException("variableName is null");
}
ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(executionId);
if (execution == null) {
throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class);
}
boolean hasVariable = false;
if (isLocal) {
hasVariable = execution.hasVariableLocal(variableName);
} else {
hasVariable = execution.hasVariable(variableName);
}
return hasVariable;
}
Aggregations