1 Reply Latest reply on Mar 3, 2007 7:47 AM by Narasimha Addanki

    Transaction Management sync between JBPM and Application

    Narasimha Addanki Newbie

      Hi All,

      In our project, JBPM is used to drive the Status of Users while creating as users creation has many stages before a user status become live and one user status is independent of the another user.

      We have defined a processdefinition for Users Creation like one process instance represents a single user.

      Users creation workflow is provided with the status driving attributes by the application, then workflow determines the status of the user and returns to the application to store that at application database.

      And the status of the user should also be maintained in the JBPM repository for driving the user status for future updations and for the retrieval to list the users based on the status they are in. A transaction is being maintained between JBPM updation and application database commit operations by handling "context close " facility to the application.

      Its working pretty fine with one user creation at a time. At the time of bulk user creation, the application still make a method call iteratively and User creation workflow returning the status value but couldn't save the instance for the user as the "context close" is handled by the application and which will be called only on the successful dataupdation at application db. But the aplication is able to push the bulk user's data in to the database using spring hibernate capabilities and then JBPM context is being closed. By this we could make the last user's details (in the list ) only persisted in the JBPM database.

      And the requirement is to have ALL the user's creation either successfull (commit) or unsuccessful (rollback)

      Can we maintain the user's details(along with the evaluated status) ie processinstance temporary at a list or at any other place and save all the instances at a time once the application indicates the successful updation of its database

      can you share your thoughts on this...

      Regards
      Narasimha

        • 1. Re: Transaction Management sync between JBPM and Application
          Narasimha Addanki Newbie

          To cater the bussiness requirement am creating those many Context Instances as many number of users are being created at the application level.

          The Process is executed for every individual user at JBPM iteratively and the context that was opened, process instance id and user status are stored in a collections object. This object is passed to the application for reading the status of the user and pushing the value objects in to the DB. Once the data placing in to application db is successful then application sends the collections object which only contains the context instances' list and process instances' list.

          Comit operations is made into a transaction by saving and closing the jbpm context in the same order in which they were created.

          And need to be ready with the delete operations if any exception happend at mid of the closing jbpm context operations

          Please provide some value addition for the approach by providing your thoughts