6 Replies Latest reply on Oct 18, 2011 8:45 AM by Guo-Guang Chiou

    How to get an object like kcontext to call setVariable("variable",value) for begin used by following tasks??

    Guo-Guang Chiou Newbie

      I have a main process which contains a sub process like following images.

      mysubws-image.png

      the sub-process image is like following:

      get_model_price-image.png

       

      the "Get mode Price "task will bing to customized WorkItemHandler.

       

      the WorkItemHandler codes roughly like

       

      public class PriceModelHandler implements WorkItemHandler {

        @Override

                public void abortWorkItem(WorkItem arg0, WorkItemManager arg1) {

                          // TODO Auto-generated method stub 

                }

                @Override

                public void executeWorkItem(WorkItem w, WorkItemManager m) {

                          String modelNumber = (String)w.getParameter("modelNumber");  

       

         //????

          kcontext.setVariable("price",123);

          //???? get an object like kcontext in order to call setVariable("variable",valeu);

                          m.completeWorkItem(w.getId(), null);

                }

      }

       

      my question is how to get an object like kcontext in executeWorkItem method in order to call setVariable to save the variable value for later use by

      other tasks following.