4 Replies Latest reply on Aug 25, 2006 2:12 PM by John Menke

    Passing information from UI into taskInstance

    John Menke Newbie

      How is this done?

      Can i create my own web GUI to do this?

      -jm

        • 1. Re: Passing information from UI into taskInstance
          Ronald van Kuijk Master

          "by using the API" would be my second answer, the first being "look at the source".

          The answer to the second question is: "Depends on your knowledge", jBPM is not a limiting factor (as you can see in the source)

          • 2. Re: Passing information from UI into taskInstance
            John Menke Newbie

            lol... through the API yes i figured that.

            a more appropriate question would be: can i pass UI information to an ActionHandler?

            for instance if i want to store a variable pulled from the UI in a TaskInstance is an ActionHandler an inappropriate choice (event based execution)?

            OR -- should i just retrieve the taskInstance with my own code in response to a user action and set it myself?

            I guess what i'm having problems understanding is when to use ActionHandlers. The docs seem to indicate that you can define an ActionHandler to create a taskInstance but if i want to assign that task instance to a userID when it's created there doesn't appear to be a way to UI information (userID) into the ActionHandler. Actionhandler can only retrieve information already in the context from what i see.










            • 3. Re: Passing information from UI into taskInstance
              Brian Greene Newbie

              there are a number of issues here, starting with the UI - what kind of UI? You'll programatically attack things slightly different is you're coming from the web tier rather than a fat client.

              Then variable type comes into play - from the web tier specifically you'll have issues as you'll have to manage the conversion from http speak to strongly typed variables in jBPM.

              If you look at the source for the web app there is a good start at getting the job done, though depending on how rich the variables (types) are in the process you may have to do some more work at creating an elegant solution. (see the converter stuff for a clue on this).

              We ended up writing a custom chunk of code to parse from the web tier, looking at the variables from a specific task's controller to see what we should be looking for. Depending on how rich the UI is that is feeding the task this can be an easy or small feat... we're presenting a rather dynamic UI for any given task so there's a bit of work to it.

              The key will be to look at how the current web app is doing things. Given a task instance there is a clear way to access the controller, and then find out what variables are required etc, and then merge them back into the controller (you merge to the controller rather than the process instance to account for name mapping). The section in the user guide related to this topic gives a clue, and that coupled with the example source should get you there.

              At no point though (that i'm aware of) do ActionHandlers come into play unless you're dynamically creating tasks etc (again, see the guide and examples for how this is done). Instead you can do everything you need starting with an actual TaskInstance.

              Good luck !

              • 4. Re: Passing information from UI into taskInstance
                John Menke Newbie

                 

                "stibrian" wrote:


                The key will be to look at how the current web app is doing things.

                ...
                At no point though (that i'm aware of) do ActionHandlers come into play


                thanks stibrian! that clears alot up.