2 Replies Latest reply on Oct 12, 2009 1:27 PM by Joram Barrez

    Timer dueDate / dueDateTime

    sdfsd sdfsd Newbie

      Hi. I have a problem with jbpm Timers. First i don't understand why you can't have a timer for Transition that are going to or from a java task. Second problem that I have is with dueDate /dueDateTime... i found no way to specify the dueDate als java.util.Date. I find this weird because the dueDate attribute in TimerImpl is of type Date! I think this Problem can be fixed with the following code in TimerImpl:

      public void setDueDateDescription(String dueDateDescription) {
      
       ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
       Object dueDateEvaluated = scriptManager.evaluateExpression(dueDateDescription, null);
       if(dueDateEvaluated instanceof Date)
       {
       dueDate =dueDateEvaluated;
       return;
       }
       dueDateDescription = (String) dueDateEvaluated;
      
       Duration duration = new Duration(dueDateDescription);
       Date now = Clock.getCurrentTime();
      
      ...........................................
      }
      


      a better solution would be to add a dueDateTimeDefinition in TimerDefinitionImpl and in JobParser.parseTimerDefinition() just set the definition there. after that in ScopeInstanceImpl.createTimer() evaluate dueDateTimeDefinition and if the evaluation returns a Date just set it in dueDate otherwise pare dueDateTimeDefinition as a date String..like you do now in JobParser.parseTimerDefinition().