diff options
| author | abranson <abranson@PCUWE01.cern.ch> | 2012-07-06 15:53:04 +0200 |
|---|---|---|
| committer | abranson <abranson@PCUWE01.cern.ch> | 2012-07-06 15:53:04 +0200 |
| commit | 0774a45d92569b7d7f05c82c9e036821b1c3aadf (patch) | |
| tree | bea236f34ce5326df9ff5434c13c48e82d2a1625 /src/main/resources/boot | |
| parent | ecfbae52eca918912f31199519f260c1657acd43 (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')
| -rw-r--r-- | src/main/resources/boot/OD/ChooseWorkflow.xsd | 5 | ||||
| -rw-r--r-- | src/main/resources/boot/SC/LocalObjectDefCreator.xml | 4 | ||||
| -rw-r--r-- | src/main/resources/boot/SC/SetWorkflow.xml | 15 |
3 files changed, 19 insertions, 5 deletions
diff --git a/src/main/resources/boot/OD/ChooseWorkflow.xsd b/src/main/resources/boot/OD/ChooseWorkflow.xsd index 9927231..1fb6238 100644 --- a/src/main/resources/boot/OD/ChooseWorkflow.xsd +++ b/src/main/resources/boot/OD/ChooseWorkflow.xsd @@ -7,6 +7,11 @@ <xs:annotation> <xs:documentation>Give the name of the composite activity description that you would like new instance of this description to run.</xs:documentation> </xs:annotation> + </xs:element>
+ <xs:element name="WorkflowDefinitionVersion" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Give the version of this activity that you would like to use.</xs:documentation>
+ </xs:annotation>
</xs:element> </xs:sequence> </xs:complexType> diff --git a/src/main/resources/boot/SC/LocalObjectDefCreator.xml b/src/main/resources/boot/SC/LocalObjectDefCreator.xml index 177b635..d6a6762 100644 --- a/src/main/resources/boot/SC/LocalObjectDefCreator.xml +++ b/src/main/resources/boot/SC/LocalObjectDefCreator.xml @@ -2,7 +2,7 @@ <cristalscript>
<output name="errors" type="com.c2kernel.scripting.ErrorInfo"/>
<script language="javascript" name="LocalObjectDefCreator"><![CDATA[
- importClass(Packages.com.c2kernel.utils.CastorXMLUtility);
+ importClass(Packages.com.c2kernel.process.Gateway);
importClass(Packages.com.c2kernel.utils.Resource);
importClass(Packages.com.c2kernel.process.Bootstrap);
importClass(Packages.com.c2kernel.lifecycle.CompositeActivityDef);
@@ -33,7 +33,7 @@ if (type.equals("EA") || type.equals("CA")) {
var newAct = type.equals("CA")?new CompositeActivityDef(): new ActivityDef();
newAct.setName(name);
- newObj = CastorXMLUtility.marshall(newAct);
+ newObj = Gateway.getMarshaller().marshall(newAct);
}
else {
// Empty schemas and scripts are stored as outcomes of the factory.
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); |
