public void create(ExecutionContext executionContext) { if (create != null) { throw new IllegalStateException(this + " was already created"); } create = Clock.getCurrentTime(); // if this task instance is associated with a task... if (task != null && executionContext != null) { // fire task create event // WARNING: The events create and assign are fired in the right order, // yet the logs are still not ordered properly executionContext.setTaskInstance(this); executionContext.setTask(task); task.fireEvent(Event.EVENTTYPE_TASK_CREATE, executionContext); } }
/** * creates an instance of the given task, for the given token. */ public TaskInstance createTaskInstance(Task task, Token token) { ExecutionContext executionContext = new ExecutionContext(token); executionContext.setTask(task); return createTaskInstance(task, executionContext); }
public void create(ExecutionContext executionContext) { if (create != null) { throw new IllegalStateException(this + " was already created"); } create = Clock.getCurrentTime(); // if this task instance is associated with a task... if (task != null && executionContext != null) { // fire task create event // WARNING: The events create and assign are fired in the right order, // yet the logs are still not ordered properly executionContext.setTaskInstance(this); executionContext.setTask(task); task.fireEvent(Event.EVENTTYPE_TASK_CREATE, executionContext); } }
/** * creates an instance of the given task, for the given token. */ public TaskInstance createTaskInstance(Task task, Token token) { ExecutionContext executionContext = new ExecutionContext(token); executionContext.setTask(task); return createTaskInstance(task, executionContext); }
/** * can optionally be used to indicate that the actor is starting to work on this task * instance. */ public void start() { if (start != null) { throw new IllegalStateException(this + " is already started"); } start = Clock.getCurrentTime(); // fire task start event if (token != null && task != null) { ExecutionContext executionContext = new ExecutionContext(token); executionContext.setTask(task); executionContext.setTaskInstance(this); task.fireEvent(Event.EVENTTYPE_TASK_START, executionContext); } }
public void execute(ExecutionContext executionContext) { TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance(); // if this tasknode should create instances if (createTasks && tasks != null) { for (Iterator iter = tasks.iterator(); iter.hasNext();) { Task task = (Task) iter.next(); executionContext.setTask(task); if (evaluateTaskCondition(task.getCondition(), executionContext)) { tmi.createTaskInstance(task, executionContext); } } } // check if we should continue execution boolean continueExecution; switch (signal) { case SIGNAL_UNSYNCHRONIZED: continueExecution = true; break; case SIGNAL_FIRST: case SIGNAL_LAST: continueExecution = tmi.getSignallingTasks(executionContext).isEmpty(); break; default: continueExecution = false; } if (continueExecution) leave(executionContext); }
/** * can optionally be used to indicate that the actor is starting to work on this task * instance. */ public void start() { if (start != null) { throw new IllegalStateException(this + " is already started"); } start = Clock.getCurrentTime(); // fire task start event if (token != null && task != null) { ExecutionContext executionContext = new ExecutionContext(token); executionContext.setTask(task); executionContext.setTaskInstance(this); task.fireEvent(Event.EVENTTYPE_TASK_START, executionContext); } }
public void execute(ExecutionContext executionContext) { TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance(); // if this tasknode should create instances if (createTasks && tasks != null) { for (Iterator iter = tasks.iterator(); iter.hasNext();) { Task task = (Task) iter.next(); executionContext.setTask(task); if (evaluateTaskCondition(task.getCondition(), executionContext)) { tmi.createTaskInstance(task, executionContext); } } } // check if we should continue execution boolean continueExecution; switch (signal) { case SIGNAL_UNSYNCHRONIZED: continueExecution = true; break; case SIGNAL_FIRST: case SIGNAL_LAST: continueExecution = tmi.getSignallingTasks(executionContext).isEmpty(); break; default: continueExecution = false; } if (continueExecution) leave(executionContext); }
/** * (re)assign this task to the given actor. * * @param actorId is reference to the person that is assigned to this task. * @param overwriteSwimlane specifies if the related swimlane should be overwritten with the * given swimlaneActorId. */ public void setActorId(String actorId, boolean overwriteSwimlane) { // do the actual assignment this.previousActorId = this.actorId; this.actorId = actorId; if (swimlaneInstance != null && overwriteSwimlane) { if (log.isDebugEnabled()) log.debug("assigning " + this + " to '" + actorId + '\''); swimlaneInstance.setActorId(actorId); } if (token != null) { // log this assignment token.addLog(new TaskAssignLog(this, previousActorId, actorId)); if (task != null) { // fire task assign event // WARNING: The events create and assign are fired in the right order, // but the logs are still not ordered properly ExecutionContext executionContext = new ExecutionContext(token); executionContext.setTask(task); executionContext.setTaskInstance(this); task.fireEvent(Event.EVENTTYPE_TASK_ASSIGN, executionContext); } } }
/** * (re)assign this task to the given actor. * * @param actorId is reference to the person that is assigned to this task. * @param overwriteSwimlane specifies if the related swimlane should be overwritten with the * given swimlaneActorId. */ public void setActorId(String actorId, boolean overwriteSwimlane) { // do the actual assignment this.previousActorId = this.actorId; this.actorId = actorId; if (swimlaneInstance != null && overwriteSwimlane) { if (log.isDebugEnabled()) log.debug("assigning " + this + " to '" + actorId + '\''); swimlaneInstance.setActorId(actorId); } if (token != null) { // log this assignment token.addLog(new TaskAssignLog(this, previousActorId, actorId)); if (task != null) { // fire task assign event // WARNING: The events create and assign are fired in the right order, // but the logs are still not ordered properly ExecutionContext executionContext = new ExecutionContext(token); executionContext.setTask(task); executionContext.setTaskInstance(this); task.fireEvent(Event.EVENTTYPE_TASK_ASSIGN, executionContext); } } }
executionContext.setTask(task); executionContext.setTaskInstance(this); task.fireEvent(Event.EVENTTYPE_TASK_END, executionContext);
executionContext.setTask(task); executionContext.setTaskInstance(this); task.fireEvent(Event.EVENTTYPE_TASK_END, executionContext);