]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/BatchEntrySpec.js
Fetch Spec & Flow values
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-lib / slc / class / org / argeo / slc / ria / execution / BatchEntrySpec.js
index 3bb37fcdcba615df1902d94f8fdbc1505e98ecb4..5eae2b3b1f2709e56d13dcd5c359180b70ff225c 100644 (file)
@@ -15,5 +15,31 @@ qx.Class.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
                this.setModule(module);\r
                this.setFlow(flow);\r
                this.setOriginalSpec(flow.getExecutionSpec());\r
+               this.fetchInstanceValues();\r
+       },\r
+       \r
+       members :  {\r
+               /**\r
+                * Fetch the Spec Values with the Flow Values to make the current instance value\r
+                */\r
+               fetchInstanceValues : function(){\r
+                       var specValues = this.getOriginalSpec().getValues();\r
+                       var flow = this.getFlow();\r
+                       var instanceValues = {};\r
+                       for(var key in specValues){\r
+                               var flowValue = flow.getValue(\r
+                                                                       key, \r
+                                                                       specValues[key].getSpecType(), \r
+                                                                       specValues[key].getSpecSubType()\r
+                                                               );\r
+                               var instValue = specValues[key].clone();\r
+                               if(flowValue){\r
+                                       instValue.setValue(flowValue);\r
+                               }\r
+                               instanceValues[key] = instValue;\r
+                       }\r
+                       this.setValues(instanceValues);\r
+                       this.debug(instanceValues);\r
+               }\r
        }\r
 });
\ No newline at end of file