net.kwfgrid.gwes
Class TransitionOccurrence

java.lang.Object
  extended by net.kwfgrid.gwes.TransitionOccurrence

public class TransitionOccurrence
extends Object

Version:
$Id: TransitionOccurrence.java 1490 2011-02-18 13:20:36Z hoheisel $
Author:
Andreas Hoheisel (www.andreas-hoheisel.de)

Nested Class Summary
static class TransitionOccurrence.DefaultNamespaceContext
           
 
Field Summary
 boolean hasXPathEdgeExpressions
           
 boolean simulation
           
 TokenParameterList tokens
           
 net.kwfgrid.gworkflowdl.structure.Transition transition
           
 
Constructor Summary
TransitionOccurrence(net.kwfgrid.gworkflowdl.structure.Transition transition)
          Constructor that uses next unlocked tokens on input/read/write places to build transition occurrence.
 
Method Summary
 int checkConditions(ConditionChecker checker)
          Check conditions of this transition occurrence.
 void evaluateXPathEdgeExpressions()
          ToDo: execute only if necessary! As side effect, this methods adds namespaces declared by transition properties to nsContext.
 void generateResourceAllocationGroupPropertyFromActivity()
          Generate the resource.allocation.group token property from activity resource.
 Activity getActivity()
           
 org.jdom.Document getContext()
           
 String getID()
           
 String getIDwithOutputs()
           
 org.jaxen.SimpleNamespaceContext getNamespaceContext()
           
 String getNsUri(String nsPrefix)
           
 DoubleDistribution getProbabilityDistribution()
           
 net.kwfgrid.gworkflowdl.structure.GenericProperties getProps()
           
 ArrayList<TokenParameter> getTokens()
           
 void lockTokens()
          Locks the input and - if available - the output tokens.
 void movePropertyToInputTokens(String propertyName)
          Copy the property from the TransitionOccurrence to all input tokens and remove it from the TransitionOccurrence.
 void putOutputReservationTokens()
          Put and lock reservation dummy tokens to output places.
 void putOutputTokens()
          Puts output parameters to output places.
 void putProperty(String name, String value)
          Put a property to the list of properties.
 void removeInputTokens()
          Remove input tokens.
static void removeNamespacesWithoutPrefix(org.jdom.Element element)
          Remove namespaces if this element does not have any namespace prefix.
 void removeOutputReservationTokens()
          Remove reservation tokens from output places if there are any.
 void setActivity(Activity activity)
           
 String toString()
           
 void unlockTokens()
          Unlocks the input and - if available - the output tokens.
 String updateID()
          Updates and returns a ID that contains the ids of all available tokens.
 void updateWriteTokens()
          Update tokens on write places if necessary.
 void writeWriteTokens()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transition

public final net.kwfgrid.gworkflowdl.structure.Transition transition

tokens

public TokenParameterList tokens

hasXPathEdgeExpressions

public boolean hasXPathEdgeExpressions

simulation

public final boolean simulation
Constructor Detail

TransitionOccurrence

public TransitionOccurrence(net.kwfgrid.gworkflowdl.structure.Transition transition)
                     throws net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
Constructor that uses next unlocked tokens on input/read/write places to build transition occurrence.

Parameters:
transition -
Throws:
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
Method Detail

lockTokens

public void lockTokens()
Locks the input and - if available - the output tokens.


unlockTokens

public void unlockTokens()
Unlocks the input and - if available - the output tokens.


checkConditions

public int checkConditions(ConditionChecker checker)
                    throws net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
Check conditions of this transition occurrence. Variables (e.g. $input/) that are expanded by the corresponding context XPath (e.g. /gwdl:data/input).

Parameters:
to - Transition occurrence to check.
Returns:
ConditionChecker.CONDITION_TRUE if all conditions evaluate to true and ConditionChecker.CONDITION_FALSE_STATIC if a least one static condition evaluates to false. ConditionChecker.CONDITION_FALSE_DYNAMIC if condition is false just because of time-depend conditions that may change in future.
Throws:
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException - If the syntax of the condition is wrong.

removeInputTokens

public void removeInputTokens()
Remove input tokens.


putOutputReservationTokens

public void putOutputReservationTokens()
                                throws net.kwfgrid.gworkflowdl.structure.CapacityException
Put and lock reservation dummy tokens to output places. ///ToDo: use this method to avoid place capacity problems on output places. ///ToDo: Introduce special property to be able to display them as "ghost" tokens.

Throws:
net.kwfgrid.gworkflowdl.structure.CapacityException

removeOutputReservationTokens

public void removeOutputReservationTokens()
Remove reservation tokens from output places if there are any.


updateWriteTokens

public void updateWriteTokens()
                       throws net.kwfgrid.gworkflowdl.structure.CapacityException
Update tokens on write places if necessary. Currently only control tokens are updated. ///ToDo: support data write tokens. Fix sematic issues first.

Throws:
net.kwfgrid.gworkflowdl.structure.CapacityException

putOutputTokens

public void putOutputTokens()
                     throws net.kwfgrid.gworkflowdl.structure.CapacityException,
                            net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
Puts output parameters to output places. This method also copies the common properties to the token.

Throws:
net.kwfgrid.gworkflowdl.structure.CapacityException
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException

writeWriteTokens

public void writeWriteTokens()
                      throws net.kwfgrid.gworkflowdl.structure.CapacityException
Throws:
net.kwfgrid.gworkflowdl.structure.CapacityException

getID

public String getID()

getIDwithOutputs

public String getIDwithOutputs()

getContext

public org.jdom.Document getContext()

getNamespaceContext

public org.jaxen.SimpleNamespaceContext getNamespaceContext()

getNsUri

public String getNsUri(String nsPrefix)

getTokens

public ArrayList<TokenParameter> getTokens()

evaluateXPathEdgeExpressions

public void evaluateXPathEdgeExpressions()
                                  throws net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
ToDo: execute only if necessary! As side effect, this methods adds namespaces declared by transition properties to nsContext.

Parameters:
step -
Throws:
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException

putProperty

public void putProperty(String name,
                        String value)
Put a property to the list of properties. Overwrites old values with same name.

Parameters:
name -
value -

removeNamespacesWithoutPrefix

public static void removeNamespacesWithoutPrefix(org.jdom.Element element)
Remove namespaces if this element does not have any namespace prefix. This method also processes all descendands of the element.

Parameters:
element -

generateResourceAllocationGroupPropertyFromActivity

public void generateResourceAllocationGroupPropertyFromActivity()
Generate the resource.allocation.group token property from activity resource.


movePropertyToInputTokens

public void movePropertyToInputTokens(String propertyName)
Copy the property from the TransitionOccurrence to all input tokens and remove it from the TransitionOccurrence.

Parameters:
propertyName - The name of the property.

getProps

public net.kwfgrid.gworkflowdl.structure.GenericProperties getProps()

getActivity

public Activity getActivity()

setActivity

public void setActivity(Activity activity)

getProbabilityDistribution

public DoubleDistribution getProbabilityDistribution()

updateID

public String updateID()
Updates and returns a ID that contains the ids of all available tokens. Invoke after putOutputTokens() if you need the correct IDs of output tokens.

Returns:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2011 Fraunhofer FIRST. All Rights Reserved.