3 Replies Latest reply on Apr 24, 2006 3:34 AM by infmas

    haw to get variable

    infmas

      hi for all,
      i'm traying to get some varible from process instance,some one can help me how i can to do it ?
      thinks for help

        • 1. Re: haw to get variable
          kukeltje

          could you describe what you tried and what did not work. There are so many examples, testcases and documentation for this that you probably have used all these to achieve your goals.

          • 2. Re: haw to get variable
            tansdale

            the above man is ture there are many way cant do this. i just give u a example about how to deal with context in jbpm.

            ///////

            // get tha contextinstance from pi;
            ContextInstance contextInstance =
            processInstance.getContextInstance();


            // set var named "amount";
            contextInstance.setVariable("amount", new Integer(500));


            //get the "amount" var from context;
            assertEquals(new Integer(500),
            contextInstance.getVariable("amount"));

            ///////

            • 3. Re: haw to get variable
              infmas

              thanks for replay,
              I need to extract a variable from the process which is a primary key of a table and to post contained table (the variable was set by an ather user).
              I use an action on a button and not an action on a node .