public void suspend(String userId, boolean assignTask) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Suspending task : " + taskUUID + " on activity " + activityId); } final Recorder recorder = EnvTool.getRecorder(); if (assignTask) { this.userId = userId; recorder.recordTaskAssigned(this, userId, candidates, userId); } this.stateBeforeSuspend = this.state; this.state = TaskState.SUSPENDED; recorder.recordTaskSuspended(this, userId); HookExecutor.executeHooks(activityDef.getJavaHooks(), xpdlExecution, activityId, JavaHook.Type.taskOnSuspend); }
public void resume(String resumeUserId, boolean taskAssign) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Resuming task : " + taskUUID + " on activity " + activityId); } final Recorder recorder = EnvTool.getRecorder(); if (taskAssign) { this.userId = resumeUserId; recorder.recordTaskAssigned(this, resumeUserId, candidates, resumeUserId); } this.state = this.stateBeforeSuspend; recorder.recordTaskResumed(this, resumeUserId); HookExecutor.executeHooks(activityDef.getJavaHooks(), xpdlExecution, activityId, JavaHook.Type.taskOnResume); }
public void start(String userId, boolean assignTask) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Task : " + taskUUID + " on activity " + activityId + " is ready"); } final Recorder recorder = EnvTool.getRecorder(); if (assignTask) { this.userId = userId; recorder.recordTaskAssigned(this, userId, candidates, userId); } this.state = TaskState.EXECUTING; recorder.recordTaskStarted(this, userId); recorder.recordBodyStarted(activityDef, xpdlExecution); HookExecutor.executeHooks(activityDef.getJavaHooks(), xpdlExecution, activityId, JavaHook.Type.taskOnStart); }
public void finish(String userId, boolean assignTask) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Finishing task : " + taskUUID + " on activity " + activityId); } final Recorder recorder = EnvTool.getRecorder(); if (assignTask) { this.userId = userId; recorder.recordTaskAssigned(this, userId, candidates, userId); } this.state = TaskState.FINISHED; recorder.recordTaskFinished(this, EnvTool.getUserId()); HookExecutor.executeHooks(activityDef.getJavaHooks(), xpdlExecution, activityId, JavaHook.Type.taskOnFinish); activityDef.signal(xpdlExecution, AbstractActivity.BODY_FINISHED, null); this.xpdlExecution = null; }
public void ready() { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Ready task : " + taskUUID + " on activity " + activityId); } this.state = TaskState.READY; // get performer (aka participant/swimlane) Performer performer = activityDef.getPerformer(); Set<String> ar = new HashSet<String>(); //if human set userId and candidates if (performer.getParticipantType().equals(ParticipantType.HUMAN)) { this.userId = performer.getParticipantId(); ar.add(performer.getParticipantId()); this.candidates = ar; } //Only ROLE and ORGANIZATIONAL_UNIT can have Role mapper (ParticipantBinding) if (performer.getRoleMapper() != null) { mapRole(performer); } else { // no role mapper: set an empty candidates list this.candidates = ar; } // performer assignment associated to this task assign(performer); EnvTool.getRecorder().recordTaskReady(this); HookExecutor.executeHooks(activityDef.getJavaHooks(), xpdlExecution, activityId, JavaHook.Type.taskOnReady); }
); EngineEnvTool.getHookExecutor().executeHooks(this.activityDef.getJavaHooks(), this.xpdlExecution, this.activityId, JavaHook.Type.taskOnReady);
public void resume(final String resumeUserId, final boolean taskAssign) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Resuming task : " + this.taskUUID + " on activity " + this.activityId); } final Recorder recorder = EngineEnvTool.getRecorder(); if (taskAssign) { this.userId = resumeUserId; recorder.recordTaskAssigned(new TaskCurrentInfo( this.getUUID(), this.getUserId(), this.getCandidates(), this.getDueDate(), EngineEnvTool.getUserId(), this.getState() ) ); } this.state = this.stateBeforeSuspend; recorder.recordTaskResumed( new TaskCurrentInfo( this.getUUID(), this.getUserId(), this.getCandidates(), this.getDueDate(), EngineEnvTool.getUserId(), this.getState()) ); EngineEnvTool.getHookExecutor().executeHooks(this.activityDef.getJavaHooks(), this.xpdlExecution, this.activityId, JavaHook.Type.taskOnResume); }
this.getState()) ); EngineEnvTool.getHookExecutor().executeHooks(this.activityDef.getJavaHooks(), this.xpdlExecution, this.activityId, JavaHook.Type.taskOnSuspend);
this.getState()) ); EngineEnvTool.getHookExecutor().executeHooks(this.activityDef.getJavaHooks(), this.xpdlExecution, this.activityId, JavaHook.Type.taskOnFinish); this.activityDef.signal(this.xpdlExecution, AbstractActivity.BODY_FINISHED, null);
); EngineEnvTool.getHookExecutor().executeHooks(this.activityDef.getJavaHooks(), this.xpdlExecution, this.activityId, JavaHook.Type.taskOnStart);