[jboss-user] [jBPM] New message: "Re: getting name of leaving transition from decision node (jbpm 4.0)"

Maciej Swiderski do-not-reply at jboss.com
Thu Mar 4 04:50:07 EST 2010


User development,

A new message was posted in the thread "getting name of leaving transition from decision node (jbpm 4.0)":

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

Author  : Maciej Swiderski
Profile : http://community.jboss.org/people/swiderski.maciej

Message:
--------------------------------------------------------------
I completely understand your goals but I think it can be achieved differently than querying for outgoing transition of a given node. Since you have to modify the diagram I would try something like this:
 
Add event listener to the start node on event end that will set required variables:
<on event="end">
    <event-listener class="com.company.process.StartupEventListener">
          <field name="taskOptionsAsVariable"><string value="selected,rejected"/></field>
    </event-listener>
</on>

 
Create class for that event listener:
public class StartupEventListener implements EventListener {
 
  private String taskOptionsAsVariable; 
  
  @Override
  public void notify(EventListenerExecution execution) throws Exception {
    
    if (taskOptionsAsVariable != null) {
      String[] options = taskOptionsAsVariable.split(",");
     
      execution.createVariable("selectionOptions", Arrays.asList(options));
     
    }
    
  }
 
}

Since there is no support (afaik) for collections and arrays use comma separated values for possible options to choose in the task form later in the process - same as outgoing transitions for decision point.
 
So after first release you don't need to change anything in the code, just the diagram.
 
Hope that can give you an alternative.
 
Cheers,
Maciej

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

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




More information about the jboss-user mailing list