Interface Instance
-
- All Superinterfaces:
LocalisedString
,PluginDataContainer
,Serializable
,UserAttributeContainer
- All Known Subinterfaces:
ChangeableInstance
,ExecutableInstance
public interface Instance extends UserAttributeContainer, PluginDataContainer, Serializable, LocalisedString
The Instance interface is used to represent process instances. It holds instance-specific information of a process, but no structural data or element data. It keeps a reference to a Template (or InstanceDeltaLayer in case of a modified Instance), for all non-instance-specific data.
All string values returned by Instance or one of the objects belonging to the instance may returnnull
instead of ''. If you set a field to '' the next time it is loadednull
may be returned. This is due to the lack of Oracle to distinguish between '' and null.
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
Generated ID for serialisation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UUID
getBaseTemplateID()
Gets the ID of the template, this instance is based on.long
getCreationTime()
Gets the date (as long) this instance has been created.ProcessConstants.EdgeState
getEdgeState(int srcNodeID, int destNodeID, ProcessConstants.EdgeType edgeType)
Returns the state of the edge.ProcessConstants.ExecutionMode
getExecutionMode(int nodeID)
Returns the execution mode of the designated node, that is production mode, component test mode or substituted test mode (the component is not called at all but substituted).UUID
getID()
Returns the (logical) ID of the instance, which is system-wide unique.QualifiedAgent
getInitiatorAgent()
Returns the qualified agent who initiated the instance.UUID
getLogID()
Returns the (internal) ID of the instance, which is for internal and log use only.String
getName()
Returns the name of the instance.int
getNodeIteration(int nodeID)
If the node is inside of a loop block, this function returns the number of the current iteration.List<UUID>
getNodeLWPInstanceID(int nodeID)
Returns (a list of) the IDs of the referenced instance of the current iteration, if this light weight process represents one or more (in case of variable parallelism) instances.List<UUID>
getNodeLWPInstanceID(int nodeId, int iteration)
Returns (a list of) the IDs of the referenced instance of the designated iteration, if this light weight process represents one or more (in case of variable parallelism) instances.ProcessConstants.NodeState
getNodeState(int nodeID)
Returns the state of the node with the given ID.EBPInstanceReference
getParentEBPReference()
Returns the reference to the super-instance, if this instance is a sub-process.QualifiedAgent
getPerformingAgent(int nodeID)
Returns the qualified agent who is executing or has executed the activity,null
if no agent has been assigned yet due to the current node state.QualifiedAgent
getSupervisorAgent()
Returns the supervisor agent of the instance.Template
getTemplate()
Returns a reference to the template, which keeps the structural and element data (i.e. all non-instance-specific data).boolean
isModified()
Returns true if the instance has been modified.boolean
isStructurallyModified()
Returns true if the instance has been modified structurally.-
Methods inherited from interface de.aristaflow.adept2.model.common.i18n.LocalisedString
toLocalisedString
-
Methods inherited from interface de.aristaflow.adept2.model.common.PluginDataContainer
getPluginData, getPluginDatas, getSupportedPlugins
-
Methods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
Generated ID for serialisation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
UUID getID()
Returns the (logical) ID of the instance, which is system-wide unique. This ID is likely to change when the instance itself is changed.- Returns:
- The (logical) instance ID.
-
getLogID
UUID getLogID()
Returns the (internal) ID of the instance, which is for internal and log use only. In contrast tothe logical ID
this ID will always stay the same, even in the case of instance-specific changes.- Returns:
- The (internal) instance ID for usage in logs and internally.
-
getName
String getName()
Returns the name of the instance.- Returns:
- The name of the instance.
-
isModified
boolean isModified()
Returns true if the instance has been modified. This is not restricted to structural changes, therefore the instance will also be modified if e.g. the name changes.- Returns:
- true if the instance has been modified.
-
isStructurallyModified
boolean isStructurallyModified()
Returns true if the instance has been modified structurally. This is restricted to structural changes, therefore the instance will not be structurally modified if e.g. the name only changes.- Returns:
- true if the instance has been modified structurally.
-
getBaseTemplateID
UUID getBaseTemplateID()
Gets the ID of the template, this instance is based on. In case of an unmodified instance this equalsTemplate.getID()
from {link #getTemplate()}. In case of a modified template, this ID refers to the old (unchanged) template whilegetTemplate()
is the modified template.- Returns:
- The ID of the template this instance is based on. In case of a
modified instance this differs from the ID of the changed
template
.
-
getTemplate
Template getTemplate()
Returns a reference to the template, which keeps the structural and element data (i.e. all non-instance-specific data). If this instance is a subprocess this template will return the corresponding subprocess template even if this is an embedded subprocess. UsegetParentEBPReference()
to retrieve the parent template.
If the instance has been modified, this function will return an InstanceDeltaLayer, else it will return a Template.- Returns:
- The structural and element data of the instance, either a Template or an InstanceDeltaLayer.
-
getSupervisorAgent
QualifiedAgent getSupervisorAgent()
Returns the supervisor agent of the instance.- Returns:
- The supervisor agent of the instance.
-
getInitiatorAgent
QualifiedAgent getInitiatorAgent()
Returns the qualified agent who initiated the instance.- Returns:
- The initiating agent.
-
getCreationTime
long getCreationTime()
Gets the date (as long) this instance has been created.- Returns:
- The date (as long) this instance has been created.
-
getParentEBPReference
EBPInstanceReference getParentEBPReference()
Returns the reference to the super-instance, if this instance is a sub-process.- Returns:
- A reference to the super instance, in case this is a sub-process.
-
getNodeState
ProcessConstants.NodeState getNodeState(int nodeID)
Returns the state of the node with the given ID. Throws IllegalArgumentException if the node with the nodeIDnodeID
does not exist.- Parameters:
nodeID
- The ID of the node.- Returns:
- The state of the node as byte.
- Throws:
IllegalArgumentException
- if nodeID does not exist.
-
getExecutionMode
ProcessConstants.ExecutionMode getExecutionMode(int nodeID)
Returns the execution mode of the designated node, that is production mode, component test mode or substituted test mode (the component is not called at all but substituted). If the node has not been started yet, null is returned.- Parameters:
nodeID
- The ID of the node of which to retrieve the execution mode.- Returns:
- Null, in case the node has not been started yet or the execution mode in which the node is or has been started.
-
getNodeIteration
int getNodeIteration(int nodeID)
If the node is inside of a loop block, this function returns the number of the current iteration. Throws IllegalArgumentException if the node with the nodeIDnodeID
does not exist.- Parameters:
nodeID
- The ID of the node.- Returns:
- The current iteration count.
- Throws:
IllegalArgumentException
- if nodeID does not exist.
-
getNodeLWPInstanceID
List<UUID> getNodeLWPInstanceID(int nodeID)
Returns (a list of) the IDs of the referenced instance of the current iteration, if this light weight process represents one or more (in case of variable parallelism) instances. Throws IllegalArgumentException if the node with the nodeIDnodeID
does not exist. If the instance has not been started yet, the returned set will be empty.
The position of the instance ID corresponds to the index for reading elements from input parameter lists as well as for writing values to output parameter lists. TODO RuntimeException, if no LWP? if the instance has not been started yet? cf. Node#getParameterName(int)- Parameters:
nodeID
- The ID of the node, which has a LWP as executable business process.- Returns:
- A list of instance IDs for the designated node, if it represents one or more subprocess instances.
- Throws:
IllegalArgumentException
- if nodeID does not exist.
-
getNodeLWPInstanceID
List<UUID> getNodeLWPInstanceID(int nodeId, int iteration)
Returns (a list of) the IDs of the referenced instance of the designated iteration, if this light weight process represents one or more (in case of variable parallelism) instances. Throws IllegalArgumentException if the node with the ID does not exist. If the instance has not been started yet or the iteration has not been reached, the returned set will be empty.
The position of the instance ID corresponds to the index for reading elements from input parameter lists as well as for writing values to output parameter lists.- Parameters:
nodeId
- The ID of the node, which has a LWP as executable business process.iteration
- The iteration of the node for which to get the LWP(s).- Returns:
- A list of instance IDs for the designated node and the designated iteration, if the node represents one or more subprocess instances.
- Throws:
IllegalArgumentException
- if nodeID does not exist.
-
getEdgeState
ProcessConstants.EdgeState getEdgeState(int srcNodeID, int destNodeID, ProcessConstants.EdgeType edgeType)
Returns the state of the edge. The edge is specified by the IDs of its start and end node and its edge type. The value of the state is calculated on the fly and not stored. Throws IllegalArgumentException if the edge could not be found and therefore the state could not be calculated.- Parameters:
srcNodeID
- The ID of the start node.destNodeID
- The ID of the end node.edgeType
- The type of the edge.- Returns:
- The edge-state.
- Throws:
IllegalArgumentException
- if no edge could be found.
-
getPerformingAgent
QualifiedAgent getPerformingAgent(int nodeID)
Returns the qualified agent who is executing or has executed the activity,null
if no agent has been assigned yet due to the current node state. Throws IllegalArgumentException if the node with the nodeIDnodeID
does not exist.- Parameters:
nodeID
- The ID of the node of the activity.- Returns:
- The executing agent or null in case it is not known yet due to the node state.
- Throws:
IllegalArgumentException
- if the node does not exist.
-
-