4 Replies Latest reply on Aug 18, 2011 8:44 AM by fernando.ney

    Prioritization of process instances

    fernando.ney

      Hi,    
           We have a project where we need a BPM engine but we have 2 characteristics that need be supported. To illustrate consider a process with the following definition: Process1: Activity1 -> Activity2 -> Activity3 -> Activity4.

      1 - We need to prioritize some instances of the process. For example, imagine that we have 1000 instances but five of these instances have a higher priority, therefore, the activities of these instances should be executed first.


      2 - Some types of activities should not have more than a maximum number of executions in parallel. For example, the Activity2 should have a maximum of 3 instances running at the same time ant Activity3 a maximum of 25. This restriction is necessary because our application is OLTP and some types of activities cause a huge load on the database.

       

           jBPM supports these features? Is there any workaround to meet these requirements? You have any suggestions on how to implement this in jBPM?

       

           We have a team with a lot of experience developing high performance Java applications, but we don't have enough experience with jBPM, our goal is to share with the community a solution that meets these requirements.

        • 1. Re: Prioritization of process instances
          salaboy21

          Hi Fernando,

          I think that you can meet those requirements with jBPM5 but as you may notice we are using the BPMN 2.0 modeling notation to define our processes and activities and its important for you to define which type of activities you are planning to run in parallel. Are all automated activities? are all asynchrnous activities? are all blocks of code that needs to be executed by the process itself? if you can elaborate on that we can guide you on the implementation.

          Cheers

          • 2. Re: Prioritization of process instances
            fernando.ney

            Hi Mauricio,   

            All activities are automated.

            Almost all activities are asynchronous, especially those that meeting the first requirement.

            The types of activities we are planning to execute are all 'Service Tasks'. Some examples of these tasks will be transfer files via FTP, compress/expand files, batch processing (insert/delete/update rows in database), etc.

             

            The processes are mostly simple, but we can have a big number of them in a short period, as example of a simple process:

            Wait a file.

            Transfer a file. (This activity may be limited so as not to exhaust the network resources)

            Uncompress the file.

            Do some type of transformation in the content of the file. (This activity may be limited so as not to exhaust the CPU resources)

            Batch insert the file content into the database. (This activity may be limited so as not to exhaust the database resources)

             

            I didn't understand what you mean by 'are all blocks of code that needs to be executed by the process itself?'.

            • 3. Re: Prioritization of process instances
              salaboy21

              Hi Fernando,

              Sorry for the delay in the response, I have tons of work to do right now.

              Based on your description I can say that looks like more a camel route (http://camel.apache.org/) than a business process. Of course that you can model the situation that you mention with jBPM5, but probably you shoudl also analyze Camel in order to acomplish things like: Wait for a File, Transfer a File to an FTP server, etc.

              Cheers

              • 4. Re: Prioritization of process instances
                fernando.ney

                Mauricio,

                     Thanks for the indication of the camel route, but in our case we need several features of a workflow system.

                   

                     Although you have mentioned that our requirements can be modeled with jBPM5 I have doubts on how to do such things.

                        

                     For the requirement 2 (maximum number of executions in parallel by activity type) we guess in create a intermediate priority queue (a JMS queue, a table, etc) for each different type of activity we need to limit (in this case the activity of the jBPM just put a 'task' in this queue). For each queue we would have a thread pool where we could do the necessary settings (ex: maximum number of threads).

                     What do you think of this solution?

                   

                     Regarding requirement 1, we don't have a workaround for this, since we no found a way to prioritize a particular instance of a process without a non-intrusive change in the code of jBPM.

                     Do you know how to model this with jBPM5?