]>
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/BatchEntrySpec.js
6269b49c064d5ac1411ec8071e8b7ef9dd79288d
2 * Data model for an entry of the Batch list : original Spec, flow and module, and currently computed value.
4 qx
.Class
.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
5 extend
: org
.argeo
.slc
.ria
.execution
.Spec
,
17 * Original Spec (values shall stay untouched).
23 * Instance of BatchEntrySpec
24 * @param module {org.argeo.slc.ria.execution.Module} Reference module
25 * @param flow {org.argeo.slc.ria.execution.Flow} Reference flow
27 construct : function(module
, flow
){
29 this.setModule(module
);
31 this.setOriginalSpec(flow
.getExecutionSpec());
32 this.setName(flow
.getExecutionSpec().getName());
33 this.fetchInstanceValues();
38 * Create a label to display in the batch list.
39 * @return {String} The label
41 getLabel : function(){
42 var label
= this.getModule().getName();
43 label
+= "/" + this.getModule().getVersion();
44 label
+= "/" + this.getFlow().getName();
50 var values
= this.getValues();
51 for(var key
in values
){
52 valuesXml
+= values
[key
].toValueXml();
54 var execFlowDescXML
= '<slc:execution-flow-descriptor name="'+this.getFlow().getName()+'" executionSpec="'+this.getName()+'"><slc:values>'+valuesXml
+'</slc:values></slc:execution-flow-descriptor>';
56 var execSpecDescXML
= this.getOriginalSpec().toXml();
58 var moduleData
= '<slc:module-name>'+this.getModule().getName()+'</slc:module-name><slc:module-version>'+this.getModule().getVersion()+'</slc:module-version>';
60 return '<slc:realized-flow>'+moduleData
+ execFlowDescXML
+ execSpecDescXML
+'</slc:realized-flow>';
65 * Fetch the Spec Values with the Flow Values to make the current instance value
67 fetchInstanceValues : function(){
68 var specValues
= this.getOriginalSpec().getValues();
69 var flow
= this.getFlow();
70 var instanceValues
= {};
71 for(var key
in specValues
){
72 var flowValue
= flow
.getValue(
74 specValues
[key
].getSpecType(),
75 specValues
[key
].getSpecSubType()
77 var instValue
= specValues
[key
].clone();
79 instValue
.setValue(flowValue
);
81 instanceValues
[key
] = instValue
;
83 this.setValues(instanceValues
);
84 //this.debug(instanceValues);