1 Reply Latest reply on Aug 22, 2007 4:29 AM by Wolfgang Hollweck

    seem a new bug on TaskMgmtInstance to removeSignalling on gi

    Donald.Liu Newbie

      In TaskMgmtInstance there is a api:
      public void removeSignalling(Token token){
      if (taskInstances!=null) {
      Iterator iter = taskInstances.iterator();
      while (iter.hasNext()) {
      TaskInstance taskInstance = (TaskInstance) iter.next();
      taskInstance.setSignalling(false);
      }
      }
      }

      and it has a note:removes signalling capabilities from all task instances related to the given token.

      but obviously it set all task instances' signalling of taskMgmtInstances to false.

        • 1. Re: seem a new bug on TaskMgmtInstance to removeSignalling o
          Wolfgang Hollweck Newbie

          I encountered the same problem an will create a JIRA issue for it:

          I think there is a bug in TaskMgmtinstance.removeSignalling(Token token) of jBPM versions 3.1.4 and 3.2:

           /**
           * removes signalling capabilities from all task instances related to the given token.
           */
           public void removeSignalling(Token token) {
           if (taskInstances!=null) {
           Iterator iter = taskInstances.iterator();
           while (iter.hasNext()) {
           TaskInstance taskInstance = (TaskInstance) iter.next();
           taskInstance.setSignalling(false);
           }
           }
           }
          


          So when ending a Token this method is called for the Token to be ended.

          But as you can see signalling is set to false for all TaskInstances that are in the current TaskMgmtInstance.
          It has to be checked, that signalling is removed only from TaskInstances belonging to the given Token, i.e.

           /**
           * removes signalling capabilities from all task instances related to the given token.
           */
           public void removeSignalling(Token token) {
           if (taskInstances!=null) {
           Iterator iter = taskInstances.iterator();
           while (iter.hasNext()) {
           TaskInstance taskInstance = (TaskInstance) iter.next();
           /****************************************************************************************/
           // check, that signalling is removed only from TaskInstances belonging to the given Token
           /****************************************************************************************/
           if(taskInstance.getToken.getId() == token.getId)
           taskInstance.setSignalling(false);
           }
           }
           }