cancel
Showing results for 
Search instead for 
Did you mean: 

Java class to handle decision and sending mail

khinendra
Champ on-the-rise
Champ on-the-rise
Hi,

How can I use java classes to handle complex decisions, passing process level variables to java classes and send mail in jBPM workflows?

Thanks

Khinendra
2 REPLIES 2

cheffilet
Champ in-the-making
Champ in-the-making
I guess you´re looking for something like following, right?

<decision name="isokay">
        <handler class="com.company.ComplexDecisionHandler"/>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="approve">
</decision>  

Some example Java-Code comes here to getting started with more complex evaluations regarding the current workflow-state:


public class ComplexDecisionHandler implements org.jbpm.graph.node.DecisionHandler {
   public String decide(ExecutionContext executionContext) throws Exception {
     //conditions ….
     return "approve";
  }
}

The returned String belongs to the transition name which will be taken.

khinendra
Champ on-the-rise
Champ on-the-rise
Thanks
Exactly same.
But one thing more, how to pass process level variables to java classes.
Example is passing return value to process.


Regards,
Khinendra.