5 Replies Latest reply on Jul 16, 2007 3:19 PM by kukeltje

    deep copy of a process Instance

    mee

      hello

      how can you perform a deep copy of a ProcessInstance (with all its variables)?
      I could not find any hint so do so in a simple manner in the jbpm api.
      I just found http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3922034#3922034 where someone thought about deep copies in jbpm.

      In my opinion it should be possible to deep copy a finished process instance, set the token to its start and run the new process instance.

        • 1. Re: deep copy of a process Instance
          kukeltje

          run the processinstance again WITH the already available data? What is the usecase for this?

          • 2. Re: deep copy of a process Instance
            mee

            Hi Ronald

            we implement the installation of software by jbpm on multiple stages.

            First the User defines which installation workflows (and subworkflows) he wants to be executed.
            According to the selected workflows he has to define the required installation attributes which will be made persistent in the process instance.
            Then we execute the workflow on multiple stages (development, Production, ...)
            In order that the user does not allways have to fill in similar data, we want to store and load allready executed ProcessInstances.

            Therefore we wanted to deep copy a ProcessInstance, change some simple attributes and execute it again.

            But questioning deep copies might be a good idea.

            So I as a rookie I see two possibilities:
            a) deepcopy of ProcessInstance
            - ProcessInstances of subworkflows should be included
            - copy the variables
            (Cool if JBpm would support this ...)
            b) create new ProcessInstances programmaticially
            - copy the variables

            In my opinion there is a need to execute an allready executed Workflow again. But without modifying the original Workflow.

            Do you have another hint to solve such a requirement?

            Thanks,
            Andrea

            • 3. Re: deep copy of a process Instance
              kukeltje

              If it can change over time without the need for a new version of the process, I would just store this bootstrapping data externally (e.g. DB) and set it when starting the process. Much easier imo

              • 4. Re: deep copy of a process Instance
                mee

                But is it possible to execute an allready executed (dynamic) Workflow composition again, without modifying the original ProcessInstance?

                Somehow it should be possible to reproduce a Process Excecution.

                Thanks,
                Andrea

                • 5. Re: deep copy of a process Instance
                  kukeltje

                  just put the token in the startnode... very simple with the api and mark the process as not-ended (also possible with the api) but what about tasks already carried out...etc...etc..etc... somehow replaying processinstances does not feel right