use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class TaskParseHandler method executeParse.
protected void executeParse(BpmnParse bpmnParse, Task task) {
ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, task, BpmnXMLConstants.ELEMENT_TASK);
activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTaskActivityBehavior(task));
activity.setAsync(task.isAsynchronous());
activity.setExclusive(!task.isNotExclusive());
}
use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class UserTaskParseHandler method executeParse.
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, userTask, BpmnXMLConstants.ELEMENT_TASK_USER);
activity.setAsync(userTask.isAsynchronous());
activity.setExclusive(!userTask.isNotExclusive());
TaskDefinition taskDefinition = parseTaskDefinition(bpmnParse, userTask, userTask.getId(), (ProcessDefinitionEntity) bpmnParse.getCurrentScope().getProcessDefinition());
activity.setProperty(PROPERTY_TASK_DEFINITION, taskDefinition);
activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createUserTaskActivityBehavior(userTask, taskDefinition));
}
use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class ErrorEventDefinitionParseHandler method createBoundaryErrorEventDefinition.
public void createBoundaryErrorEventDefinition(ErrorEventDefinition errorEventDefinition, boolean interrupting, ActivityImpl activity, ActivityImpl nestedErrorEventActivity) {
nestedErrorEventActivity.setProperty("type", "boundaryError");
ScopeImpl catchingScope = nestedErrorEventActivity.getParent();
((ActivityImpl) catchingScope).setScope(true);
org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(nestedErrorEventActivity.getId());
definition.setErrorCode(errorEventDefinition.getErrorCode());
addErrorEventDefinition(definition, catchingScope);
}
use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class TimerExecuteNestedActivityJobHandler method execute.
public void execute(JobEntity job, String configuration, ExecutionEntity execution, CommandContext commandContext) {
String nestedActivityId = TimerEventHandler.getActivityIdFromConfiguration(configuration);
ActivityImpl borderEventActivity = execution.getProcessDefinition().findActivity(nestedActivityId);
if (borderEventActivity == null) {
throw new ActivitiException("Error while firing timer: border event activity " + nestedActivityId + " not found");
}
try {
if (commandContext.getEventDispatcher().isEnabled()) {
commandContext.getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.TIMER_FIRED, job));
dispatchActivityTimeoutIfNeeded(job, execution, commandContext);
}
borderEventActivity.getActivityBehavior().execute(execution);
} catch (RuntimeException e) {
log.error("exception during timer execution", e);
throw e;
} catch (Exception e) {
log.error("exception during timer execution", e);
throw new ActivitiException("exception during timer execution: " + e.getMessage(), e);
}
}
use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class TimerExecuteNestedActivityJobHandler method dispatchExecutionTimeOut.
protected void dispatchExecutionTimeOut(JobEntity timerEntity, ExecutionEntity execution, CommandContext commandContext) {
// subprocesses
for (ExecutionEntity subExecution : execution.getExecutions()) {
dispatchExecutionTimeOut(timerEntity, subExecution, commandContext);
}
// call activities
ExecutionEntity subProcessInstance = commandContext.getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(execution.getId());
if (subProcessInstance != null) {
dispatchExecutionTimeOut(timerEntity, subProcessInstance, commandContext);
}
// activity with timer boundary event
ActivityImpl activity = execution.getActivity();
if (activity != null && activity.getActivityBehavior() != null) {
dispatchActivityTimeOut(timerEntity, activity, execution, commandContext);
}
}
Aggregations