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
Spring jBPM - Task Assignment Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring jBPM - Task Assignment

    Has anyone gotten task assignment to work with spring-jbpm? When I call my task assignment handler a record shows up in the database. However the only data it has is the id and name. There's nothing for actor id or create date. When I don't use spring jBPM these get populated with my same assignment handler. If anyone can point out what I'm doing wrong, I'd appreciate it.

    Here's my handler:

    public class TestTaskAssignmentHandler implements AssignmentHandler {

    private static final long serialVersionUID = 1L;

    public void assign(Assignable assignable, ExecutionContext executionContext)


    And here's my process:

    <?xml version="1.0" encoding="UTF-8"?>

    name="test task">
    <start-state name="start">
    <transition name="begin" to="task"></transition>
    <task-node name="task">
    <task name="test">
    class="com.receller.bpm.TestTaskAssignmentHandler" />
    <transition name="task" to="end"/>
    <end-state name="end"></end-state>

  • #2
    AFAIK, rob has done an update to jBPM to spring modules about 2 days ago. Have you got the latest version? maybe it will help you with this problem.


    • #3
      From: [email protected]

      The code for the JBPM integration is now in the main Spring CVS in
      spring-projects/spring-jbpm. You should be able to configure the standard OSIV
      filter in Spring and then use the supplier JBPM classes you have JBPM use the
      Spring-supplied session.

      Be aware that this code is uber-early access and is basically a dump of my
      current prototype. I am on vacation next week for two weeks and full development
      will start on this again when I return.



      • #4
        Getting Spring Context with jBPM

        Thanks for letting me know about the new release. I'll take a look.

        On a related note, I would like to access my Spring beans from within my jBPM AssignmentHandler and custom Actions. I'm trying to figure out how I can get a handle to Spring's ApplicationContext. My first guess is that I can somehow get this through jBPM's ExecutionContext, but I'm not sure how. Maybe the new release documents this too, but I thought I'd throw it out there in case someone else has figure this out.



        • #5
          TaskAssginment Problem &amp; Passing ApplicationContext

          1. After getting the latest code from CVS, I still have the same problem as before with not all the data getting populated in the jbpm_taskinstance table when my AssignmentHandler is called through spring-jbpm.

          2. Figured out how to pass around the spring ApplicationContext. It always helps to read the docs . For those that are interested, you just need to pass it into the ContextInstance setTransientVariable method. I created my own version of signal() that looks like this:

          public void signal(long processId, ApplicationContext ctx)
          JbpmSession jbpmSession = sessionFactory.openJbpmSession();

          ProcessInstance process = jbpmSession.getGraphSession()
          ContextInstance context = process.getContextInstance();
          context.setTransientVariable("springCtx", ctx);
          jbpmSession.getGraphSession().saveProcessInstance( process);
          jbpmSession.getGraphSession().saveProcessInstance( process);

          I can then retrieve this from the EnvironmentContext in any of my custom jbpm handlers or actions.

          The signal method seemed to make the most sense, at least so far for me. I would think this would be a common situation for users of Spring and jBPM. Are there any plans to put something like this into spring-jbpm?


          • #6
            AFAIK Rob who's the maintainer, is on vacation. However you are free to submit code to the project or at least raise an issue on jira to make sure this topic is not forgotten.


            • #7

              I've been using spring-jbpm since Sep 15th and I haven't seen any new code checked in since then. I have a few suggestions for the current code. One suggestion is regarding access to the ApplicationContext inside of an AssignmentHandler or ActionHander.
              I would like to access my Spring beans from within my jBPM AssignmentHandler and custom Actions
              I came up with a proxy technique that gets you around this. And, yes I'd be glad to help with anything.


              • #8
                Steve please create issues on SM JIRA and if possible attach your code as patches as well.


                • #9
                  On the topic of ApplicationContext, Matt already created a feature request, it's just in the wrong place.

                  I posted a bug regarding jBPM DB Transaction Management.


                  • #10
                    I would like to know more about "signal" method implementation you suggested.
                    First, To call this "signal" method of bean "A" I need to invoke "getBean("A")" explicitly.
                    This call should be placed in the "Task Handler"? Or where?

                    Second, in the method itself you referred application context and process ID as arguments . What is this processId?

                    The name of the method has to be "signal"? Is it connected to ProcessInstance.signal()?

                    It would be helpful if you explained this with an example.



                    • #11
                      Steve, see this thread (in case you have missed my 'spam'). I've addressed both issues.