0 Replies Latest reply on Apr 22, 2008 2:40 AM by marcs

    adding default Action to Node

    marcs

      Hi,

      I'm developing a workflow for datamining application. Therefore I need to create my own nodes. These own nodes are no fancy new nodes, they basically extend the jbpm node with a default action.

      What I did so far:
      - extended the GPD to work with my own nodes
      - extended my own node from the jbpm node and adapted the constructor

      Adding nodes in the GPD works! But XML is not generated right.

      What I get:

      <node name="node1">
       <action></action>
      </node>


      What I expect:
      <node name="node1">
       <action class="MyAction"></action>
      </node>


      Properly there is something wrong with my code.

      public class MyNode extends Node {
      
       public MyNode() {
       Action action = new Action();
       action.setAcceptPropagatedEvents("true");
       action.setAsync("false");
       action.setConfigType("field");
       ImageDescriptor imageDescriptor = ImageDescriptor.createFromFile(null,
       "/icons/full/obj16/action_enabled.gif");
       action.setIconDescriptor(imageDescriptor);
       action.setElementId("org.jbpm.gd.jpdl.action");
       action.setLabel("Action");
       action.setNamePrefix("action");
       SemanticElementFactory factory = new SemanticElementFactory(
       "org.jbpm.gd.jpdl.editor");
       action.setFactory(factory);
      
       setAction(action);
      
       firePropertyChange("action", null, action);
       firePropertyChange("expression", null, null);
       firePropertyChange("className", null, null);
       firePropertyChange("configInfo", "", null);
       firePropertyChange("configType", "field", "field");
       firePropertyChange("className", null, "");
       firePropertyChange("expression", null, null);
       firePropertyChange("className", null, "MyActionClass");
       }
      ...
      }


      Is it actually doable? What am I doing wrong?

      Thanks,
      Marc