JBoss Community

Calling a Spring bean inside the JPDL

reply from Maciej Swiderski in jBPM - View the full discussion

You have two options if it comes to java activity:

1. provide on runtime an instance which shall be used to invoke defined method

 

  <java name="shake hand" expr="#{hand}" method="shake" var="hand">
    <transition to="wait" />
  </java>

this will result in following code being executed: #{hand.shake()}

 

2. provide a class and method to be invoked that accepts argument given on runtime

 

  <java name="shake \class="my.class.name" hand" method="shake" var="hand">   
    <arg><object expr="#{hand}"/></arg>
    <transition to="wait" />
  </java>

this will result in execution of my.class.name.shake(MyObject hand).

 

For more details about java activity plase take a look at user guide.

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM at Community