2 Replies Latest reply on Dec 27, 2006 12:47 PM by dslevine

    Implementing AssignmentHandler

    dslevine Newbie

      I'm just starting to try and implement my own AssignmentHandler. Simple question on the existing implementation, ExpressionAssignmentHandler.

      The code is:

      public class ExpressionAssignmentHandler implements AssignmentHandler {
      
       private static final long serialVersionUID = 1L;
      
       protected String expression;
       protected ExecutionContext executionContext = null;
       protected ExpressionSession expressionSession = null;
       protected TermTokenizer tokenizer;
       protected Entity entity = null;
      
       public void assign(Assignable assignable, ExecutionContext executionContext) {
      
       try {
       expressionSession = getExpressionSession();
       if (expressionSession==null) {
       throw new NullPointerException("getIdentitySession returned null");
       }
       this.tokenizer = new TermTokenizer(expression); // My Comment: how is expression set by here??
      


      How does expression get set in this class?

      The code in getExpressionSession() doesnt set it:

       /**
       * serves as a hook for customizing the way the identity session is retrieved.
       * overload this method to reuse this expression assignment handler for your
       * user data store.
       */
       protected ExpressionSession getExpressionSession() {
       JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
       if (jbpmContext==null) {
       throw new RuntimeException("no active JbpmContext for resolving assignment expression'"+expression+"'");
       }
       return new IdentitySession(jbpmContext.getSession());
       }
      


      ...so what does? I'm sure I'm missing something simple, thanks!

      PS: I need to implement AssignmentHandler from scratch and not extend ExpressionAssignmentHandler even though I am going to stay with expressions because I dont want to use jbpm User objects as I have my own User objects already.

      Thanks!