protected internal virtual TransitionInstanceImpl createTransitionInstance(PvmExecutionImpl execution) { TransitionInstanceImpl transitionInstance = new TransitionInstanceImpl(); // can use execution id as persistent ID for transition as an execution // can execute as most one transition at a time. transitionInstance.Id = execution.Id; transitionInstance.ParentActivityInstanceId = execution.ParentActivityInstanceId; transitionInstance.ProcessInstanceId = execution.ProcessInstanceId; transitionInstance.ProcessDefinitionId = execution.ProcessDefinitionId; transitionInstance.ExecutionId = execution.Id; transitionInstance.ActivityId = execution.ActivityId; ActivityImpl activity = execution.getActivity(); if (activity != null) { string name = activity.Name; if (string.ReferenceEquals(name, null)) { name = (string)activity.getProperty("name"); } transitionInstance.ActivityName = name; transitionInstance.ActivityType = (string)activity.getProperty("type"); } return(transitionInstance); }
public virtual void execute(PvmExecutionImpl execution) { execution.activityInstanceDone(); ActivityBehavior activityBehavior = getActivityBehavior(execution); if (activityBehavior is FlowNodeActivityBehavior) { FlowNodeActivityBehavior behavior = (FlowNodeActivityBehavior)activityBehavior; ActivityImpl activity = execution.getActivity(); string activityInstanceId = execution.ActivityInstanceId; if (!string.ReferenceEquals(activityInstanceId, null)) { LOG.debugLeavesActivityInstance(execution, activityInstanceId); } try { behavior.doLeave(execution); } catch (Exception e) { throw e; } catch (Exception e) { throw new PvmException("couldn't leave activity <" + activity.getProperty("type") + " id=\"" + activity.Id + "\" ...>: " + e.Message, e); } } else { throw new PvmException("Behavior of current activity is not an instance of " + typeof(FlowNodeActivityBehavior).Name + ". Execution " + execution); } }
public virtual void parseIntermediateCatchEvent(Element intermediateEventElement, ScopeImpl scope, ActivityImpl activity) { // do not write history for link events if (!activity.getProperty("type").Equals("intermediateLinkCatch")) { addActivityHandlers(activity); } }
public static bool isCompensationThrowing(PvmExecutionImpl execution) { ActivityImpl currentActivity = execution.getActivity(); if (currentActivity != null) { bool?isCompensationThrowing = (bool?)currentActivity.getProperty(BpmnParse.PROPERTYNAME_THROWS_COMPENSATION); if (isCompensationThrowing != null && isCompensationThrowing) { return(true); } } return(false); }
public Void callback(PvmExecutionImpl execution) { ActivityBehavior activityBehavior = getActivityBehavior(execution); ActivityImpl activity = execution.getActivity(); //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: LOG.debugExecutesActivity(execution, activity, activityBehavior.GetType().FullName); try { activityBehavior.execute(execution); } catch (Exception e) { throw e; } catch (Exception e) { throw new PvmException("couldn't execute activity <" + activity.getProperty("type") + " id=\"" + activity.Id + "\" ...>: " + e.Message, e); } return(null); }