[jboss-user] [jBPM] New message: "New Instance and Setters : All in one task"

ciccio ciccio do-not-reply at jboss.com
Mon Feb 15 12:18:55 EST 2010


User development,

A new message was posted in the thread "New Instance and Setters : All in one task":

http://community.jboss.org/message/526427#526427

Author  : ciccio ciccio
Profile : http://community.jboss.org/people/ciccioVega

Message:
--------------------------------------------------------------
Hi guys,
I'm using jBPM 4.3.
I instantiate an object using a factory and then I need to set its properties and pass it as an argument to another method. The problem is that i can do this in 2 steps:
 
I Get the class instance with:
<java class="jbpm.demo.MyClassFactory" method="getMyClass" name="init" var="myInstance">
          <arg>
               <string value="MyClassName"/>
          </arg>
      <transition name="to execute" to="execute"/>
</java>

 
and then I set the properties and call the method with:
 
<custom class="jbpm.demo.Executor" name="execute">
          <field name ="classToExecute">
               <object expr="#{myInstance}">
                    <property name="name"><string value="John Smith"/></property>
                    <property name="City"><string value="New York"/></property>
               </object>
          </field>
          <transition name="to end" to="end"/>
</custom >

 
I'd like to merge <java> and <custom> task in one step, but i don't know if it's possible and how to.
<object class="..."> is not possible to use because I instantiate the class with reflection and the class name can differ from case to case.
Any suggestions?
Thanks in advance.

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/526427#526427




More information about the jboss-user mailing list