@Override public void signal(final ActivityExecution execution, final String signal, final Map<String, Object> signalParameters) { final XpdlExecution xpdlExecution = (XpdlExecution) execution; xpdlExecution.setSubflowXpdlInstance(null); if (SUBFLOW_SIGNAL.equals(signal)) { if (this.outParameters != null) { final Recorder recorder = EngineEnvTool.getRecorder(); final ProcessInstanceUUID instanceUUID = xpdlExecution.getXpdlInstance().getUUID(); for (final Map.Entry<String, String> parameter : this.outParameters.entrySet()) { final String variableId = parameter.getValue(); final Object variableValue = signalParameters.get(parameter.getKey()); execution.setVariable(variableId, variableValue); if (xpdlExecution.getXpdlInstance().getRootExecution().hasVariable(variableId)) { recorder.recordInstanceVariableUpdated(variableId, variableValue, instanceUUID, EngineEnvTool.getUserId()); } else { recorder.recordActivityVariableUpdated(variableId, variableValue, xpdlExecution.getCurrentActivityInstanceUUID(), EngineEnvTool.getUserId()); } } } super.signal(xpdlExecution, BODY_FINISHED, null); } else { super.signal(xpdlExecution, signal, signalParameters); } }
@Override public void signal(ActivityExecution execution, String signal, Map<String, Object> parameters) { final XpdlExecution xpdlExecution = (XpdlExecution) execution; final XpdlInstance xpdlInstance = xpdlExecution.getXpdlInstance(); xpdlInstance.setInstanceState(InstanceState.STARTED); final Recorder recorder = EnvTool.getRecorder(); recorder.recordInstanceStarted(xpdlInstance, EnvTool.getUserId()); recorder.recordEnterActivity(this, xpdlExecution); recorder.recordBodyStarted(this, xpdlExecution); recorder.recordBodyEnded(this, xpdlExecution); executeSplit(execution, false); }
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 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); }
recorder.recordBodyStarted(task); recorder.recordTaskStarted(taskUUID, EnvTool.getUserId()); final InternalActivityDefinition activityDef = internalExecution.getNode(); try { } catch (final RuntimeException e) { recorder.recordActivityFailed(task); if (ExtensionPointsPolicy.THROW_EXCPTION_ON_FAIL.equals(EnvTool.getExtensionPointsPolicy())) { throw new UnRollbackableException("Error while executing connector taskOnStart", e);
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 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; }
xpdlInstance.setInstanceState(InstanceState.FINISHED); final Recorder recorder = EnvTool.getRecorder(); recorder.recordBodyEnded(this, xpdlExecution); recorder.recordInstanceEnded(xpdlInstance, EnvTool.getUserId());
private boolean executeBody(XpdlExecution execution) { if (bodyStartAutomatically()) { EnvTool.getRecorder().recordBodyStarted(this, execution); } return executeBusinessLogic(execution); }
public void assign(java.util.Set<java.lang.String> candidates, String assignUserId) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("assigning task : " + taskUUID + " on activity " + activityId); } final Recorder recorder = EnvTool.getRecorder(); this.userId = assignUserId; this.candidates = candidates; recorder.recordTaskAssigned(this, EnvTool.getUserId(), candidates, assignUserId); }
public static void ready(final Execution internalExecution) throws TaskNotFoundException { final ActivityInstanceUUID taskUUID = new ActivityInstanceUUID(internalExecution.getActivityInstanceUUID() .toString()); final InternalActivityDefinition activityDef = internalExecution.getNode(); final TaskInstance task = getTask(taskUUID); final String activityName = task.getActivityName(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Ready task : " + taskUUID + " on activity " + activityName); } // get performer (aka participant/swimlane) final Set<Performer> performers = getPerformers(activityDef); String userId = null; Set<String> candidates = null; if (performers != null) { candidates = getCandidates(performers, task); final Performer performer = performers.iterator().next(); if (performer.getFilterDefinition() != null) { candidates = executeFilter(task, candidates, performer); if (candidates.size() == 1) { userId = candidates.iterator().next(); } } } if (userId != null) { EnvTool.getRecorder().recordTaskReady(taskUUID, null, userId); } else { EnvTool.getRecorder().recordTaskReady(taskUUID, candidates, null); } ConnectorExecutor.executeConnectors(activityDef, internalExecution, HookDefinition.Event.taskOnReady); }
assign(task, null, task.getTaskUser()); recorder.recordTaskFinished(taskUUID, EnvTool.getUserId()); } catch (final RuntimeException e) { recorder.recordActivityFailed(task); if (ExtensionPointsPolicy.THROW_EXCPTION_ON_FAIL.equals(EnvTool.getExtensionPointsPolicy())) { TransientData.removeTransientData(taskUUID);
VariableUtil.createTransientVariables(activity.getDataFields(), instanceUUID)); recorder.recordEnterActivity(activityInstance); LOG.log(Level.SEVERE, exception.getMessage(), exception); recorder.recordEnterActivity(activityInstance); recorder.recordActivityFailed(activityInstance); internalExecution.setActivityInstance(activityInstance); throw exception;
EnvTool.getRecorder().recordBodyEnded(internalExecution.getActivityInstance()); } catch (final RuntimeException e) { final InternalActivityInstance activityInstance = internalExecution.getActivityInstance(); EnvTool.getRecorder().recordActivityFailed(activityInstance); if (ExtensionPointsPolicy.THROW_EXCPTION_ON_FAIL.equals(EnvTool.getExtensionPointsPolicy())) { throw new UnRollbackableException("Error while executing connector taskOnFinish", e);
protected void executeActivityInstance(XpdlExecution xpdlExecution) { final Recorder recorder = EnvTool.getRecorder(); recorder.recordEnterActivity(this, xpdlExecution); boolean canContinue = executeBody(xpdlExecution); if (canContinue) { end(xpdlExecution); } else { xpdlExecution.waitForSignal(); } }
protected void end(XpdlExecution xpdlExecution) { EnvTool.getRecorder().recordBodyEnded(this, xpdlExecution); if (!XpdlExecution.MAIN_INSTANCE_NAME.equals(xpdlExecution.getActivityInstanceId())) { // TODO: check variable values for transition conditions XpdlExecution activityInstanceExecution = (XpdlExecution) xpdlExecution.destroyScope(xpdlExecution.getNode()); activityInstanceExecution.end(); XpdlExecution parent = activityInstanceExecution.getParent(); parent.removeExecution(activityInstanceExecution); signal(parent, ACT_INSTANCE_FINISHED, null); } else { executeSplit(xpdlExecution, true); } }
recorder.recordInstanceStarted(rootExecution.getInstance(), instanceInitiator);
EnvTool.getRecorder().recordInstanceVariableUpdated(targetVariable, newValue, instance.getUUID(), EnvTool.getUserId()); } else {
recorder.recordActivityVariableUpdated(targetVariable, newValue, activityUUID, EnvTool.getUserId());
ConnectorExecutor.executeConnectors(internalExecution, HookDefinition.Event.instanceOnFinish); final Recorder recorder = EnvTool.getRecorder(); recorder.recordInstanceEnded(instance.getUUID(), EnvTool.getUserId()); ProcessUtil.removeInternalInstanceEvents(instance.getUUID());