4 Replies Latest reply on Jul 27, 2013 3:08 PM by Rajesh P

    can we implement custom statuses in jBPM 5.4 like approved at 1st level

    Rajesh P Newbie

      Hi,

      I am trying to lear jBPM from last 3 months. Still I feel I am new bie to it.

       

      I am using jBPM 5.4 with spring 3.0 MVC and Hibernate 3.0. I followed the configuration mentioned in the below source code link.

      https://github.com/mswiderski/jbpm-examples/tree/master/jbpm-spring-web

       

      I have few queries in the implementation what I did till now.

      1) Can we have only one ksession for entire application?

           It is in the memory till application server/web server stops. Since ksession is having references to all the process in the kbase does it take more memory?Please correct me if my understand is wrong.

      2) Can we implement custom statuses in jBPM?

           Lets have a workflow process has 2 level of approval. After 1st level approval, can we store the status as 1st level approved in jBPM.

      is it possible? Correct if I am wrong. Like this can we implement or store custom statuses?.

       

      Thanks in Advance..

      Rajesh.

        • 1. Re: can we implement custom statuses in jBPM 5.4 like approved at 1st level
          Ashish T Newbie

          Statuses are business data and should be stored in business related tables.  In yor tables you can store the statues and use them as per requirement.

          Let me know if you are looking for something else?

          • 2. Re: can we implement custom statuses in jBPM 5.4 like approved at 1st level
            Maciej Swiderski Master

            Rajesh P wrote:

             

            1) Can we have only one ksession for entire application?

                 It is in the memory till application server/web server stops. Since ksession is having references to all the process in the kbase does it take more memory?Please correct me if my understand is wrong.

            You can have as many ksessions as you need in your application. There are several strategies that might be used where one and most simple one is singleton - just one session for the application.

            When using persistence for your processes then process instances will be only in memory when they are actually executing - that means when process is in wait state like user task or waiting for external signal then it is not kept in memory but only in db.

             

            2) Can we implement custom statuses in jBPM?

                 Lets have a workflow process has 2 level of approval. After 1st level approval, can we store the status as 1st level approved in jBPM.

            is it possible? Correct if I am wrong. Like this can we implement or store custom statuses?.

            based on what you described you should model those states as activities in the process where first level of approval is one activity (user task) and then second level is another activity (user task). You can see it like state machine where every node represent a state so that way you have the most flexibility.

             

            HTH

            • 3. Re: can we implement custom statuses in jBPM 5.4 like approved at 1st level
              Rajesh P Newbie

              Thanks Ashish for your reply.

              As you suggested I can store those statuses in my custom tables.

              Actually my requirement is, If I add one more approval level then with out changing any java code the application should work. So I want to implement custom statuses.

              Now,to achieve this, I have taken one process variable as Status and changing that value at every node. And reading at java code and storing in custom tables.

              is it good approach?

               

              Thanks,

              Rajesh.

              • 4. Re: can we implement custom statuses in jBPM 5.4 like approved at 1st level
                Rajesh P Newbie

                Thanks  Maciej for your response.

                Now I have modeled the work flow as you suggested. Please find the attached model.

                I am not clear second point, I mean, with that how can we have custom status?

                 

                one more query Maciej, in general work flow, we need to notify users via mail.

                Please suggest me the best approach for this. In the attached model, I am forming email list in java code and passing email list as a process variable to jBPM.

                So it seems, I am not automating my workflow process.

                Actually my requirement is, if I add one more approval in the existing work flow, I should not change the java code.

                 

                Please suggest me on this.

                 

                Thanks in Advance.

                 

                Rajesh.