Class MActivity

Direct Known Subclasses:
MSubProcess, MTask

public class MActivity extends MAssociationTarget
Base class for all kinds of activities.
  • Field Details

    • MI_NOTFOUND

      protected static final jadex.common.MethodInfo MI_NOTFOUND
    • RETURNPARAM

      public static final String RETURNPARAM
      Constant for the return parameter name.
      See Also:
    • IFACE

      public static final String IFACE
      The interface name.
      See Also:
    • METHOD

      public static final String METHOD
      The method name.
      See Also:
    • ISSERVICE

      public static final String ISSERVICE
      Is service constant.
      See Also:
    • ISSEQUENTIAL

      public static final String ISSEQUENTIAL
      Constant for the sequential result execution mode .
      See Also:
    • RESULTNAME

      public static final String RESULTNAME
      Constant for the result param name.
      See Also:
    • RESULTTYPE

      public static final String RESULTTYPE
      Constant for the result param type (needed for distinguishing collection results from single values).
      See Also:
    • lanedescription

      protected String lanedescription
      The lane description.
    • outgoingsequenceedgesdescription

      protected String outgoingsequenceedgesdescription
      The outgoing sequence edges description.
    • incomingsequenceedgesdescription

      protected String incomingsequenceedgesdescription
      The incoming sequence edges description.
    • incomingmessagesdescriptions

      protected List<Object> incomingmessagesdescriptions
      The incoming messages description.
    • outgoingmessagesdescriptions

      protected List<Object> outgoingmessagesdescriptions
      The outgoing messages description.
    • outseqedges

      protected List<MSequenceEdge> outseqedges
      The outgoing sequence edges.
    • inseqedges

      protected List<MSequenceEdge> inseqedges
      The incoming sequence edges.
    • outmsgedges

      protected List<MMessagingEdge> outmsgedges
      The outgoing message edges.
    • inmsgedges

      protected List<MMessagingEdge> inmsgedges
      The incoming message edges.
    • outdataedges

      protected List<MDataEdge> outdataedges
      The outgoing data edges.
    • indataedges

      protected List<MDataEdge> indataedges
      The incoming data edges.
    • type

      protected String type
      The type.
    • activitytype

      protected String activitytype
      The activity type.
    • looping

      protected boolean looping
      The looping flag.
    • throwing

      protected boolean throwing
      The throwing flag.
    • eventhandlers

      protected List<MActivity> eventhandlers
      The event handlers.
    • pool

      protected MPool pool
      The pool.
    • lane

      protected MLane lane
      The lane (if any).
    • eventhandler

      protected boolean eventhandler
      The flag if this activity is an event handler.
    • parameters

      protected jadex.collection.IndexMap<String,MParameter> parameters
      The parameters (name -> MParameter).
    • properties

      protected jadex.collection.IndexMap<String,MProperty> properties
      The properties (name -> MProperty).
    • clazz

      protected jadex.common.ClassInfo clazz
      The class.
    • bodymethod

      protected volatile jadex.common.MethodInfo bodymethod
      The body method cached for speed.
    • cancelmethod

      protected volatile jadex.common.MethodInfo cancelmethod
      The body method cached for speed.
    • componentinjections

      protected volatile List<jadex.common.FieldInfo> componentinjections
      The component injection targets.
    • argumentinjections

      protected volatile Map<String,List<jadex.common.FieldInfo>> argumentinjections
      The argument injection targets.
    • resultinjections

      protected volatile Map<String,jadex.common.FieldInfo> resultinjections
      The result injection targets.
  • Constructor Details

    • MActivity

      public MActivity()
  • Method Details

    • getLaneDescription

      public String getLaneDescription()
      Get the xml lane description.
      Returns:
      The lane description.
    • setLaneDescription

      public void setLaneDescription(String lanedescription)
      Set the xml lane description.
      Parameters:
      lanedescription - The lane description to set.
    • getOutgoingSequenceEdgesDescription

      public String getOutgoingSequenceEdgesDescription()
      Get the xml outgoing sequence edges desription.
      Returns:
      The outgoing sequence edges description.
    • setOutgoingSequenceEdgesDescription

      public void setOutgoingSequenceEdgesDescription(String outgoingedges)
      Set the xml outgoing edges desription.
      Parameters:
      outgoingedges - The outgoing edges to set.
    • getIncomingSequenceEdgesDescription

      public String getIncomingSequenceEdgesDescription()
      Get the xml incoming edges description.
      Returns:
      The incoming edges description.
    • setIncomingSequenceEdgesDescription

      public void setIncomingSequenceEdgesDescription(String incomingedges)
      Set the xml incoming edges description.
      Parameters:
      incomingedges - The incoming edges to set.
    • getOutgoingMessagesDescriptions

      public List<Object> getOutgoingMessagesDescriptions()
      Get the xml outgoing messages descriptions.
      Returns:
      The outgoing messages descriptions.
    • addOutgoingMessageDescription

      public void addOutgoingMessageDescription(Object desc)
      Add an outgoing message description.
      Parameters:
      desc - The description.
    • removeOutgoingMessageDescription

      public void removeOutgoingMessageDescription(Object desc)
      Remove an outgoing message description.
      Parameters:
      desc - The description.
    • getIncomingMessagesDescriptions

      public List<Object> getIncomingMessagesDescriptions()
      Get the incoming messages description.
      Returns:
      The incoming messages descriptions.
    • addIncomingMessageDescription

      public void addIncomingMessageDescription(Object desc)
      Add an incoming message description.
      Parameters:
      desc - The description.
    • removeIncomingMessageDescription

      public void removeIncomingMessageDescription(Object desc)
      Remove an incoming message description.
      Parameters:
      desc - The description.
    • getOutgoingSequenceEdges

      public List<MSequenceEdge> getOutgoingSequenceEdges()
      Get the outgoing sequence edges.
      Returns:
      The outgoing edges.
    • setOutgoingSequenceEdges

      public void setOutgoingSequenceEdges(List<MSequenceEdge> outseqedges)
      Set the outgoing sequence edges.
      Parameters:
      outseqedges - The outgoing sequence edges.
    • addOutgoingSequenceEdge

      public void addOutgoingSequenceEdge(MSequenceEdge edge)
      Add an outgoing edge.
      Parameters:
      edge - The edge.
    • removeOutgoingSequenceEdge

      public void removeOutgoingSequenceEdge(MSequenceEdge edge)
      Remove an outgoing edge.
      Parameters:
      edge - The edge.
    • getIncomingSequenceEdges

      public List<MSequenceEdge> getIncomingSequenceEdges()
      Get the incoming edges.
      Returns:
      The incoming edges.
    • getIncomingSequenceEdges

      public void getIncomingSequenceEdges(List<MSequenceEdge> inseqedges)
      Set the incoming edges.
      Parameters:
      inseqedges - The incoming edges.
    • addIncomingSequenceEdge

      public void addIncomingSequenceEdge(MSequenceEdge edge)
      Add an incoming edge.
      Parameters:
      edge - The edge.
    • removeIncomingSequenceEdge

      public void removeIncomingSequenceEdge(MSequenceEdge edge)
      Remove an incoming edge.
      Parameters:
      edge - The edge.
    • getOutgoingMessagingEdges

      public List<MMessagingEdge> getOutgoingMessagingEdges()
      Get the outgoing message edges.
      Returns:
      The outgoing message edges.
    • getOutgoingMessagingEdges

      public void getOutgoingMessagingEdges(List<MMessagingEdge> outmsgedges)
      Set the outgoing message edges.
      Parameters:
      outmsgedges - The outgoing message edges.
    • addOutgoingMessagingEdge

      public void addOutgoingMessagingEdge(MMessagingEdge edge)
      Add an outgoing message edge.
      Parameters:
      edge - The edge.
    • removeOutgoingMessagingEdge

      public void removeOutgoingMessagingEdge(MMessagingEdge edge)
      Remove an outgoing message edge.
      Parameters:
      edge - The edge.
    • getIncomingMessagingEdges

      public List<MMessagingEdge> getIncomingMessagingEdges()
      Get the incoming message edges.
      Returns:
      the incoming message edges.
    • setIncomingMessagingEdges

      public void setIncomingMessagingEdges(List<MMessagingEdge> inmsgedges)
      Set the incoming message edges.
      Parameters:
      inmsgedges - The incoming message edges.
    • addIncomingMessagingEdge

      public void addIncomingMessagingEdge(MMessagingEdge edge)
      Add an incoming message edge.
      Parameters:
      edge - The edge.
    • removeIncomingMessagingEdge

      public void removeIncomingMessagingEdge(MMessagingEdge edge)
      Remove an incoming message edge.
      Parameters:
      edge - The edge.
    • addOutgoingDataEdge

      public void addOutgoingDataEdge(MDataEdge edge)
      Add an outgoing edge.
      Parameters:
      edge - The edge.
    • removeOutgoingDataEdge

      public void removeOutgoingDataEdge(MDataEdge edge)
      Remove an outgoing edge.
      Parameters:
      edge - The edge.
    • addIncomingDataEdge

      public void addIncomingDataEdge(MDataEdge edge)
      Add an incoming edge.
      Parameters:
      edge - The edge.
    • removeIncomingDataEdge

      public void removeIncomingDataEdge(MDataEdge edge)
      Remove an outgoing edge.
      Parameters:
      edge - The edge.
    • getIncomingDataEdges

      public List<MDataEdge> getIncomingDataEdges()
      Get the incoming data edges.
      Returns:
      the incoming data edges.
    • setIncomingDataEdges

      public void setIncomingDataEdges(List<MDataEdge> indataedges)
      Set the incoming data edges.
      Parameters:
      indataedges - The incoming data edges.
    • getOutgoingDataEdges

      public List<MDataEdge> getOutgoingDataEdges()
      Get the outgoing data edges.
      Returns:
      the outgoing data edges.
    • setOutgoingDataEdges

      public void setOutgoingDataEdges(List<MDataEdge> outdataedges)
      Set the outgoing data edges.
      Parameters:
      outdataedges - The outgoing data edges.
    • getType

      public String getType()
      Get the type.
      Returns:
      The type.
    • setType

      public void setType(String type)
      Set the type.
      Parameters:
      type - The type to set.
    • getActivityType

      public String getActivityType()
      Get the activity type.
      Returns:
      The activity type.
    • setActivityType

      public void setActivityType(String activitytype)
      Set the activity type.
      Parameters:
      activitytype - The activity type to set.
    • isLooping

      public boolean isLooping()
      Test if the activity is looping.
      Returns:
      True, if looping.
    • setLooping

      public void setLooping(boolean looping)
      Set the looping state.
      Parameters:
      looping - The looping state to set.
    • isThrowing

      public boolean isThrowing()
      Test if the activity is throwing.
      Returns:
      True, if throwing.
    • setThrowing

      public void setThrowing(boolean throwing)
      Set the throwing state.
      Parameters:
      throwing - The throwing state to set.
    • getEventHandlers

      public List<MActivity> getEventHandlers()
      Get the event handlers.
      Returns:
      The event handlers.
    • addEventHandler

      public void addEventHandler(MActivity eventhandler)
      Add an event handler.
      Parameters:
      eventhandler - The event handler.
    • removeEventHandler

      public void removeEventHandler(MActivity eventhandler)
      Remove an event handler.
      Parameters:
      eventhandler - The event handler.
    • getParameters

      public jadex.collection.IndexMap<String,MParameter> getParameters()
      Get the parameters.
      Returns:
      The parameters.
    • getParameter

      public MParameter getParameter(String name)
      Get a parameter by name.
    • getAllParameters

      public jadex.collection.IndexMap<String,MParameter> getAllParameters(Map<String,Object> params, String[] imports, ClassLoader cl)
      Get the parameters.
      Returns:
      The parameters.
    • getParameters

      public List<MParameter> getParameters(String[] dirs)
      Get parameters of specific direction(s).
      Returns:
      The in parameters.
    • setParameters

      public void setParameters(jadex.collection.IndexMap<String,MParameter> parameters)
      Sets the parameters.
      Parameters:
      parameters - The parameters.
    • hasParameter

      public boolean hasParameter(String name)
      Test if a prop exists.
    • addParameter

      public void addParameter(MParameter param)
      Add a parameter.
      Parameters:
      param - The parameter.
    • removeParameter

      public void removeParameter(MParameter param)
      Remove a parameter.
      Parameters:
      param - The parameter.
    • removeParameter

      public void removeParameter(String name)
      Remove a parameter.
      Parameters:
      param - The parameter.
    • removeParameters

      public void removeParameters()
      Remove a parameter.
      Parameters:
      param - The parameter.
    • setPropertyValue

      public void setPropertyValue(String name, jadex.common.UnparsedExpression exp)
      Legacy conversion from unparsed expression.
      Parameters:
      name - Name
      exp -
    • setPropertyValue

      public void setPropertyValue(String name, jadex.javaparser.IParsedExpression exp)
      Legacy conversion to unparsed expression.
      Parameters:
      name - Name
      exp -
    • getPropertyValueString

      public String getPropertyValueString(String name)
      Get a property value string from the model.
      Parameters:
      name - The name.
    • getPropertyValue

      public jadex.common.UnparsedExpression getPropertyValue(String name)
      Get a property value from the model.
      Parameters:
      name - The name.
    • getParsedPropertyValue

      public Object getParsedPropertyValue(String name)
      Get a property value from the model.
      Parameters:
      name - The name.
    • getPropertyNames

      public String[] getPropertyNames()
      Returns the property names.
      Returns:
      The property names.
    • hasPropertyValue

      public boolean hasPropertyValue(String name)
      Test, if a property is declared and has nonull unparsed expression.
      Parameters:
      name - The property name.
      Returns:
      True, if the property is declared.
    • hasInitialPropertyValue

      public boolean hasInitialPropertyValue(String name)
      Test, if a property is declared and has nonull unparsed expression.
      Parameters:
      name - The property name.
      Returns:
      True, if the property is declared.
    • getProperties

      public jadex.collection.IndexMap<String,MProperty> getProperties()
      Get the properties.
      Returns:
      The properties.
    • setProperties

      public void setProperties(jadex.collection.IndexMap<String,MProperty> properties)
      Set the properties.
      Parameters:
      properties -
    • hasProperty

      public boolean hasProperty(String name)
      Test if a property exists.
    • addProperty

      public void addProperty(MProperty prop)
      Add a property.
      Parameters:
      prop - The property.
    • addProperty

      public void addProperty(String name, String value)
      Add a simple string-based property.
      Parameters:
      name - Property name.
      value - The string value.
    • addProperty

      public void addProperty(String name, String value, boolean string)
      Add a simple string-based property.
      Parameters:
      name - Property name.
      value - The string value.
    • removeProperty

      public void removeProperty(String propname)
      Remove a property.
      Parameters:
      propname - Name of the property.
    • removeProperty

      public void removeProperty(MProperty prop)
      Remove a property.
      Parameters:
      prop - The property.
    • setProperty

      public void setProperty(String name, String value, boolean string)
      Set a property value: a) val==null -> remove property b) val!=null invalid input: '&'invalid input: '&' !hasProp(name) -> addProp(name, val) c) val!=null invalid input: '&'invalid input: '&' hasProp(name) -> setInitialVal(val)
    • setParameter

      public void setParameter(String name, String value, Class<?> type, boolean string, String direction)
      Set a parameter value: a) val==null -> remove property b) val!=null invalid input: '&'invalid input: '&' !hasProp(name) -> addProp(name, val) c) val!=null invalid input: '&'invalid input: '&' hasProp(name) -> setInitialVal(val)
    • toString

      public String toString()
      Create a string representation of this activity.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this activity.
    • getPool

      public MPool getPool()
      Get the pool of the activity.
      Returns:
      The pool of the activity.
    • setPool

      public void setPool(MPool pool)
      Set the pool of the activity.
      Parameters:
      pool - The pool of the activity.
    • getLane

      public MLane getLane()
      Get the lane of the activity.
      Returns:
      The lane of the activity.
    • setLane

      public void setLane(MLane lane)
      Set the lane of the activity.
      Parameters:
      lane - The lane of the activity.
    • isEventHandler

      public boolean isEventHandler()
      Get the eventhandler.
      Returns:
      The eventhandler.
    • setEventHandler

      public void setEventHandler(boolean eventhandler)
      Set the eventhandler.
      Parameters:
      eventhandler - The eventhandler to set.
    • getClazz

      public jadex.common.ClassInfo getClazz()
      Get the class.
      Returns:
      The class.
    • setClazz

      public void setClazz(jadex.common.ClassInfo clazz)
      Set the class.
      Parameters:
      clazz - The class to set.
    • isEvent

      public boolean isEvent()
      Test if activity is event.
      Returns:
      True, if is event.
    • isStartEvent

      public boolean isStartEvent()
      Test if activity is a start event.
      Returns:
      True, if is event.
    • isEndEvent

      public boolean isEndEvent()
      Test if activity is a end event.
      Returns:
      True, if is event.
    • isIntermediateEvent

      public boolean isIntermediateEvent()
      Test if activity is an intermediate event.
      Returns:
      True, if is event.
    • isMessageEvent

      public boolean isMessageEvent()
      Test if activity is event.
      Returns:
      True, if is event.
    • isSignalEvent

      public boolean isSignalEvent()
      Test if activity is event.
      Returns:
      True, if is event.
    • isGateway

      public boolean isGateway()
      Test if activity is gateway.
      Returns:
      True, if is gateway.
    • getBodyMethod

      public jadex.common.MethodInfo getBodyMethod(ClassLoader cl)
      Get and save the body method info.
    • getCancelMethod

      public jadex.common.MethodInfo getCancelMethod(ClassLoader cl)
      Get and save the cancel method info.
    • getComponentInjections

      public List<jadex.common.FieldInfo> getComponentInjections(ClassLoader cl)
      Get and save the body method info.
    • getArgumentInjections

      public Map<String,List<jadex.common.FieldInfo>> getArgumentInjections(ClassLoader cl)
      Get and save the body method info.
    • getResultInjections

      public Map<String,jadex.common.FieldInfo> getResultInjections(ClassLoader cl)
      Get and save the body method info.
    • getMethod

      public static jadex.common.MethodInfo getMethod(Class<?> body, Class<? extends Annotation> type)
      Get method with an annotation.
    • getFields

      public static List<jadex.common.FieldInfo> getFields(Class<?> body, Class<? extends Annotation> type)
      Get method with an annotation.