Class BpmnProcessFeature

java.lang.Object
jadex.bpmn.runtime.impl.BpmnProcessFeature
All Implemented Interfaces:
IBpmnComponentFeature, IInternalBpmnComponentFeature

public class BpmnProcessFeature extends Object implements IInternalBpmnComponentFeature, IBpmnComponentFeature
  • Field Details

    • DEFAULT_ACTIVITY_HANDLERS

      public static final Map<String,IActivityHandler> DEFAULT_ACTIVITY_HANDLERS
      The activity execution handlers (activity type -> handler).
    • DEFAULT_STEP_HANDLERS

      public static final Map<String,IStepHandler> DEFAULT_STEP_HANDLERS
      The step execution handlers (activity type -> handler).
    • rulesystem

      protected jadex.rules.eca.RuleSystem rulesystem
      The rule system.
    • activityhandlers

      protected Map<String,IActivityHandler> activityhandlers
      The activity handlers.
    • stephandlers

      protected Map<String,IStepHandler> stephandlers
      The step handlers.
    • topthread

      protected ProcessThread topthread
      The top level process thread.
    • messages

      protected List<Object> messages
      The messages waitqueue.
    • idcnt

      protected int idcnt
      The thread id counter.
    • self

      protected BpmnProcess self
  • Constructor Details

    • BpmnProcessFeature

      public BpmnProcessFeature(BpmnProcess self)
      Factory method constructor for instance level.
  • Method Details

    • getComponent

      public BpmnProcess getComponent()
    • getModel

      public MBpmnModel getModel()
    • construct

      protected void construct(Map<String,IActivityHandler> activityhandlers, Map<String,IStepHandler> stephandlers)
      Init method holds constructor code for both implementations.
    • init

      public void init()
      Specified by:
      init in interface IInternalBpmnComponentFeature
    • terminate

      public void terminate()
      Specified by:
      terminate in interface IInternalBpmnComponentFeature
    • hasContextVariable

      public boolean hasContextVariable(String name)
      Test if the given context variable is declared.
      Specified by:
      hasContextVariable in interface IInternalBpmnComponentFeature
      Parameters:
      name - The variable name.
      Returns:
      True, if the variable is declared.
    • getContextVariable

      public Object getContextVariable(String name)
      Get the value of the given context variable.
      Specified by:
      getContextVariable in interface IInternalBpmnComponentFeature
      Parameters:
      name - The variable name.
      Returns:
      The variable value.
    • setContextVariable

      public void setContextVariable(String name, Object value)
      Set the value of the given context variable.
      Specified by:
      setContextVariable in interface IInternalBpmnComponentFeature
      Parameters:
      name - The variable name.
      value - The variable value.
    • setContextVariable

      public void setContextVariable(String name, Object key, Object value)
      Set the value of the given context variable.
      Specified by:
      setContextVariable in interface IInternalBpmnComponentFeature
      Parameters:
      name - The variable name.
      value - The variable value.
    • createProcessThreadInfo

      public ProcessThreadInfo createProcessThreadInfo(ProcessThread thread)
      Create a new process thread info for logging / debug tools.
    • getActivityHandler

      public IActivityHandler getActivityHandler(MActivity activity)
      Get the activity handler for an activity.
      Specified by:
      getActivityHandler in interface IInternalBpmnComponentFeature
      Parameters:
      actvity - The activity.
      Returns:
      The activity handler.
    • getActivityHandler

      public IActivityHandler getActivityHandler(String type)
      Get the activity handler for an activity.
      Specified by:
      getActivityHandler in interface IInternalBpmnComponentFeature
      Parameters:
      type - The activity type.
      Returns:
      The activity handler.
    • getTopLevelThread

      public ProcessThread getTopLevelThread()
      Get the top level thread (is not executed and just acts as top level thread container).
      Specified by:
      getTopLevelThread in interface IInternalBpmnComponentFeature
    • step

      public void step(MActivity activity, jadex.core.IComponent instance, ProcessThread thread, Object event)
      Make a process step, i.e. find the next edge or activity for a just executed thread.
      Specified by:
      step in interface IInternalBpmnComponentFeature
      Parameters:
      activity - The activity to execute.
      instance - The process instance.
      thread - The process thread.
    • notify

      public void notify(MActivity activity, ProcessThread thread, Object event)
      Method that should be called, when an activity is finished and the following activity should be scheduled. Can safely be called from external threads.
      Specified by:
      notify in interface IInternalBpmnComponentFeature
      Parameters:
      activity - The timing event activity.
      thread - The process thread.
      event - The event that has occurred, if any.
      instance - The process instance.
    • isCurrentActivity

      protected boolean isCurrentActivity(MActivity activity, ProcessThread thread)
      Test if the notification is relevant for the current thread. The normal test is if thread.getActivity().equals(activity). This method must handle the additional cases that the current activity of the thread is a multiple event activity or when the activity is a subprocess with an attached timer event. In this case the notification could be for one of the child/attached events.
    • isReady

      public boolean isReady()
      Check if the process is ready, i.e. if at least one process thread can currently execute a step.
      Specified by:
      isReady in interface IInternalBpmnComponentFeature
      Parameters:
      pool - The pool to be executed or null for any.
      lane - The lane to be executed or null for any. Nested lanes may be addressed by dot-notation, e.g. 'OuterLane.InnerLane'.
    • isReady

      public boolean isReady(String pool, String lane)
      Check if the process is ready, i.e. if at least one process thread can currently execute a step.
      Specified by:
      isReady in interface IInternalBpmnComponentFeature
      Parameters:
      pool - The pool to be executed or null for any.
      lane - The lane to be executed or null for any. Nested lanes may be addressed by dot-notation, e.g. 'OuterLane.InnerLane'.
    • isFinished

      public boolean isFinished()
      Check, if the process has terminated.
      Specified by:
      isFinished in interface IInternalBpmnComponentFeature
      Parameters:
      pool - The pool to be executed or null for any.
      lane - The lane to be executed or null for any. Nested lanes may be addressed by dot-notation, e.g. 'OuterLane.InnerLane'.
      Returns:
      True, when the process instance is finished with regards to the specified pool/lane. When both pool and lane are null, true is returned only when all pools/lanes are finished.
    • isFinished

      public boolean isFinished(String pool, String lane)
      Check, if the process has terminated.
      Specified by:
      isFinished in interface IInternalBpmnComponentFeature
      Parameters:
      pool - The pool to be executed or null for any.
      lane - The lane to be executed or null for any. Nested lanes may be addressed by dot-notation, e.g. 'OuterLane.InnerLane'.
      Returns:
      True, when the process instance is finished with regards to the specified pool/lane. When both pool and lane are null, true is returned only when all pools/lanes are finished.
    • getMessages

      public List<Object> getMessages()
      Get the messages.
      Specified by:
      getMessages in interface IInternalBpmnComponentFeature
      Returns:
      The messages