1 Reply Latest reply on Feb 26, 2010 2:18 PM by Donald Walters

    Custom Activity

    Donald Walters Newbie

      I have a class that contains a Map of properties that are needed in order to perform some function.

       

      I am extending ActivityBehaviour but I do not know how to defined this in the xml and also how to use these in the custom action.

       

      I cannot create explicit instance variables because these properties should be dynamic, hence, the use of the Map.

       

      Please let me know how to move forward with this.

        • 1. Re: Custom Activity
          Donald Walters Newbie

          <custom name="print dots" class="com.test.process.Prompt">

                  <property name="properties">

                      <object  class="java.util.HashMap">

                          <map>

                              <entry>

                                  <key>

                                      <string value="testprop" />

                                  </key>

                                  <value>

                                      <string value="test" />

                                  </value>

                              </entry>

                          </map>

                      </object>

                  </property>

                  <transition to="end" />

              </custom>

           

          public class Prompt implements ActivityBehaviour{

           

              HashMap properties = new HashMap();

           

              public void execute(ActivityExecution ae) throws Exception {

                  System.out.println(properties.get("testprop")+"------>");

              }

           

              public HashMap getProperties() {

                  return properties;

              }

           

              public void setProperties(HashMap properties) {

                  this.properties = properties;

              }

           

          }