2 Replies Latest reply on Mar 6, 2007 5:01 AM by kukeltje

    Getting context variable

    roccolocko

      How can I get the value of a variable in the execute method from a class that implements ActionHandler.
      I want to get some of the task variables to store them on my database but I dont know how to get them from java code.

      Thanx in advanced

        • 1. Re: Getting context variable
          roccolocko

          I don't know if anybody can see my posts, but here is the answer to my previous post in case somebody was wondering hehe

          public class AmountUpdate implements ActionHandler {
           public void execute(ExecutionContext ctx) throws Exception {
           // business logic
           Float erpAmount = ...get amount from erp-system...;
           Float processAmount = (Float) ctx.getContextInstance().getVariable("amount");
           float result = erpAmount.floatValue() + processAmount.floatValue();
           ...update erp-system with the result...;
          
           // graph execution propagation
           if (result > 5000) {
           ctx.leaveNode(ctx, "big amounts");
           } else {
           ctx.leaveNode(ctx, "small amounts");
           }
           }
          }


          • 2. Re: Getting context variable
            kukeltje

            this is all in the documentation, examples, etc...etc...etc....