summaryrefslogtreecommitdiff
path: root/src/main/resources/boot/SC/SetWorkflow.xml
diff options
context:
space:
mode:
authorabranson <abranson@PCUWE01.cern.ch>2012-07-06 15:53:04 +0200
committerabranson <abranson@PCUWE01.cern.ch>2012-07-06 15:53:04 +0200
commit0774a45d92569b7d7f05c82c9e036821b1c3aadf (patch)
treebea236f34ce5326df9ff5434c13c48e82d2a1625 /src/main/resources/boot/SC/SetWorkflow.xml
parentecfbae52eca918912f31199519f260c1657acd43 (diff)
Require workflow version for item descriptions
Switch to Gateway.getMarshaller() from CastorXMLUtility Replace module.xml with marshalled form
Diffstat (limited to 'src/main/resources/boot/SC/SetWorkflow.xml')
-rw-r--r--src/main/resources/boot/SC/SetWorkflow.xml15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/resources/boot/SC/SetWorkflow.xml b/src/main/resources/boot/SC/SetWorkflow.xml
index 88a061f..1b4fdd2 100644
--- a/src/main/resources/boot/SC/SetWorkflow.xml
+++ b/src/main/resources/boot/SC/SetWorkflow.xml
@@ -5,7 +5,8 @@
importClass(Packages.com.c2kernel.lookup.DomainPath);
// Fetch the requested name from the outcome field
- var wfDefName = job.getOutcome().getField("WorkflowDefinitionName");
+ var wfDefName = job.getOutcome().getField("WorkflowDefinitionName");
+ var wfDefVersion = job.getOutcome().getField("WorkflowDefinitionVersion");
// Look up the description
var root = new DomainPath("/desc/ActivityDesc");
var wfItem;
@@ -22,7 +23,14 @@
if (!itemType.equals("ActivityDesc"))
throw wfDefName+" is not an activity description";
if (!complex.equals("Composite"))
- throw wfDefName+" is not a composite activity description";
+ throw wfDefName+" is not a composite activity description";
+
+ // Check that the named version exists
+ try {
+ var view = wfItem.getObject("/ViewPoint/CompositeActivityDef/"+wfDefVersion);
+ } catch (e) {
+ throw wfDefName + " does not contain a version "+wfDefVersion;
+ }
// Fetch the 'Workflow' collection
var coll = item.getObject("/Collection/Workflow");
@@ -31,7 +39,8 @@
coll.removeMember(member.getID());
}
// add the new member
- coll.addMember(wfItem.getSystemKey());
+ var cm = coll.addMember(wfItem.getSystemKey());
+ cm.getProperties().put("Version", wfDefVersion);
// save it back to the item
var params = new Array(1);
params[0] = agent.marshall(coll);