diff options
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/Workflow.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/Workflow.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java b/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java index e3a6b7f..fa5e66b 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java @@ -24,6 +24,8 @@ import com.c2kernel.utils.Logger; public class Workflow extends CompositeActivity implements C2KLocalObject
{
public History history;
+ private Integer itemSysKey = null;
+
/** TypeNameAndConstructionInfo[] variables added by Steve */
private final TypeNameAndConstructionInfo[] mVertexTypeNameAndConstructionInfo =
{
@@ -54,11 +56,11 @@ public class Workflow extends CompositeActivity implements C2KLocalObject addChild(act, new GraphPoint(300, 100));
}
- public History getHistory() {
+ public History getHistory() throws InvalidDataException {
if (history == null) {
- Integer i = (Integer) (getProperties().get("ItemSystemKey"));
- if (i != null)
- history = new History(i, this);
+ if (itemSysKey == null)
+ throw new InvalidDataException("Workflow not initialized.", "");
+ history = new History(itemSysKey, this);
}
return history;
}
@@ -173,6 +175,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject */
public void initialise(int systemKey, AgentPath agent) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException
{
+ itemSysKey = systemKey;
try
{
runFirst(agent, systemKey);
@@ -186,6 +189,14 @@ public class Workflow extends CompositeActivity implements C2KLocalObject }
}
+ public Integer getItemSysKey() {
+ return itemSysKey;
+ }
+
+ public void setItemSysKey(Integer itemSysKey) {
+ this.itemSysKey = itemSysKey;
+ }
+
/**
* if type = 0 only domain steps will be queried if type = 1 only predefined steps will be queried else both will be queried
* @param agent
|
