5 Replies Latest reply on Oct 30, 2007 9:21 AM by olivier_debels

    How to save values to a node?

    dejiesdeoder

      Hi,
      I am new to Jbpm.I just want to know whether there is any way to save values to a node?


      Thanks in advance.

        • 1. Re: How to save values to a node?
          kukeltje

          not specifically to a node, but to a process, yes... or to a token.

          • 2. Re: How to save values to a node?
            dleerob

            The workaround I used to "save variables to a node", was to use a task node instead, add a task to the node, then add a timer with 0 second due date to the task which had an action that started the the task automatically, added the variables I needed to it, then ended the task.

            There may be more elegant ways, but that way fitted in with my framework as it automatically shows a history of variables for each task.

            • 3. Re: How to save values to a node?
              kukeltje

              there is a way more elegant way...

              - Ditch the tasknode
              - Ditch the task
              - Ditch the timer
              - add an on-node-enter event
              - add the already existing action to it.

              • 4. Re: How to save values to a node?
                dleerob

                Thanks for the input.

                I did originally have it like that. However, our framework automatically generates a history page of variables that were set at each task instance in a process (iterates through all task instances for a process). It then displays a list of each completed task instance to the user, along with all their variables under each task name.

                Problem is that if I don't use a task node with a task, then the framework wont really know at which node the variables were set. i.e There wont be a task instance for it, so it just wont be shown.

                Do you have any ideas on another way to link/add variables to a "node", and not a "task node"? So if it doesn't have a task instance, how would I know at which point in the flow, or which node the variables "belong" to?

                • 5. Re: How to save values to a node?
                  olivier_debels


                  Just my thoughts:

                  As far as I can tell variable instances can at this moment only be linked to tokens or to a task instance.

                  If you want to extend this I guess you need to make extensions to the JBPM_VARIABLEINSTANCE table, for example to store variable instances linked to a graph element.

                  You can opt to create special variable instances (of a special subtype) or a custom node which stores these variables.

                  Olivier.