Implementation of a first draft of editorView for the process parameters.
authorBruno Sinou <bsinou@argeo.org>
Thu, 4 Nov 2010 16:25:26 +0000 (16:25 +0000)
committerBruno Sinou <bsinou@argeo.org>
Thu, 4 Nov 2010 16:25:26 +0000 (16:25 +0000)
Only string parameters are supported with this version.

git-svn-id: https://svn.argeo.org/slc/trunk@3847 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

21 files changed:
eclipse/plugins/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/contentprovider/ProcessDetailContentProvider.java
eclipse/plugins/org.argeo.slc.client.hibernate/META-INF/spring/osgi.xml
eclipse/plugins/org.argeo.slc.client.oxm/.classpath [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.oxm/.project [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.rcp/slc-client-rcp.product
eclipse/plugins/org.argeo.slc.client.ui/META-INF/MANIFEST.MF
eclipse/plugins/org.argeo.slc.client.ui/META-INF/spring/commands.xml
eclipse/plugins/org.argeo.slc.client.ui/META-INF/spring/osgi.xml
eclipse/plugins/org.argeo.slc.client.ui/META-INF/spring/views.xml
eclipse/plugins/org.argeo.slc.client.ui/plugin.xml
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/EditRealizedFlowDetailsHandler.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ExecutionModulesContentProvider.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ExecutionModulesContentProvider.java [deleted file]
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ExecutionModulesView.java
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ProcessBuilderView.java
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ProcessParametersView.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlowDescriptor.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionSpec.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionSpecAttribute.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/RealizedFlow.java

index a89c907527b2a42e3a02cee4cf32d13330b23277..497e2985189f91559720617f16a299e7a5810e8c 100644 (file)
@@ -11,7 +11,8 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
 /**
- * Basic tree view of the chosen process details
+ * Basic tree view of the chosen process details. For now, only a basic list of
+ * details is displayed, not a tree.
  */
 public class ProcessDetailContentProvider implements ITreeContentProvider {
        private final static Log log = LogFactory
@@ -90,14 +91,6 @@ public class ProcessDetailContentProvider implements ITreeContentProvider {
        }
 
        public boolean hasChildren(Object parent) {
-               // if (parent instanceof TreeParent && ((TreeParent) parent).isLoaded())
-               // {
-               // return ((TreeParent) parent).hasChildren();
-               // } else if (parent instanceof AgentNode) {
-               // return true;
-               // } else if (parent instanceof ExecutionModuleNode) {
-               // return true;
-               // }
                return false;
        }
 
@@ -109,7 +102,7 @@ public class ProcessDetailContentProvider implements ITreeContentProvider {
 
        public Object[] getElements(Object parent) {
                // return getChildren(parent);
-               // Here we must dupplicate the code otherwise the inner call to method
+               // Here we must duplicate the code otherwise the inner call to method
                // getChildren(parent); is not intercepted by AspectJ
                if (parent instanceof SlcExecution) {
                        slcExecution = (SlcExecution) parent;
@@ -130,148 +123,4 @@ public class ProcessDetailContentProvider implements ITreeContentProvider {
                }
                return null;
        }
-
-       // public class AgentNode extends TreeParent {
-       // private final SlcAgent agent;
-       //
-       // public AgentNode(SlcAgent agent) {
-       // super(agent.toString());
-       // this.agent = agent;
-       // }
-
-       // public SlcAgent getAgent() {
-       // return agent;
-       // }
-       // }
-
-       // public class ExecutionModuleNode extends TreeParent {
-       // private final AgentNode agentNode;
-       // private ExecutionModuleDescriptor descriptor;
-       // private Map<String, ExecutionFlowDescriptor> flowDescriptors;
-       //
-       // public ExecutionModuleNode(AgentNode agentNode,
-       // ExecutionModuleDescriptor descriptor) {
-       // super(descriptor.toString());
-       // this.agentNode = agentNode;
-       // this.descriptor = descriptor;
-       //
-       // }
-       //
-       // public AgentNode getAgentNode() {
-       // return agentNode;
-       // }
-       //
-       // public ExecutionModuleDescriptor getDescriptor() {
-       // return descriptor;
-       // }
-       // Object o = thisJoinPoint.getArgs()[0];
-
-       // public void cacheDescriptor(ExecutionModuleDescriptor descriptor) {
-       // this.descriptor = descriptor;
-       //
-       // SortedMap<String, FolderNode> folderNodes = new TreeMap<String,
-       // FolderNode>();
-       //
-       // flowDescriptors = new HashMap<String, ExecutionFlowDescriptor>();
-       // for (ExecutionFlowDescriptor fd : descriptor.getExecutionFlows()) {
-       // // if (log.isTraceEnabled())
-       // // log.trace("fd.path=" + fd.getPath() + ", fd.name="
-       // // + fd.getName());
-       //
-       // // find path and label
-       // String path;
-       // String label;
-       // int lastSlash = fd.getName().lastIndexOf('/');
-       // if ((fd.getPath() == null || fd.getPath().trim().equals(""))
-       // && lastSlash >= 0) {
-       // path = fd.getName().substring(0, lastSlash);
-       // label = fd.getName().substring(lastSlash + 1);
-       // } else {
-       // path = fd.getPath();
-       // label = fd.getName();
-       // }
-       // // if (log.isTraceEnabled())
-       // // log.trace("path=" + path + ", label=" + label);
-       //
-       // if (path == null || path.trim().equals("")
-       // || path.trim().equals("/")) {
-       // // directChildren.put(name, new FlowNode(name, this));
-       // addChild(new FlowNode(label, fd.getName(), this));
-       // } else {
-       // FolderNode folderNode = mkdirs(this, path, folderNodes);
-       // folderNode
-       // .addChild(new FlowNode(label, fd.getName(), this));
-       // }
-       //
-       // flowDescriptors.put(fd.getName(), fd);
-       // }
-       // // TODO: make it readonly
-       // }
-       //
-       // protected FolderNode mkdirs(TreeParent root, String path,
-       // SortedMap<String, FolderNode> folderNodes) {
-       // // Normalize
-       // if (path.charAt(0) != '/')
-       // path = '/' + path;
-       // if (path.charAt(path.length() - 1) == '/')
-       // path = path.substring(0, path.length() - 1);
-       //
-       // if (folderNodes.containsKey(path))
-       // return folderNodes.get(path);
-       //
-       // int lastIndx = path.lastIndexOf('/');
-       // String folderName;
-       // String parentPath;
-       // if (lastIndx >= 0) {
-       // folderName = path.substring(lastIndx + 1);
-       // parentPath = path.substring(0, lastIndx);
-       // } else {
-       // folderName = path;
-       // parentPath = "";
-       // }
-       //
-       // TreeParent parent;
-       // if (parentPath.equals(""))
-       // parent = root;
-       // else
-       // parent = mkdirs(root, parentPath, folderNodes);
-       // FolderNode newFolder = new FolderNode(folderName);
-       // parent.addChild(newFolder);
-       // folderNodes.put(path, newFolder);
-       // return newFolder;
-       // }
-       //
-       // public Map<String, ExecutionFlowDescriptor> getFlowDescriptors() {
-       // return flowDescriptors;
-       // }
-       //
-       // }
-       //
-       // public class FlowNode extends TreeObject {
-       // private final String flowName;
-       // private final ExecutionModuleNode executionModuleNode;
-       //
-       // public FlowNode(String label, String flowName,
-       // ExecutionModuleNode executionModuleNode) {
-       // super(label);
-       // this.flowName = flowName;
-       // this.executionModuleNode = executionModuleNode;
-       // }
-       //
-       // public String getFlowName() {
-       // return flowName;
-       // }
-       //
-       // public ExecutionModuleNode getExecutionModuleNode() {
-       // return executionModuleNode;
-       // }
-       //
-       // }
-       //
-       // public class FolderNode extends TreeParent {
-       // public FolderNode(String name) {
-       // super(name);
-       // }
-       //
-       // }
 }
index 51602be3b0886aa06480a65c2ea086580f582d4a..55bdfa70a98191ac2d6c4b7d17d5a299d55067f2 100644 (file)
@@ -34,5 +34,9 @@
 \r
        <reference id="sessionFactory" interface="org.hibernate.SessionFactory" />\r
 \r
+       <!-- Castor marshalling & un marshalling -->\r
+       <!-- <reference id="marshaller" interface="org.springframework.oxm.Marshaller" \r
+               /> <reference id="unmarshaller" interface="org.springframework.oxm.Unmarshaller" \r
+               /> -->\r
 \r
 </beans:beans>
\ No newline at end of file
diff --git a/eclipse/plugins/org.argeo.slc.client.oxm/.classpath b/eclipse/plugins/org.argeo.slc.client.oxm/.classpath
new file mode 100644 (file)
index 0000000..54b896e
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+<classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/eclipse/plugins/org.argeo.slc.client.oxm/.project b/eclipse/plugins/org.argeo.slc.client.oxm/.project
new file mode 100644 (file)
index 0000000..02b4cb4
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.slc.client.oxm</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
index abb73be76519276b395656e6d725d989e64e47b5..394124a21961ad50431c70d20fdc52cf11b9556b 100644 (file)
       <plugin id="org.argeo.dep.osgi.mina.filter.ssl" fragment="true"/>
       <plugin id="org.argeo.dep.osgi.springframework.ldap"/>
       <plugin id="org.argeo.eclipse.ui"/>
-      <plugin id="org.argeo.infra.core"/>
+      <plugin id="org.argeo.infra.core" fragment=""/>
       <plugin id="org.argeo.infra.security.services" fragment="true"/>
       <plugin id="org.argeo.security.core"/>
       <plugin id="org.argeo.security.manager.ldap"/>
       <plugin id="org.argeo.slc.agent.ext.xalan" fragment="true"/>
       <plugin id="org.argeo.slc.client.agent"/>
       <plugin id="org.argeo.slc.client.core"/>
-      <plugin id="org.argeo.slc.client.gis"/>
+      <plugin id="org.argeo.slc.client.gis" fragment=""/>
       <plugin id="org.argeo.slc.client.hibernate"/>
+      <plugin id="org.argeo.slc.client.oxm"/>
       <plugin id="org.argeo.slc.client.rcp"/>
       <plugin id="org.argeo.slc.client.ui"/>
       <plugin id="org.argeo.slc.core"/>
       <plugin id="org.argeo.slc.detached"/>
       <plugin id="org.argeo.slc.ext.activemq" fragment="true"/>
       <plugin id="org.argeo.slc.gis.ext.dbcp" fragment="true"/>
-      <plugin id="org.argeo.slc.gis.position.backend"/>
-      <plugin id="org.argeo.slc.gis.position.gpsbabel"/>
+      <plugin id="org.argeo.slc.gis.position.backend" fragment=""/>
+      <plugin id="org.argeo.slc.gis.position.gpsbabel" fragment=""/>
       <plugin id="org.argeo.slc.server"/>
+      <plugin id="org.argeo.slc.server.castor"/>
       <plugin id="org.argeo.slc.server.h2"/>
       <plugin id="org.argeo.slc.server.hibernate"/>
       <plugin id="org.argeo.slc.server.services"/>
       <plugin id="org.argeo.slc.client.agent" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.client.gis" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.client.hibernate" autoStart="true" startLevel="0" />
+      <plugin id="org.argeo.slc.client.oxm" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.client.ui" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.demo.ant" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.demo.basic" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.gis.position.backend" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.gis.position.gpsbabel" autoStart="true" startLevel="0" />
+      <plugin id="org.argeo.slc.server.castor" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.server.h2" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.server.hibernate" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.server.services" autoStart="true" startLevel="0" />
index b025a7dd072cba401cb1fd4c399ce71d10af9451..37b62245c0b5d0a1f1cd25dcb245892b3c4f52c8 100644 (file)
@@ -17,23 +17,24 @@ Import-Package: org.apache.commons.io;version="1.4.0",
  org.argeo.eclipse.spring,
  org.argeo.eclipse.ui,
  org.argeo.slc,
- org.argeo.slc.build;version="0.13.0.SNAPSHOT-r3685",
+ org.argeo.slc.build,
+ org.argeo.slc.client.oxm,
  org.argeo.slc.core.attachment,
- org.argeo.slc.core.runtime;version="0.13.0.SNAPSHOT-r3701",
+ org.argeo.slc.core.execution,
+ org.argeo.slc.core.runtime,
  org.argeo.slc.core.structure.tree,
- org.argeo.slc.core.test.tree;version="0.13.0.SNAPSHOT-r3768",
+ org.argeo.slc.core.test.tree,
  org.argeo.slc.dao.process,
  org.argeo.slc.dao.test,
- org.argeo.slc.dao.test.tree;version="0.13.0.SNAPSHOT-r3768",
- org.argeo.slc.deploy;version="0.13.0.SNAPSHOT-r3724",
- org.argeo.slc.execution;version="0.13.0.SNAPSHOT-r3685",
+ org.argeo.slc.dao.test.tree,
+ org.argeo.slc.deploy,
+ org.argeo.slc.execution,
  org.argeo.slc.msg.test.tree,
- org.argeo.slc.process;version="0.13.0.SNAPSHOT-r3685",
- org.argeo.slc.runtime;version="0.13.0.SNAPSHOT-r3685",
- org.argeo.slc.services;version="0.13.0.SNAPSHOT-r3773",
- org.argeo.slc.services.impl;version="0.13.0.SNAPSHOT-r3777",
+ org.argeo.slc.process,
+ org.argeo.slc.runtime,
+ org.argeo.slc.services,
+ org.argeo.slc.services.impl,
  org.argeo.slc.test,
  org.springframework.beans.factory,
  org.springframework.context,
  org.springframework.core.io.support
-
index c25bba7ef2e4dc4c80666e74ef285ba4ada94be5..11aaf10948e938a71f5ce463228caf8699b32d91 100644 (file)
@@ -20,4 +20,9 @@
                class="org.argeo.slc.client.ui.commands.ResultDetailsDisplayHandler"
                scope="prototype">
        </bean>
+       <bean id="org.argeo.slc.client.ui.editRealizedFlowDetails"
+               class="org.argeo.slc.client.ui.commands.EditRealizedFlowDetailsHandler"
+               scope="prototype">
+               <property name="oxmBean" ref="oxmBean" />
+       </bean>
 </beans>
index d77570ce0bfd914a5324e49ce8f4c10f7c5f4dc3..e05a8658538aa38ed72402af7b4d462cdbdf6f42 100644 (file)
        <!-- References needed by the current bundle -->\r
        <reference id="slcExecutionService" interface="org.argeo.slc.services.SlcExecutionService" />\r
        <reference id="testManagerService" interface="org.argeo.slc.services.TestManagerService" />\r
+       <reference id="oxmBean" interface="org.argeo.slc.client.oxm.OxmInterface" />\r
+\r
+       <!-- References Needed -->\r
+       <!-- <reference id="marshaller" interface="org.springframework.oxm.Marshaller" \r
+               /> <reference id="unmarshaller" interface="org.springframework.oxm.Unmarshaller" \r
+               /> -->\r
 \r
        <!-- DAO -->\r
        <reference id="testResultCollectionDao"\r
                interface="org.argeo.slc.dao.test.tree.TreeTestResultCollectionDao"\r
                context-class-loader="service-provider" />\r
 \r
-       <reference id="treeTestResultDao"\r
-               interface="org.argeo.slc.dao.test.tree.TreeTestResultDao"\r
+       <reference id="treeTestResultDao" interface="org.argeo.slc.dao.test.tree.TreeTestResultDao"\r
                context-class-loader="service-provider" />\r
-               \r
-               \r
+\r
+\r
        <reference id="slcExecutionDao" interface="org.argeo.slc.dao.process.SlcExecutionDao"\r
                context-class-loader="service-provider" />\r
 \r
index 4cb9bc59bfeb8e4e95c078376f635fe4bcf5ed60..b7055d14ad0729eb86784431542861195c6d3ca5 100644 (file)
@@ -4,10 +4,12 @@
        xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd">
 
+       <!-- Views -->
        <bean id="org.argeo.slc.client.ui.executionModulesView" class="org.argeo.slc.client.ui.views.ExecutionModulesView"
                scope="prototype">
                <property name="contentProvider" ref="executionModulesContentProvider" />
                <property name="processController" ref="processController" />
+               <property name="oxmBean" ref="oxmBean" />
        </bean>
 
        <bean id="org.argeo.slc.client.ui.resultListView" class="org.argeo.slc.client.ui.views.ResultListView"
                <property name="labelProvider" ref="processDetailLabelProvider" />
        </bean>
 
-       <bean id="processDetailLabelProvider"
-               class="org.argeo.slc.client.ui.views.ProcessDetailLabelProvider"
-               scope="prototype" />
-
        <bean id="org.argeo.slc.client.ui.processBuilderView" class="org.argeo.slc.client.ui.views.ProcessBuilderView"
                scope="prototype">
                <property name="processController" ref="processController" />
+               <property name="oxmBean" ref="oxmBean" />
        </bean>
 
        <bean id="org.argeo.slc.client.ui.processParametersView" class="org.argeo.slc.client.ui.views.ProcessParametersView"
                scope="prototype">
        </bean>
 
-
+       <!-- Providers. -->
        <bean id="executionModulesContentProvider"
-               class="org.argeo.slc.client.ui.views.ExecutionModulesContentProvider">
+               class="org.argeo.slc.client.ui.providers.ExecutionModulesContentProvider">
                <property name="slcAgents" ref="slcAgents" />
        </bean>
-
 </beans>
index d55bd58882ccc9b981029b4595e5363eb9beb1d8..f4a8f87d4aa9d4e98e29f7bbd445b61ed70a8267 100644 (file)
                        name="Result UUID">
                        </commandParameter>
        </command>
+   <command 
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.slc.client.ui.editRealizedFlowDetails"
+               name="EditRealizedFlowDetails">
+                       <commandParameter
+                       id="org.argeo.slc.client.commands.realizedFlowAsXml"
+                       name="RealizedFlowAsXml">
+                       </commandParameter>
+                       <commandParameter
+                       id="org.argeo.slc.client.commands.realizedFlowIndex"
+                       name="realizedFlowIndex">
+                       </commandParameter>
+       </command>
    </extension>
    <extension
         point="org.eclipse.ui.bindings">
diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/EditRealizedFlowDetailsHandler.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/EditRealizedFlowDetailsHandler.java
new file mode 100644 (file)
index 0000000..a21ac37
--- /dev/null
@@ -0,0 +1,50 @@
+package org.argeo.slc.client.ui.commands;
+
+import org.argeo.slc.client.oxm.OxmInterface;
+import org.argeo.slc.client.ui.views.ProcessParametersView;
+import org.argeo.slc.process.RealizedFlow;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Command handler to display and edit the attributes of a given Realizedflow.
+ * The corresponding RealizedFlow is passed via command parameters and
+ * unmarshalled with the oxmBean which is injected by Spring.
+ * 
+ * @author bsinou
+ * 
+ */
+
+public class EditRealizedFlowDetailsHandler extends AbstractHandler {
+
+       // IoC
+       private OxmInterface oxmBean;
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               // We pass Realized flow through command parameters as XML
+               String rfAsXml = event
+                               .getParameter("org.argeo.slc.client.commands.realizedFlowAsXml");
+               int index = new Integer(
+                               event.getParameter("org.argeo.slc.client.commands.realizedFlowIndex"))
+                               .intValue();
+               RealizedFlow rf = (RealizedFlow) oxmBean.unmarshal(rfAsXml);
+
+               try {
+                       ProcessParametersView ppView = (ProcessParametersView) HandlerUtil
+                                       .getActiveWorkbenchWindow(event).getActivePage()
+                                       .showView(ProcessParametersView.ID);
+                       ppView.setRealizedFlow(index, rf);
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               return null;
+       }
+
+       // IoC
+       public void setOxmBean(OxmInterface oxmBean) {
+               this.oxmBean = oxmBean;
+       }
+
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ExecutionModulesContentProvider.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ExecutionModulesContentProvider.java
new file mode 100644 (file)
index 0000000..9f8d267
--- /dev/null
@@ -0,0 +1,264 @@
+package org.argeo.slc.client.ui.providers;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.eclipse.ui.TreeObject;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.slc.execution.ExecutionFlowDescriptor;
+import org.argeo.slc.execution.ExecutionModuleDescriptor;
+import org.argeo.slc.runtime.SlcAgent;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+public class ExecutionModulesContentProvider implements ITreeContentProvider {
+       private final static Log log = LogFactory
+                       .getLog(ExecutionModulesContentProvider.class);
+
+       private List<SlcAgent> slcAgents;
+
+       public Object[] getChildren(Object parent) {
+
+               if (parent instanceof ExecutionModuleNode) {
+                       ExecutionModuleNode executionModuleNode = (ExecutionModuleNode) parent;
+                       ExecutionModuleDescriptor emd = executionModuleNode.getDescriptor();
+
+                       // Terminate the building of UI specific object emd
+                       emd = executionModuleNode
+                                       .getAgentNode()
+                                       .getAgent()
+                                       .getExecutionModuleDescriptor(emd.getName(),
+                                                       emd.getVersion());
+                       executionModuleNode.cacheDescriptor(emd);
+
+                       // This is not recursive, e.g. ExecutionModuleNode build a Tree of
+                       // specific
+                       // treeObject and cache it in the cacheDescriptor.
+                       // Then we only have TreeObjects
+                       return executionModuleNode.getChildren();
+               } else if (parent instanceof AgentNode) {
+                       AgentNode agentNode = (AgentNode) parent;
+
+                       if (log.isTraceEnabled())
+                               log.trace("Scan agent " + agentNode);
+
+                       agentNode.clearChildren();
+                       for (ExecutionModuleDescriptor desc : agentNode.getAgent()
+                                       .listExecutionModuleDescriptors()) {
+                               agentNode.addChild(new ExecutionModuleNode(agentNode, desc));
+                       }
+
+                       return agentNode.getChildren();
+               } else if (parent instanceof TreeParent) {
+                       return ((TreeParent) parent).getChildren();
+               } else if (parent instanceof FlowNode) {
+                       return new Object[0];
+               } else {
+                       List<AgentNode> agentNodes = new ArrayList<AgentNode>();
+                       for (SlcAgent slcAgent : slcAgents) {
+                               agentNodes.add(new AgentNode(slcAgent));
+                       }
+                       return agentNodes.toArray();
+               }
+       }
+
+       public Object getParent(Object node) {
+               // if (node instanceof TreeObject) {
+               // return ((TreeObject) node).getParent();
+               // }
+               return null;
+       }
+
+       public boolean hasChildren(Object parent) {
+               if (parent instanceof TreeParent && ((TreeParent) parent).isLoaded()) {
+                       return ((TreeParent) parent).hasChildren();
+               } else if (parent instanceof AgentNode) {
+                       return true;
+               } else if (parent instanceof ExecutionModuleNode) {
+                       return true;
+               }
+               return false;
+       }
+
+       public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+       }
+
+       public void dispose() {
+       }
+
+       public Object[] getElements(Object parent) {
+               return getChildren(parent);
+       }
+
+       public void setSlcAgents(List<SlcAgent> slcAgents) {
+               this.slcAgents = slcAgents// for (String flowName :
+                                                                       // executionModuleNode.getFlowDescriptors()
+               // .keySet()) {
+               // executionModuleNode.addChild(new FlowNode(flowName,
+               // executionModuleNode));
+               // }
+               ;
+       }
+
+       public class AgentNode extends TreeParent {
+               private final SlcAgent agent;
+
+               public AgentNode(SlcAgent agent) {
+                       super(agent.toString());
+                       this.agent = agent;
+               }
+
+               public SlcAgent getAgent() {
+                       return agent;
+               }
+       }
+
+       public class ExecutionModuleNode extends TreeParent {
+               private final AgentNode agentNode;
+               private ExecutionModuleDescriptor descriptor;
+               private Map<String, ExecutionFlowDescriptor> flowDescriptors;
+
+               public ExecutionModuleNode(AgentNode agentNode,
+                               ExecutionModuleDescriptor descriptor) {
+                       super(descriptor.toString());
+                       this.agentNode = agentNode;
+                       this.descriptor = descriptor;
+
+               }
+
+               public AgentNode getAgentNode() {
+                       return agentNode;
+               }
+
+               public ExecutionModuleDescriptor getDescriptor() {
+                       return descriptor;
+               }
+
+               public void cacheDescriptor(ExecutionModuleDescriptor descriptor) {
+                       this.descriptor = descriptor;
+
+                       SortedMap<String, FolderNode> folderNodes = new TreeMap<String, FolderNode>();
+                       flowDescriptors = new HashMap<String, ExecutionFlowDescriptor>();
+
+                       for (ExecutionFlowDescriptor fd : descriptor.getExecutionFlows()) {
+                               // Find, format and store path and label values for each flow
+                               // descritor:
+
+                               // we format name of type path="" & name="path/toTest/Test" to :
+                               // path="path/toTest/" name="Test"
+                               String path;
+                               String label;
+                               int lastSlash = fd.getName().lastIndexOf('/');
+                               if ((fd.getPath() == null || fd.getPath().trim().equals(""))
+                                               && lastSlash >= 0) {
+                                       path = fd.getName().substring(0, lastSlash);
+                                       label = fd.getName().substring(lastSlash + 1);
+                               } else {
+                                       path = fd.getPath();
+                                       label = fd.getName();
+                               }
+
+                               if (path == null || path.trim().equals("")
+                                               || path.trim().equals("/")) {
+                                       // directChildren.put(name, new FlowNode(name, this));
+                                       addChild(new FlowNode(label, fd.getName(), fd, this));
+                               } else {
+                                       FolderNode folderNode = mkdirs(this, path, folderNodes);
+                                       folderNode.addChild(new FlowNode(label, fd.getName(), fd,
+                                                       this));
+                               }
+
+                               flowDescriptors.put(fd.getName(), fd);
+                       }
+                       // TODO: make it readonly
+               }
+
+               protected FolderNode mkdirs(TreeParent root, String path,
+                               SortedMap<String, FolderNode> folderNodes) {
+                       // Normalize
+                       if (path.charAt(0) != '/')
+                               path = '/' + path;
+                       if (path.charAt(path.length() - 1) == '/')
+                               path = path.substring(0, path.length() - 1);
+
+                       if (folderNodes.containsKey(path))
+                               return folderNodes.get(path);
+
+                       int lastIndx = path.lastIndexOf('/');
+                       String folderName;
+                       String parentPath;
+                       if (lastIndx >= 0) {
+                               folderName = path.substring(lastIndx + 1);
+                               parentPath = path.substring(0, lastIndx);
+                       } else {
+                               folderName = path;
+                               parentPath = "";
+                       }
+
+                       TreeParent parent;
+                       if (parentPath.equals(""))
+                               parent = root;
+                       else
+                               parent = mkdirs(root, parentPath, folderNodes);
+                       FolderNode newFolder = new FolderNode(folderName);
+                       parent.addChild(newFolder);
+                       folderNodes.put(path, newFolder);
+                       return newFolder;
+               }
+
+               public Map<String, ExecutionFlowDescriptor> getFlowDescriptors() {
+                       return flowDescriptors;
+               }
+
+       }
+
+       /**
+        * 
+        * @author bsinou
+        * 
+        *         The implementation of a vernice of a given slc process. Note that
+        *         we store the parent node (execution module node) & the
+        *         ExecutionFlowDescriptor.
+        */
+       public class FlowNode extends TreeObject {
+
+               private final String flowName;
+               private final ExecutionModuleNode executionModuleNode;
+               private final ExecutionFlowDescriptor executionFlowDescriptor;
+
+               public FlowNode(String label, String flowName,
+                               ExecutionFlowDescriptor executionFlowDescriptor,
+                               ExecutionModuleNode parent) {
+                       super(label);
+                       this.flowName = flowName;
+                       this.executionFlowDescriptor = executionFlowDescriptor;
+                       this.executionModuleNode = parent;
+               }
+
+               public String getFlowName() {
+                       return flowName;
+               }
+
+               public ExecutionModuleNode getExecutionModuleNode() {
+                       return executionModuleNode;
+               }
+
+               public ExecutionFlowDescriptor getExecutionFlowDescriptor() {
+                       return executionFlowDescriptor;
+               }
+
+       }
+
+       public class FolderNode extends TreeParent {
+               public FolderNode(String name) {
+                       super(name);
+               }
+
+       }
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java
new file mode 100644 (file)
index 0000000..1501964
--- /dev/null
@@ -0,0 +1,94 @@
+package org.argeo.slc.client.ui.providers;
+
+import org.argeo.slc.client.ui.views.ProcessBuilderView;
+import org.argeo.slc.client.ui.views.ProcessParametersView;
+import org.argeo.slc.core.execution.PrimitiveAccessor;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+
+/**
+ * 
+ * @author bsinou
+ * 
+ *         This class implements the ability to edit and save various type of
+ *         parameter of a given process. Parameter values are directly saved as
+ *         soon as the focus on a given field is lost.
+ * 
+ * 
+ *         Note that this EditingSupport is tightly coupled with both
+ *         ProcessParametersView and ProcessBuilderView; it cannot serve as a
+ *         generic EditingSupport as is. Note also that it assumes that the
+ *         processes in ProcessBuilderView as stored as an ordered list.
+ */
+
+public class ProcessParametersEditingSupport extends EditingSupport {
+
+       private CellEditor editor;
+       private int column;
+
+       // So that we can update corresponding process
+       private int curProcessIndex;
+       private ProcessBuilderView pbView;
+
+       public ProcessParametersEditingSupport(ColumnViewer viewer, int column) {
+               super(viewer);
+               editor = new TextCellEditor(((TableViewer) viewer).getTable());
+               this.column = column;
+       }
+
+       @Override
+       protected CellEditor getCellEditor(Object element) {
+               return editor;
+       }
+
+       @Override
+       protected boolean canEdit(Object element) {
+               return true;
+       }
+
+       @Override
+       protected Object getValue(Object element) {
+               ProcessParametersView.ObjectWithName objectWithName = (ProcessParametersView.ObjectWithName) element;
+
+               if (objectWithName.obj instanceof PrimitiveAccessor) {
+                       PrimitiveAccessor pv = (PrimitiveAccessor) objectWithName.obj;
+                       // we only handle string parameter in a first time
+                       if ("string".equals(pv.getType())) {
+                               return pv.getValue();
+                       }
+               }
+               return "unsupported param type";
+
+       }
+
+       @Override
+       protected void setValue(Object element, Object value) {
+               ProcessParametersView.ObjectWithName objectWithName = (ProcessParametersView.ObjectWithName) element;
+
+               if (objectWithName.obj instanceof PrimitiveAccessor) {
+                       PrimitiveAccessor pv = (PrimitiveAccessor) objectWithName.obj;
+                       // we only handle string parameter in a first time
+                       if ("string".equals(pv.getType())) {
+                               pv.setValue(value);
+                               pbView.updateParameter(curProcessIndex, objectWithName.name,
+                                               objectWithName.obj);
+                               getViewer().update(element, null);
+                       }
+               }
+
+       }
+
+       // Store the index of the process which parameters are being edited
+       public void setCurrentProcessIndex(int index) {
+               this.curProcessIndex = index;
+       }
+
+       public void setCurrentProcessBuilderView(
+                       ProcessBuilderView processbuilderView) {
+               this.pbView = processbuilderView;
+       }
+
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ExecutionModulesContentProvider.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ExecutionModulesContentProvider.java
deleted file mode 100644 (file)
index 365f046..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-package org.argeo.slc.client.ui.views;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.eclipse.ui.TreeObject;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.execution.ExecutionFlowDescriptor;
-import org.argeo.slc.execution.ExecutionModuleDescriptor;
-import org.argeo.slc.runtime.SlcAgent;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class ExecutionModulesContentProvider implements ITreeContentProvider {
-       private final static Log log = LogFactory
-                       .getLog(ExecutionModulesContentProvider.class);
-
-       private List<SlcAgent> slcAgents;
-
-       public Object[] getChildren(Object parent) {
-
-               if (parent instanceof ExecutionModuleNode) {
-                       ExecutionModuleNode executionModuleNode = (ExecutionModuleNode) parent;
-                       ExecutionModuleDescriptor emd = executionModuleNode.getDescriptor();
-
-                       // Terminate the building of UI specific object emd
-                       emd = executionModuleNode
-                                       .getAgentNode()
-                                       .getAgent()
-                                       .getExecutionModuleDescriptor(emd.getName(),
-                                                       emd.getVersion());
-                       executionModuleNode.cacheDescriptor(emd);
-
-                       // This is not recursive, e.g. ExecutionModuleNode build a Tree of
-                       // specific
-                       // treeObject and cache it in the cacheDescriptor.
-                       // Then we only have TreeObjects
-                       return executionModuleNode.getChildren();
-               } else if (parent instanceof AgentNode) {
-                       AgentNode agentNode = (AgentNode) parent;
-
-                       if (log.isTraceEnabled())
-                               log.trace("Scan agent " + agentNode);
-
-                       agentNode.clearChildren();
-                       for (ExecutionModuleDescriptor desc : agentNode.getAgent()
-                                       .listExecutionModuleDescriptors()) {
-                               agentNode.addChild(new ExecutionModuleNode(agentNode, desc));
-                       }
-
-                       return agentNode.getChildren();
-               } else if (parent instanceof TreeParent) {
-                       return ((TreeParent) parent).getChildren();
-               } else if (parent instanceof FlowNode) {
-                       return new Object[0];
-               } else {
-                       List<AgentNode> agentNodes = new ArrayList<AgentNode>();
-                       for (SlcAgent slcAgent : slcAgents) {
-                               agentNodes.add(new AgentNode(slcAgent));
-                       }
-                       return agentNodes.toArray();
-               }
-       }
-
-       public Object getParent(Object node) {
-               // if (node instanceof TreeObject) {
-               // return ((TreeObject) node).getParent();
-               // }
-               return null;
-       }
-
-       public boolean hasChildren(Object parent) {
-               if (parent instanceof TreeParent && ((TreeParent) parent).isLoaded()) {
-                       return ((TreeParent) parent).hasChildren();
-               } else if (parent instanceof AgentNode) {
-                       return true;
-               } else if (parent instanceof ExecutionModuleNode) {
-                       return true;
-               }
-               return false;
-       }
-
-       public void inputChanged(Viewer v, Object oldInput, Object newInput) {
-       }
-
-       public void dispose() {
-       }
-
-       public Object[] getElements(Object parent) {
-               return getChildren(parent);
-       }
-
-       public void setSlcAgents(List<SlcAgent> slcAgents) {
-               this.slcAgents = slcAgents// for (String flowName :
-                                                                       // executionModuleNode.getFlowDescriptors()
-               // .keySet()) {
-               // executionModuleNode.addChild(new FlowNode(flowName,
-               // executionModuleNode));
-               // }
-               ;
-       }
-
-       public class AgentNode extends TreeParent {
-               private final SlcAgent agent;
-
-               public AgentNode(SlcAgent agent) {
-                       super(agent.toString());
-                       this.agent = agent;
-               }
-
-               public SlcAgent getAgent() {
-                       return agent;
-               }
-       }
-
-       public class ExecutionModuleNode extends TreeParent {
-               private final AgentNode agentNode;
-               private ExecutionModuleDescriptor descriptor;
-               private Map<String, ExecutionFlowDescriptor> flowDescriptors;
-
-               public ExecutionModuleNode(AgentNode agentNode,
-                               ExecutionModuleDescriptor descriptor) {
-                       super(descriptor.toString());
-                       this.agentNode = agentNode;
-                       this.descriptor = descriptor;
-
-               }
-
-               public AgentNode getAgentNode() {
-                       return agentNode;
-               }
-
-               public ExecutionModuleDescriptor getDescriptor() {
-                       return descriptor;
-               }
-
-               public void cacheDescriptor(ExecutionModuleDescriptor descriptor) {
-                       this.descriptor = descriptor;
-
-                       SortedMap<String, FolderNode> folderNodes = new TreeMap<String, FolderNode>();
-
-                       flowDescriptors = new HashMap<String, ExecutionFlowDescriptor>();
-                       for (ExecutionFlowDescriptor fd : descriptor.getExecutionFlows()) {
-                               if (log.isTraceEnabled())
-                                       log.trace("fd.path=" + fd.getPath() + ", fd.name="
-                                                       + fd.getName());
-                               Map<String, Object> values = fd.getValues();
-
-                               if (values == null)
-                                       log.debug("No attribute for " + fd.getName());
-                               else
-                                       for (String key : values.keySet())
-                                               log.debug(key + " - " + values.get(key));
-
-                               // find path and label
-                               String path;
-                               String label;
-                               int lastSlash = fd.getName().lastIndexOf('/');
-                               if ((fd.getPath() == null || fd.getPath().trim().equals(""))
-                                               && lastSlash >= 0) {
-                                       path = fd.getName().substring(0, lastSlash);
-                                       label = fd.getName().substring(lastSlash + 1);
-                               } else {
-                                       path = fd.getPath();
-                                       label = fd.getName();
-                               }
-                               // if (log.isTraceEnabled())
-                               // log.trace("path=" + path + ", label=" + label);
-
-                               if (path == null || path.trim().equals("")
-                                               || path.trim().equals("/")) {
-                                       // directChildren.put(name, new FlowNode(name, this));
-                                       addChild(new FlowNode(label, fd.getName(), fd.getValues(),
-                                                       this));
-                               } else {
-                                       FolderNode folderNode = mkdirs(this, path, folderNodes);
-                                       // TODO : why do we add a reference to the parent ?
-                                       // Probably to differentiate 2 flow nodes with same name but
-                                       // distinct execution Node. TBC
-                                       folderNode.addChild(new FlowNode(label, fd.getName(), fd
-                                                       .getValues(), this));
-
-                               }
-
-                               flowDescriptors.put(fd.getName(), fd);
-                       }
-                       // TODO: make it readonly
-               }
-
-               protected FolderNode mkdirs(TreeParent root, String path,
-                               SortedMap<String, FolderNode> folderNodes) {
-                       // Normalize
-                       if (path.charAt(0) != '/')
-                               path = '/' + path;
-                       if (path.charAt(path.length() - 1) == '/')
-                               path = path.substring(0, path.length() - 1);
-
-                       if (folderNodes.containsKey(path))
-                               return folderNodes.get(path);
-
-                       int lastIndx = path.lastIndexOf('/');
-                       String folderName;
-                       String parentPath;
-                       if (lastIndx >= 0) {
-                               folderName = path.substring(lastIndx + 1);
-                               parentPath = path.substring(0, lastIndx);
-                       } else {
-                               folderName = path;
-                               parentPath = "";
-                       }
-
-                       TreeParent parent;
-                       if (parentPath.equals(""))
-                               parent = root;
-                       else
-                               parent = mkdirs(root, parentPath, folderNodes);
-                       FolderNode newFolder = new FolderNode(folderName);
-                       parent.addChild(newFolder);
-                       folderNodes.put(path, newFolder);
-                       return newFolder;
-               }
-
-               public Map<String, ExecutionFlowDescriptor> getFlowDescriptors() {
-                       return flowDescriptors;
-               }
-
-       }
-
-       public class FlowNode extends TreeObject {
-               private final String flowName;
-               private final ExecutionModuleNode executionModuleNode;
-
-               // TODO : handle casting from various object type to String and reverse.
-               private final Map<String, Object> values;
-
-               public FlowNode(String label, String flowName,
-                               Map<String, Object> values, ExecutionModuleNode parent) {
-                       super(label);
-                       this.flowName = flowName;
-                       this.values = values;
-                       this.executionModuleNode = parent;
-               }
-
-               public Map<String, Object> getValues() {
-                       return values;
-               }
-
-               public Object getValueByKey(String key) {
-                       return values.get(key);
-               }
-
-               public void setValueByKey(String key, Object value) {
-                       if (values.get(key) == null)
-                               throw new SlcException("Unsupported Parameter " + key
-                                               + " for FlowNode " + flowName);
-                       else {
-                               values.remove(key);
-                               values.put(key, value);
-                       }
-               }
-
-               public String getFlowName() {
-                       return flowName;
-               }
-
-               public ExecutionModuleNode getExecutionModuleNode() {
-                       return executionModuleNode;
-               }
-
-       }
-
-       public class FolderNode extends TreeParent {
-               public FolderNode(String name) {
-                       super(name);
-               }
-
-       }
-}
index 370ed3889440827ccdb950322754d430baf7fe41..c6ba27b138688cbc09ee89a0db51d5330a0d2897 100644 (file)
@@ -4,15 +4,16 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 import java.util.UUID;
 
 import org.apache.commons.io.IOUtils;
 import org.argeo.slc.SlcException;
+import org.argeo.slc.client.oxm.OxmInterface;
 import org.argeo.slc.client.ui.ClientUiPlugin;
 import org.argeo.slc.client.ui.controllers.ProcessController;
-import org.argeo.slc.execution.ExecutionFlowDescriptor;
+import org.argeo.slc.client.ui.providers.ExecutionModulesContentProvider;
+import org.argeo.slc.client.ui.providers.ExecutionModulesContentProvider.FlowNode;
 import org.argeo.slc.execution.ExecutionModuleDescriptor;
 import org.argeo.slc.process.RealizedFlow;
 import org.argeo.slc.process.SlcExecution;
@@ -43,8 +44,9 @@ public class ExecutionModulesView extends ViewPart {
 
        private TreeViewer viewer;
 
+       // Ioc
        private IContentProvider contentProvider;
-
+       private OxmInterface oxmBean;
        private ProcessController processController;
 
        public void createPartControl(Composite parent) {
@@ -66,14 +68,6 @@ public class ExecutionModulesView extends ViewPart {
                return viewer;
        }
 
-       public void setContentProvider(IContentProvider contentProvider) {
-               this.contentProvider = contentProvider;
-       }
-
-       public void setProcessController(ProcessController processController) {
-               this.processController = processController;
-       }
-
        class ViewLabelProvider extends LabelProvider implements
                        ITableLabelProvider {
                public String getColumnText(Object obj, int index) {
@@ -153,13 +147,15 @@ public class ExecutionModulesView extends ViewPart {
                        IStructuredSelection selection = (IStructuredSelection) viewer
                                        .getSelection();
                        if (selection.getFirstElement() instanceof ExecutionModulesContentProvider.FlowNode) {
-                               
+
                                if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
                                        ExecutionModulesContentProvider.FlowNode flowNode = (ExecutionModulesContentProvider.FlowNode) selection
                                                        .getFirstElement();
-                                       RealizedFlow rf = nodeAsRealizedFlow(flowNode);
+
+                                       // we still use property because the marshaller bean does
+                                       // not know the FlowNode Class
                                        Properties props = new Properties();
-                                       realizedFlowAsProperties(props, rf);
+                                       flowNodeAsProperties(props, flowNode);
                                        props.setProperty("agentId", flowNode
                                                        .getExecutionModuleNode().getAgentNode().getAgent()
                                                        .getAgentUuid());
@@ -182,31 +178,38 @@ public class ExecutionModulesView extends ViewPart {
                        System.out.println("Finished Drag");
                }
 
-               private RealizedFlow nodeAsRealizedFlow(
-                               ExecutionModulesContentProvider.FlowNode flowNode) {
-                       RealizedFlow rf = new RealizedFlow();
-                       rf.setModuleName(flowNode.getExecutionModuleNode().getDescriptor()
-                                       .getName());
-                       rf.setModuleVersion(flowNode.getExecutionModuleNode()
+               private void flowNodeAsProperties(Properties props, FlowNode fn) {
+                       props.setProperty("moduleName", fn.getExecutionModuleNode()
+                                       .getDescriptor().getName());
+                       props.setProperty("moduleVersion", fn.getExecutionModuleNode()
                                        .getDescriptor().getVersion());
-                       ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor();
-                       efd.setName(flowNode.getFlowName());
-                       efd.setValues(flowNode.getValues());
-                       rf.setFlowDescriptor(efd);
-                       return rf;
-               }
+                       props.setProperty("flowName", fn.getFlowName());
+
+                       System.out.println("Execution Spec avant marshalling ??? ");
+                       System.out.println(fn.getExecutionFlowDescriptor());
+                       System.out.println(fn.getExecutionFlowDescriptor()
+                                       .getExecutionSpec());
+
+                       props.setProperty("FlowDescriptorAsXml",
+                                       oxmBean.marshal(fn.getExecutionFlowDescriptor()));
+                       System.out
+                                       .println(oxmBean.marshal(fn.getExecutionFlowDescriptor()));
 
-               private void realizedFlowAsProperties(Properties props, RealizedFlow rf) {
-                       props.setProperty("moduleName", rf.getModuleName());
-                       props.setProperty("moduleVersion", rf.getModuleVersion());
-                       props.setProperty("flowName", rf.getFlowDescriptor().getName());
-                       Map<String, Object> values = rf.getFlowDescriptor().getValues();
-                       if (values != null && values.size() > 0)
-                               for (String key : values.keySet())
-                                       props.setProperty("values-" + key, values.get(key)
-                                                       .toString());
                }
 
        }
 
+       // IoC
+       public void setContentProvider(IContentProvider contentProvider) {
+               this.contentProvider = contentProvider;
+       }
+
+       public void setProcessController(ProcessController processController) {
+               this.processController = processController;
+       }
+
+       public void setOxmBean(OxmInterface oxmBean) {
+               this.oxmBean = oxmBean;
+       }
+
 }
\ No newline at end of file
index cd2546aebe5534eff764bd2da5a13da5c998792b..c7f103505f067c3a862b0ca36c5c51aba14b47e3 100644 (file)
@@ -9,14 +9,23 @@ import java.util.UUID;
 
 import org.apache.commons.io.IOUtils;
 import org.argeo.slc.SlcException;
+import org.argeo.slc.client.oxm.OxmInterface;
+import org.argeo.slc.client.ui.ClientUiPlugin;
 import org.argeo.slc.client.ui.controllers.ProcessController;
 import org.argeo.slc.execution.ExecutionFlowDescriptor;
 import org.argeo.slc.process.RealizedFlow;
 import org.argeo.slc.process.SlcExecution;
 import org.argeo.slc.runtime.SlcAgent;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.Parameterization;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerDropAdapter;
@@ -30,8 +39,21 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 
+/**
+ * Display a list of processes that are to be launched as batch. For the moment
+ * being, only one agent by batch is enabled. The batch is contructed by
+ * dropping process from the ExecutionModuleView. Wrong type of data dropped in
+ * this view might raise errors.
+ * 
+ * @author bsinou
+ * 
+ */
 public class ProcessBuilderView extends ViewPart {
        public static final String ID = "org.argeo.slc.client.ui.processBuilderView";
 
@@ -39,10 +61,11 @@ public class ProcessBuilderView extends ViewPart {
        // LogFactory.getLog(ProcessBuilderView.class);
 
        private TableViewer viewer;
-
        private List<RealizedFlow> realizedFlows = new ArrayList<RealizedFlow>();
-
        private String currentAgentUuid = null;
+
+       // IoC
+       private OxmInterface oxmBean;
        private ProcessController processController;
 
        public void createPartControl(Composite parent) {
@@ -50,9 +73,12 @@ public class ProcessBuilderView extends ViewPart {
                viewer = new TableViewer(table);
                viewer.setLabelProvider(new ViewLabelProvider());
                viewer.setContentProvider(new ViewContentProvider());
+               viewer.addSelectionChangedListener(new SelectionChangedListener());
+
                int operations = DND.DROP_COPY | DND.DROP_MOVE;
                Transfer[] tt = new Transfer[] { TextTransfer.getInstance() };
                viewer.addDropSupport(operations, tt, new ViewDropListener(viewer));
+
                viewer.setInput(getViewSite());
        }
 
@@ -88,7 +114,6 @@ public class ProcessBuilderView extends ViewPart {
                SlcExecution slcExecution = new SlcExecution();
                slcExecution.setUuid(UUID.randomUUID().toString());
                slcExecution.setRealizedFlows(realizedFlows);
-
                processController.execute(agent, slcExecution);
        }
 
@@ -96,10 +121,14 @@ public class ProcessBuilderView extends ViewPart {
                viewer.getControl().setFocus();
        }
 
-       public void setProcessController(ProcessController processController) {
-               this.processController = processController;
+       // update one of the parameter of a given RealizedFlow
+       public void updateParameter(int realizedFlowIndex, String paramName,
+                       Object value) {
+               RealizedFlow curRealizedFlow = realizedFlows.get(realizedFlowIndex);
+               curRealizedFlow.getFlowDescriptor().getValues().put(paramName, value);
        }
 
+       // Specific Providers for the current view.
        protected class ViewContentProvider implements IStructuredContentProvider {
                public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
                }
@@ -131,6 +160,80 @@ public class ProcessBuilderView extends ViewPart {
 
        }
 
+       // Handle Events
+       class SelectionChangedListener implements ISelectionChangedListener {
+               public void selectionChanged(SelectionChangedEvent evt) {
+
+                       IStructuredSelection curSelection = (IStructuredSelection) evt
+                                       .getSelection();
+                       Object obj = curSelection.getFirstElement();
+
+                       if (obj instanceof RealizedFlow) {
+                               RealizedFlow rf = (RealizedFlow) obj;
+
+                               IWorkbench iw = ClientUiPlugin.getDefault().getWorkbench();
+                               IHandlerService handlerService = (IHandlerService) iw
+                                               .getService(IHandlerService.class);
+
+                               // TODO :
+                               // WARNING :
+                               // when marshalling an ExecutionFlowDescriptor, the Execution
+                               // Spec is set correctly,
+                               // but
+                               // when marshalling directly a realized flow, paramters are
+                               // stored under ExecutionFlowDescriptor.values
+                               String result = oxmBean.marshal(rf);
+
+                               // Passing parameters to the command
+                               try {
+                                       // get the command from plugin.xml
+                                       IWorkbenchWindow window = iw.getActiveWorkbenchWindow();
+                                       ICommandService cmdService = (ICommandService) window
+                                                       .getService(ICommandService.class);
+                                       Command cmd = cmdService
+                                                       .getCommand("org.argeo.slc.client.ui.editRealizedFlowDetails");
+
+                                       ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
+
+                                       IParameter iparam;
+                                       Parameterization params;
+
+                                       // The current index to be able to records changes on
+                                       // parameters
+                                       iparam = cmd
+                                                       .getParameter("org.argeo.slc.client.commands.realizedFlowIndex");
+                                       params = new Parameterization(iparam, (new Integer(
+                                                       realizedFlows.indexOf(rf))).toString());
+
+                                       parameters.add(params);
+
+                                       // The current Realized flow marshalled as XML
+                                       // See warning above
+                                       iparam = cmd
+                                                       .getParameter("org.argeo.slc.client.commands.realizedFlowAsXml");
+                                       params = new Parameterization(iparam, result);
+                                       parameters.add(params);
+
+                                       // build the parameterized command
+                                       ParameterizedCommand pc = new ParameterizedCommand(cmd,
+                                                       parameters.toArray(new Parameterization[parameters
+                                                                       .size()]));
+
+                                       // execute the command
+                                       handlerService = (IHandlerService) window
+                                                       .getService(IHandlerService.class);
+                                       handlerService.executeCommand(pc, null);
+
+                               } catch (Exception e) {
+                                       e.printStackTrace();
+                                       throw new SlcException("Problem while rendering result. "
+                                                       + e.getMessage());
+                               }
+                       }
+               }
+       }
+
+       // Implementation of the Drop Listener
        protected class ViewDropListener extends ViewerDropAdapter {
 
                public ViewDropListener(Viewer viewer) {
@@ -139,14 +242,16 @@ public class ProcessBuilderView extends ViewPart {
 
                @Override
                public boolean performDrop(Object data) {
-                       System.out.println(data);
+
                        Properties props = new Properties();
+
+                       // TODO : Handle wrong type of dropped data
                        ByteArrayInputStream in = new ByteArrayInputStream(data.toString()
                                        .getBytes());
                        try {
                                props.load(in);
                        } catch (IOException e) {
-                               throw new SlcException("Cannot create read realized flow", e);
+                               throw new SlcException("Cannot create read flow node", e);
                        } finally {
                                IOUtils.closeQuietly(in);
                        }
@@ -167,14 +272,6 @@ public class ProcessBuilderView extends ViewPart {
                        RealizedFlow rf = realizedFlowFromProperties(props);
                        realizedFlows.add(rf);
 
-                       // Map<String, Object> descriptors = rf.getFlowDescriptor()
-                       // .getValues();
-                       // if (descriptors != null && descriptors.size() > 0 ){
-                       // for (String key : descriptors.keySet()) {
-                       // System.out.println("[" + key + "] "
-                       // + descriptors.get(key).toString());
-                       // }}
-
                        getViewer().refresh();
                        return true;
                }
@@ -183,6 +280,22 @@ public class ProcessBuilderView extends ViewPart {
                        RealizedFlow rf = new RealizedFlow();
                        rf.setModuleName(props.getProperty("moduleName"));
                        rf.setModuleVersion(props.getProperty("moduleVersion"));
+                       String fdXml = props.getProperty("FlowDescriptorAsXml");
+                       if (fdXml != null) {
+                               Object o = oxmBean.unmarshal(fdXml);
+                               if (o instanceof ExecutionFlowDescriptor) {
+                                       rf.setFlowDescriptor((ExecutionFlowDescriptor) o);
+                                       System.out.println("instance of EFD !!!"
+                                                       + rf.getFlowDescriptor().toString());
+                                       System.out.println(rf.getFlowDescriptor()
+                                                       .getExecutionSpec());
+                                       return rf;
+                               }
+                       }
+                       // Else
+                       System.out
+                                       .println("***** WARNING : we should not be here; corresponding flow name"
+                                                       + props.getProperty("flowName"));
                        ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor();
                        efd.setName(props.getProperty("flowName"));
                        rf.setFlowDescriptor(efd);
@@ -193,9 +306,16 @@ public class ProcessBuilderView extends ViewPart {
                public boolean validateDrop(Object target, int operation,
                                TransferData transferType) {
                        return true;
-
                }
+       }
+
+       // IoC
+       public void setOxmBean(OxmInterface oxmBean) {
+               this.oxmBean = oxmBean;
+       }
 
+       public void setProcessController(ProcessController processController) {
+               this.processController = processController;
        }
 
 }
index 9cff1f6df696941773e8dc7739de48e226ce3653..4fabec13581bd3425b54f877039ecb271a4e8307 100644 (file)
@@ -2,7 +2,13 @@ package org.argeo.slc.client.ui.views;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
+import org.argeo.slc.client.ui.ClientUiPlugin;
+import org.argeo.slc.client.ui.providers.ProcessParametersEditingSupport;
+import org.argeo.slc.core.execution.PrimitiveAccessor;
+import org.argeo.slc.execution.ExecutionSpecAttribute;
+import org.argeo.slc.process.RealizedFlow;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.LabelProvider;
@@ -15,21 +21,51 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.ui.part.ViewPart;
 
+/**
+ * 
+ * @author bsinou
+ * 
+ *         This view, directly linked with the <code> ProcessBuilderView </code>
+ *         enables the display and editing the parameters of a given process.
+ * 
+ *         Note that for now we use <code>ExecutionFlowDescriptor.values</code>
+ *         attribute to recall (and update ??) the various parameters.
+ */
 public class ProcessParametersView extends ViewPart {
        public static final String ID = "org.argeo.slc.client.ui.processParametersView";
 
-       private TableViewer viewer;
+       // class attribute
+       private Map<String, ExecutionSpecAttribute> parameters;
+       private RealizedFlow curRealizedFlow;
+
+       // we should be using executionspecAttribute but for now we uses values.
+       private Map<String, Object> values;
+
+       // We must keep a reference to the current EditingSupport so that we can
+       // update the index of the process being updated
+       ProcessParametersEditingSupport ppEditingSupport;
 
-       private List<String[]> parameters = new ArrayList<String[]>();
+       // view attributes
+       private TableViewer viewer;
 
        public void createPartControl(Composite parent) {
                viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
                                | SWT.V_SCROLL | SWT.FULL_SELECTION);
                createColumns(viewer);
 
+               // WARNING
+               // for the moment being, we support only one process builder at a time 
+               // we set the corresponding view in the editor here.
+               ProcessBuilderView pbView = (ProcessBuilderView) ClientUiPlugin
+                               .getDefault().getWorkbench().getActiveWorkbenchWindow()
+                               .getActivePage().findView(ProcessBuilderView.ID);
+               ppEditingSupport.setCurrentProcessBuilderView(pbView);
+               
                viewer.setLabelProvider(new ViewLabelProvider());
                viewer.setContentProvider(new ViewContentProvider());
                viewer.setInput(getViewSite());
+               
+               
        }
 
        // This will create the columns for the table
@@ -44,17 +80,53 @@ public class ProcessParametersView extends ViewPart {
                        column.getColumn().setWidth(bounds[i]);
                        column.getColumn().setResizable(true);
                        column.getColumn().setMoveable(true);
+                       if (i == 1) {
+                               // we create the used EditingSupport and enable editing support
+                               // for value Column
+                               ppEditingSupport = new ProcessParametersEditingSupport(viewer,
+                                               i);
+                               column.setEditingSupport(ppEditingSupport);
+                       }
                }
                Table table = viewer.getTable();
                table.setHeaderVisible(true);
                table.setLinesVisible(true);
+               
        }
 
        public void setFocus() {
                viewer.getControl().setFocus();
        }
 
-       // Inner Classes
+       // save and update a field when it looses the focus
+       // TODO implement this method.
+
+       // set class attributes, refresh the lists of process paramaters to edit.
+       public void setRealizedFlow(int index, RealizedFlow rf) {
+
+               // this.processIndex = index;
+               ppEditingSupport.setCurrentProcessIndex(index);
+               curRealizedFlow = rf;
+
+               // TODO :
+               // We should handle ExecutionSpec here. need to be improved.
+               // ExecutionSpec es = rf.getExecutionSpec();
+               // if (es != null && es.getAttributes() != null)
+               // parameters = es.getAttributes();
+               // if (parameters != null)
+               // viewer.setInput(parameters);
+
+               values = rf.getFlowDescriptor().getValues();
+               if (values != null)
+                       viewer.setInput(values);
+               else
+                       // No parameters to edit, we reset the view.
+                       viewer.setInput(null);
+
+       }
+
+       // Inner Classes we should use ExecutionSpecAttribute instead of values
+       // see below
        protected class ViewContentProvider implements IStructuredContentProvider {
                public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
                }
@@ -62,16 +134,49 @@ public class ProcessParametersView extends ViewPart {
                public void dispose() {
                }
 
+               @SuppressWarnings("unchecked")
+               // we cast the Map<String, Object> to List<Object>
                public Object[] getElements(Object obj) {
-                       return parameters.toArray();
+
+                       if (obj instanceof Map && ((Map) obj).size() != 0) {
+                               List<ObjectWithName> list = new ArrayList<ObjectWithName>();
+                               Map<String, Object> map = (Map<String, Object>) obj;
+                               for (String key : map.keySet()) {
+                                       list.add(new ObjectWithName(key, map.get(key)));
+                               }
+                               return list.toArray();
+                       } else {
+                               return new Object[0];
+                       }
                }
        }
 
        protected class ViewLabelProvider extends LabelProvider implements
                        ITableLabelProvider {
+
                public String getColumnText(Object obj, int index) {
-                       String[] param = (String[]) obj;
-                       return param[index];
+                       // NOTE : the passed object is a line of the table !!!
+
+                       if (obj instanceof ObjectWithName) {
+                               ObjectWithName own = (ObjectWithName) obj;
+                               switch (index) {
+                               case 0:
+                                       return own.name;
+                               case 1:
+                                       if (own.obj instanceof PrimitiveAccessor) {
+                                               PrimitiveAccessor pa = (PrimitiveAccessor) own.obj;
+                                               if ("string".equals(pa.getType()))
+                                                       return (String) pa.getValue();
+                                               else
+                                                       return "Type " + pa.getType()
+                                                                       + " not yet supported";
+                                       } else
+                                               return own.obj.toString();
+                               default:
+                                       return getText(obj);
+                               }
+                       } else
+                               return getText(obj);
                }
 
                public Image getColumnImage(Object obj, int index) {
@@ -79,4 +184,84 @@ public class ProcessParametersView extends ViewPart {
                }
 
        }
+
+       // We add an inner class to enrich the ExecutionSpecAttribute with a name
+       // so that we can display it.
+       public class ObjectWithName {
+               public Object obj;
+               public String name;
+
+               public ObjectWithName(String name, Object obj) {
+                       this.name = name;
+                       this.obj = obj;
+               }
+
+       }
+
+       // protected class ViewContentProvider implements IStructuredContentProvider
+       // {
+       // public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
+       // }
+       //
+       // public void dispose() {
+       // }
+       //
+       // // we cast the Map<String, ExecutionSpecAttribute> to List<Object>
+       // public Object[] getElements(Object obj) {
+       // if (obj instanceof Map && ((Map) obj).size() != 0) {
+       // List<ExecutionSpecAttributeWithName> list = new
+       // ArrayList<ExecutionSpecAttributeWithName>();
+       // Map<String, ExecutionSpecAttribute> map = (Map<String,
+       // ExecutionSpecAttribute>) obj;
+       // for (String key : map.keySet()) {
+       // list.add(new ExecutionSpecAttributeWithName(key, map
+       // .get(key)));
+       // }
+       // return list.toArray();
+       // } else {
+       // return new Object[0];
+       // }
+       // }
+       // }
+       //
+       // protected class ViewLabelProvider extends LabelProvider implements
+       // ITableLabelProvider {
+       //
+       // public String getColumnText(Object obj, int index) {
+       // // NOTE : the passed object is a line of the table !!!
+       //
+       // if (obj instanceof ExecutionSpecAttributeWithName) {
+       // ExecutionSpecAttributeWithName esaw = (ExecutionSpecAttributeWithName)
+       // obj;
+       // switch (index) {
+       // case 0:
+       // return esaw.name;
+       // case 1:
+       // return esaw.esa.getValue().toString();
+       // default:
+       // return getText(obj);
+       // }
+       // } else
+       // return getText(obj);
+       // }
+       //
+       // public Image getColumnImage(Object obj, int index) {
+       // return null;
+       // }
+       //
+       // }
+       //
+       // // We add an inner class to enrich the ExecutionSpecAttribute with a name
+       // // so that we can display it.
+       // private class ExecutionSpecAttributeWithName {
+       // public ExecutionSpecAttribute esa;
+       // public String name;
+       //
+       // public ExecutionSpecAttributeWithName(String name,
+       // ExecutionSpecAttribute esa) {
+       // this.name = name;
+       // this.esa = esa;
+       // }
+
+       // }
 }
index 575886d9a09a10d6984b55eecf35deb74a5d0eab..d9a3e66574903db85a9e2f93fab95756b42e76d3 100644 (file)
@@ -19,6 +19,18 @@ package org.argeo.slc.execution;
 import java.io.Serializable;
 import java.util.Map;
 
+/**
+ * 
+ * @author bsinou
+ * 
+ *         This class implements the archetype of a given process.
+ * 
+ *         WARNING : for now both <code>values</code> and
+ *         <code>executionSpec</code> which are rundundant are used. Should be
+ *         improved in further version. Note also that a third redundant field,
+ *         <code>RealizedFlow.executionSpec</code> is also to be cleaned.
+ * 
+ */
 public class ExecutionFlowDescriptor implements Serializable {
        private static final long serialVersionUID = 7101944857038041216L;
        private String name;
index ab4de4fd35c094620e77d611e0e99ed8696699bc..899b76f9630a56b909c82fdbb27f365f699134d5 100644 (file)
@@ -18,10 +18,16 @@ package org.argeo.slc.execution;
 
 import java.util.Map;
 
+/**
+ * The class implementing this interface defines the map of attributes that are
+ * necessary for the corresponding ExecutionFlow.
+ * 
+ * @author bsinou
+ */
 public interface ExecutionSpec {
        public Map<String, ExecutionSpecAttribute> getAttributes();
 
        public String getName();
-       
+
        public String getDescription();
 }
index 235171b1de1bbaa14258233fb83fcf5e75c52c57..22d981f4412616d3cc0a69ae8feca2002370f7e8 100644 (file)
 
 package org.argeo.slc.execution;
 
+/**
+ * 
+ * This interface stands for one attribute of a given flow.
+ * 
+ * We mainly have two implementations :
+ * 
+ * + Primitive attributes (no predefined choice, the end user must compute a
+ * String, a Float, an Integer...)
+ * 
+ * + RefSpecAttribute which enable two things + a reference to another object of
+ * the application context + the display of some choices among which the end
+ * user can choose.
+ * 
+ * Note :
+ * 
+ * @see org.argeo.slc.core.execution.PrimitiveUtils : this class offers some
+ *      helper, among others to cast the various type of primitive attribute.
+ * 
+ * @author bsinou
+ * 
+ */
 public interface ExecutionSpecAttribute {
        public Object getValue();
 
index 91eb5425427d30a7a8edb161614ecb72c48bf44c..2869684f89263323647117bc4e7c64669e53400d 100644 (file)
@@ -38,8 +38,8 @@ public class RealizedFlow implements Serializable {
        public void setModuleName(String moduleName) {
                this.moduleName = moduleName;
        }
-       
-       public NameVersion getModuleNameVersion(){
+
+       public NameVersion getModuleNameVersion() {
                return new BasicNameVersion(getModuleName(), getModuleVersion());
        }
 
@@ -66,5 +66,4 @@ public class RealizedFlow implements Serializable {
        public void setExecutionSpec(ExecutionSpec executionSpec) {
                this.executionSpec = executionSpec;
        }
-
 }