summaryrefslogtreecommitdiff
path: root/resources/boot/SC/SetWorkflow.xml
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2012-06-04 15:37:34 +0200
committerAndrew Branson <andrew.branson@cern.ch>2012-06-04 15:37:34 +0200
commit388a76a73c8a8131c7af8df2ba03cf16511c8ea5 (patch)
tree473206237625785b7828dd73c7e7be8b184bfba0 /resources/boot/SC/SetWorkflow.xml
parenteac30db6329f05cc7cf2a35613497e357b4db3aa (diff)
Mavenized
Diffstat (limited to 'resources/boot/SC/SetWorkflow.xml')
-rw-r--r--resources/boot/SC/SetWorkflow.xml41
1 files changed, 0 insertions, 41 deletions
diff --git a/resources/boot/SC/SetWorkflow.xml b/resources/boot/SC/SetWorkflow.xml
deleted file mode 100644
index 88a061f..0000000
--- a/resources/boot/SC/SetWorkflow.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cristalscript>
- <output name="errors" type="com.c2kernel.scripting.ErrorInfo"/>
- <script language="javascript" name="SetWorkflow"><![CDATA[
- importClass(Packages.com.c2kernel.lookup.DomainPath);
-
- // Fetch the requested name from the outcome field
- var wfDefName = job.getOutcome().getField("WorkflowDefinitionName");
- // Look up the description
- var root = new DomainPath("/desc/ActivityDesc");
- var wfItem;
- try {
- var wfPath = root.find(wfDefName);
- wfItem = agent.getItem(wfPath);
- } catch (e) {
- throw wfDefName+" is not a valid item";
- }
-
- // Make sure it has the right properties to be a composite activity desc
- var itemType = wfItem.getProperty("Type");
- var complex = wfItem.getProperty("Complexity");
- if (!itemType.equals("ActivityDesc"))
- throw wfDefName+" is not an activity description";
- if (!complex.equals("Composite"))
- throw wfDefName+" is not a composite activity description";
-
- // Fetch the 'Workflow' collection
- var coll = item.getObject("/Collection/Workflow");
- if (coll.size() > 0) { // if there's already a member, remove it
- var member = coll.getMembers().list.get(0);
- coll.removeMember(member.getID());
- }
- // add the new member
- coll.addMember(wfItem.getSystemKey());
- // save it back to the item
- var params = new Array(1);
- params[0] = agent.marshall(coll);
- agent.execute(item, "AddC2KObject", params);
-
- ]]></script>
-</cristalscript>