0 Replies Latest reply on Jul 24, 2007 10:45 AM by adfsadf sdafdsf

    execute a Process in different contexts

    adfsadf sdafdsf Newbie

      hello

      we've created a JBpm workflow to check software configurations on multiple computers.

      In the first part the user has to enter all required properties of the whole workflow. (Requirement!)
      In the second part the scheduler triggers the execution of the workflow and all its checks will be executed without user interaction.

      The user interface in the first part is quite simple and it can be generated.
      Because of that we do not want to create a seperate page for each state.

      So we had the idea to create a ProcessInstance and run it in a GUI context.
      This means that the properties of all nodes are extracted one by one and we display them to the user.
      Checks which are also defined in the node, should in the GUI context not be executed!
      (Of course they have to be executed later on in the execution context)

      When the GUI Process instance has ended, we have the required data and we can set the token to the start node an schedule the checks.


      Modifications:
      jpdl nodes: no modification reqired (We just ask for the variable)

      <process-state name="Check User">
       <sub-process name="CheckUnixUser"/>
       <variable name="a" access="read,write" mapped-name="aa" />
       <transition to="succes"/>
       </process-state>


      Decisions might be displayed like this:
       <decision name="Fail on error">
       <handler class="MyRadioDecisionHandler" config-type="constructor">
       <handler>
       <dialog>Should the whole evaluation fail?</dialog>
       <entry key="failed" value="yes" default="true"/>
       <entry key="success" value="no"/>
       </handler>
       </handler>
       <transition to="check" name="failed"/>
       <transition to="create" name="success"/>
       </decision>


      Solution(s?):
      Our checks are defined in multiple Processdefinitions (which reference each other) and for each Processdefinition we add them a custom node-enter action at deployment time.
      this action defines the execution context and handles the following

      If we stepp through the workflow in:
      - the GUI context: we ignore all other actions of the node than the GUI stuff.
      - the execution context: we ignore all the GUI stuff of the node.

      It probably gets difficult when we have async nodes, tasks and so on.

      So do you know a simpler solution for this issue?

      thank you,
      Andrea