From d1b306fc340224f476385a67f0c7501c22bad9d3 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Mon, 15 Jul 2013 16:44:55 +0200 Subject: More --- .../lifecycle/instance/stateMachine/State.java | 13 +++++++------ .../lifecycle/instance/stateMachine/Transition.java | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance') 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 possibleTransitionNames; + boolean proceeds; // If true, this state deactivates the current activity and the lifecycle proceeds + + ArrayList possibleTransitionIds; ArrayList possibleTransitions; public State() { @@ -24,15 +25,15 @@ public class State implements Serializable { this.name = name; } - public void setPossibleTransitionNames(ArrayList newNames) { - possibleTransitionNames = newNames; + public void setPossibleTransitionNames(ArrayList newIds) { + possibleTransitionIds = newIds; possibleTransitions.clear(); } - protected boolean resolveTransitions(HashMap transitions) { + protected boolean resolveTransitions(HashMap 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() { } -- cgit v1.2.3