1 2 Previous Next 16 Replies Latest reply on Nov 20, 2008 10:39 AM by kukeltje

    threads with task and process with task

    arunachalamamsam

      hello all,

      1) i wanted to use multiple threads to be spawned and each one executing a particular task in jBPM workflow,
      a) how this can be done
      b) what is the maximum number of threads , which can be spawned

      2) if i wanted to use multiple processes to be spawned and each one executing a particular task in jBPM workflow,
      a) can this be done?
      a) how this can be done
      b) what is the maximum number of processes , which can be forked

      Please guide me in this,

      Thanks,
      Arunachalam

        • 1. Re: threads with task and process with task
          salaboy21

          Can you tell us your situation and your environments? because is a very open question.
          You can use forks and subprocess to do that.. there are no limitation.. but it depends on how much data you will use.

          • 2. Re: threads with task and process with task
            arunachalamamsam

            hi, thanks for the reply.

            actually i want to spawn multiple instances of (either process or threads, i dono which is better in jBPM) task, and each need to perform work (say for example , run an exe)


            u said, there is no limitation in forking many process,
            -- do i need to fork manually or i just need to configure or jBPM will do it for me?
            -- will it do java Run Time Process for forking, internally?
            -- "but it depends on how much data you will use." -> can u pls explain on this.

            Please guide / correct me in this regard.

            Thanks,
            Arunachalam.

            • 3. Re: threads with task and process with task
              arunachalamamsam

              multiple instances , i mean

              each task executing in a different process / thread

              Thanks

              • 4. Re: threads with task and process with task
                salaboy21

                In jBPM the concept of task is about human tasks, so running an .exe is like a system taks. So you can use a Node that execute that .exe and then use a fork to do it in parallel.
                You questions sounds like you are trying to do something with a heavy multi threading and not a business process.
                Can you explain your scenario?

                • 5. Re: threads with task and process with task
                  arunachalamamsam

                  my scenario:

                  On request (async) from GUI, workflow need to executed,
                  Workflow should should have different simultaneous flow , in which , each flow should do independent work (it may need to wait on conditions, optionally between them for sequential execution- (if needed))

                  For this case, i wanted first decide, can i use threads / process
                  And if decided, then i need to see how much threads / processes can be spawned / forked

                  please say me if i am not clear in the above explanation.

                  P.S: actually i am evaluating workflows , can ypu plz say , which workflow is better

                  thanks,
                  Arunachalam

                  • 6. Re: threads with task and process with task
                    salaboy21

                    I think if you need that involve real time executions and a heavy sinchronization you don't need to use jBPM. But if you only need to coordinate/orchestate some executions concurrently jBPM is for you.

                    I recommed you to take a look a the official documentation or to my blog (is in spanish, but you can translate it with translate.google.com) for examples.

                    only one question about your scenario: did you have human tasks involved?

                    • 7. Re: threads with task and process with task
                      arunachalamamsam

                      hi thanks , first of all,

                      actually human tasks u mean , like , approving a loan - some thing like that rt?

                      in my case, i need to do a copy (kind of backup in actual scenario) in the file
                      system

                      i will look into ur forum and get back to u

                      thanks again,
                      Arunachalam

                      • 8. Re: threads with task and process with task
                        salaboy21

                        That is ok...
                        I you need to backup something without someone interaction sounds like its an automated task. So you can do this with Nodes in jBPM.

                        Hope it helps. I will be waiting your nexts questions...

                        • 9. Re: threads with task and process with task
                          arunachalamamsam

                          thanks

                          • 10. Re: threads with task and process with task
                            arunachalamamsam

                            hi , me again,

                            in jBPM,

                            process instance (not system process) , here i understood as,a flow of workflow as per the process definition language

                            1) Can we have multiple process instances in a execution?

                            2) Can the process instances, can save the state of itself at any time?

                            3) Can the process instances be started and stopped during the execution?

                            4) Can the process Instances communicate with each other?

                            5) Can i have process instances in different threads and return the status to controlling thread?

                            Thanks,
                            Arunachalam

                            • 11. Re: threads with task and process with task
                              salaboy21

                              Answers:

                              1) Can we have multiple process instances in a execution?

                              yes, of course you can, is the most common situation
                              2) Can the process instances, can save the state of itself at any time?

                              you should look the concept of wait states (this is where the process saves automatically), but imagine that the process can be saved by transaction demarcation any time you want.
                              3) Can the process instances be started and stopped during the execution?

                              If you imagine something like pausing the process or wait for an external action, yes you can.
                              4) Can the process Instances communicate with each other?

                              This sounds strange, and in my experience is not the most common scenario. But you can have father/child relation ship with the process-state nodes. And there yes, the can comunicate each other.
                              5) Can i have process instances in different threads and return the status to controlling thread?

                              hmm... I try to understand why are you asking this.. but.. i think the answer of this question is yes. Because all the process run in diferent threads and then you can query them with the correspondent ID. But you should try to not think the process executions as a thread. Because there is no one to one relationship between this two concepts..


                              Hope it helps...


                              • 12. Re: threads with task and process with task
                                arunachalamamsam

                                thanks for all your nice replies. i will understand the same and get back to you.

                                one more question, can i copy the state of a process instance and give it to another flow (consider tht flow execution is in some other machine)

                                thanks again,
                                Arunachalam

                                • 13. Re: threads with task and process with task
                                  salaboy21

                                  The state of a process is manteined in the database, so if you have two clients that conect to de database, you can See in the two clients the same state.
                                  And if this is not your situation, you can copy the data of one process and try to adapt it in another database...

                                  • 14. Re: threads with task and process with task
                                    arunachalamamsam

                                    ya , i got, thanks again.

                                    1 2 Previous Next