]>
git.argeo.org Git - gpl/argeo-slc.git/blob - server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Flow.js
0167d9b4eed8fee6db31d56d476f5c2067605619
2 * Wrapper for ExecutionFlow server object
4 qx
.Class
.define("org.argeo.slc.ria.execution.Flow", {
6 extend
: qx
.core
.Object
,
10 * Name of this Execution Flow
21 * An optional path describing this flow
28 * Name of the associated spec, to be found in the module
34 * Reference the actual ExecutionSpec object
37 check
: "org.argeo.slc.ria.execution.Spec"
40 * The values to init the ExecutionSpec
47 * Castor representation of the object
50 apply
: "_applyXmlNode"
60 * Path to the description
62 XPATH_DESCRIPTION
: "slc:description",
64 * XPath to the ExecutionSpec name
66 XPATH_EXEC_SPEC_NAME
: "@executionSpec",
70 XPATH_VALUES
: "slc:values",
72 * An optional hierarchical path
77 construct : function(){
83 * Init the object from an XML representation
84 * @param xmlNode {Node} Castor representation of this object
86 _applyXmlNode : function(xmlNode
){
88 name
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_NAME
),
89 path
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_PATH
),
90 description
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_DESCRIPTION
) || "",
91 executionSpecName
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_EXEC_SPEC_NAME
)
93 var values
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_VALUES
);
95 this.setValues(values
[0]);
99 * Get a given value inside the values map
100 * @param key {String} The key of the value
101 * @param specType {String} Expected type (currently "primitive" and "ref" are supported)
102 * @param specSubType {String} Expected subtype (depends on the type)
103 * @return {String} Value if it is set.
105 getValue: function(key
, specType
, specSubType
){
107 if(specType
== "primitive"){
108 xpath
= 'slc:value[@key="'+key
+'"]/slc:primitive-value[@type="'+specSubType
+'"]';
109 }else if(specType
== "ref"){
110 xpath
= 'slc:value[@key="'+key
+'"]/slc:ref-value/@ref';
112 return org
.argeo
.ria
.util
.Element
.getSingleNodeText(this.getValues(), xpath
);