diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-07-15 16:44:55 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-09-16 12:39:07 +0200 |
| commit | d1b306fc340224f476385a67f0c7501c22bad9d3 (patch) | |
| tree | e93420346cd894dee3c061019f375e5852085642 | |
| parent | 2890f3e948fd88183371ff19cd5e265a3daaf6e7 (diff) | |
More
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/stateMachine/State.java | 13 | ||||
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java | 20 |
2 files changed, 19 insertions, 14 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/State.java b/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/State.java index d67b129..315ea3f 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/State.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/State.java @@ -8,8 +8,9 @@ public class State implements Serializable { int code;
String name;
- boolean proceeds;
- ArrayList<String> possibleTransitionNames;
+ boolean proceeds; // If true, this state deactivates the current activity and the lifecycle proceeds
+
+ ArrayList<Integer> possibleTransitionIds;
ArrayList<Transition> possibleTransitions;
public State() {
@@ -24,15 +25,15 @@ public class State implements Serializable { this.name = name;
}
- public void setPossibleTransitionNames(ArrayList<String> newNames) {
- possibleTransitionNames = newNames;
+ public void setPossibleTransitionNames(ArrayList<Integer> newIds) {
+ possibleTransitionIds = newIds;
possibleTransitions.clear();
}
- protected boolean resolveTransitions(HashMap<String, Transition> transitions) {
+ protected boolean resolveTransitions(HashMap<Integer, Transition> transitions) {
possibleTransitions.clear();
boolean allFound = true;
- for (String name : possibleTransitionNames) {
+ for (Integer name : possibleTransitionIds) {
if (transitions.keySet().contains(name))
possibleTransitions.add(transitions.get(name));
else {
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java b/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java index cd851d7..57f5818 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java @@ -15,17 +15,21 @@ public class Transition implements Serializable { State originState;
State terminalState;
- String enabledProp = null;
+ String enabledProp; // Boolean property that permits this transition e.g. 'Skippable'
- boolean activating;
- boolean deactivating;
+ // activation properties
+ boolean requiresActive; // Whether the activity must be active for this transition to be available
+ boolean changesState; // If true, then performing this transition will change the state of the activity
+ boolean newActiveState; // New activity state when changed
- boolean outcome;
- boolean outcomeRequired;
+ // schema properties
+ String outcomeSchemaName, outcomeSchemaVersion; // Name & version of the schema of the data required for this transition
+ String schemaNameProperty, schemaVersionProperty; // Activity property that gives the schema name & version
+ boolean outcomeRequired; // If true, then the data must be supplied to perform the transition, otherwise it is optional
- String outcomeSchema;
- String schemaNameProperty;
- String schemaVersionProperty;
+ // script properties
+ String scriptName, scriptVersion; // Name & version of the script to be run by the agent during this transition
+ String scriptNameProperty, scriptVersionProperty; // Activity properties dictating the above.
public Transition() {
}
|
