diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-04-11 17:03:38 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-04-11 17:03:38 +0200 |
| commit | f09e07e3314bb9c0cb7a6da7055ecb01da3ed722 (patch) | |
| tree | 266f113b07f646008b119da959c54c8ee6efb0a8 /src/main/resources/boot/SC | |
| parent | 062c586ccef008d9e91424431e6f28effa8a1143 (diff) | |
OutcomeInitiator based description initialization. Absorbs all
description editing from the kernel. Module.debug functionality missing
- kernel now creates all imported module descriptions with NoWorkflow.
Need a way to patch them in later (must be part of this module)
Diffstat (limited to 'src/main/resources/boot/SC')
| -rw-r--r-- | src/main/resources/boot/SC/CreateNewNumberedVersionFromLast.xml | 31 | ||||
| -rw-r--r-- | src/main/resources/boot/SC/LocalObjectDefCreator.xml | 34 |
2 files changed, 39 insertions, 26 deletions
diff --git a/src/main/resources/boot/SC/CreateNewNumberedVersionFromLast.xml b/src/main/resources/boot/SC/CreateNewNumberedVersionFromLast.xml new file mode 100644 index 0000000..7a63b76 --- /dev/null +++ b/src/main/resources/boot/SC/CreateNewNumberedVersionFromLast.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<cristalscript>
+ <output name="errors" type="com.c2kernel.scripting.ErrorInfo"/>
+ <script language="javascript" name="CreateNewNumberedVersionFromLast"><![CDATA[
+
+ var viewName = job.getActPropString("ViewName");
+
+ if (viewName.equals(""))
+ throw "ViewName not specified. Cannot create new version.";
+
+ var lastView = -1;
+ var existingViews = item.getContents("/ViewPoint/"+viewName);
+ for (i=0; i<existingViews.length; i++) {
+ var thisView = parseInt(existingViews[i]);
+ if (thisView!=NaN && lastView < thisView) lastView = thisView;
+ }
+ lastView++;
+ try {
+ var existingLast = agent.unmarshall(item.queryData("/ViewPoint/"+viewName+"/last"));
+ } catch (e) {
+ throw "No data found. You must submit at least one version before executing this activity.";
+ }
+
+ var params = new Array(3);
+ params[0] = viewName;
+ params[1] = lastView;
+ params[2] = existingLast.getEventId();
+ agent.execute(item, "WriteViewpoint", params);
+
+ ]]></script>
+</cristalscript>
diff --git a/src/main/resources/boot/SC/LocalObjectDefCreator.xml b/src/main/resources/boot/SC/LocalObjectDefCreator.xml index de082dc..28eac12 100644 --- a/src/main/resources/boot/SC/LocalObjectDefCreator.xml +++ b/src/main/resources/boot/SC/LocalObjectDefCreator.xml @@ -2,16 +2,17 @@ <cristalscript>
<output name="errors" type="com.c2kernel.scripting.ErrorInfo" />
<script language="javascript" name="LocalObjectDefCreator"><