Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
How to send paramters to actionhandler when using JbpmHandlerProxy Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to send paramters to actionhandler when using JbpmHandlerProxy

    Before using spring-modules I have this type of code in the processdefinition:
    <action name="validate" class="com.handlers.MyActionHandler" config-type="bean">         	
    The parameters could be retrieved in the actionhandler.

    Now when I have started to use spring-modules for jbpm I canīt figure out how to add the parameters to get access to them in the actionhandler specified in the targetBean tag.
    I have this code in a processdefinition:
    <action name="validate" class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
    But this donīt work because the actionhandler isnīt the action class. Hopefully there is a way to solve it but I havenīt yet figured out how to specify the parameters and to make it possible to get access to them from the real actionhandler.

    Thanks in advance!


    I have found one solution for my problem but donīt know if it is the best. I inherited the JbpmHandlerProxy and put my extra attributes in that class. Then I can access them in this way from my handler:
    MyJbpmHandlerProxy proxy = (MyJbpmHandlerProxy) executionContext.getNode().getAction().getActionDelegation().getInstance();
    Last edited by 2nice; Apr 26th, 2007, 10:30 AM. Reason: Found a solution

  • #2
    I had the same issue, so thanks for your post. I liked the idea of extending the JbpmHandlerProxy but to make things easier I overrode the execute/assign method from jbpmHandlerProxy. I then set my properties directly on my real handler and then called the handler's assign or execute method.

    public class MyAssignment_Default_Proxy extends JbpmHandlerProxy {
    	String userName;
    	public String getUserName() {
    		return userName;
    	public void setUserName(String userName) {
    		this.userName = userName;
    	public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
                   //get the handler and cast it to my handler
    		MyAssignment_Default handler = (MyAssignment_Default) lookupBean(AssignmentHandler.class);
                    //set the userName property on my handler
                    //fire the assign method on my handler
    		handler.assign(assignable, executionContext);
    Set it in the process definition

          <assignment class="" config-type="bean">
            <userName>Buzz Terrier</userName>
    Not sure if this is the best way, but it works for me.