Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-1144

Calculate dates for timers

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • jBPM 3.2.3
    • jBPM 3.2.2
    • Runtime Engine
    • None

      I was facing the problem, that I'm not able to schedule calculated dates in a workflow.
      So I modified the class I send you a little bit.

      Now I've two new possibilties.

      1. I'm able to enter a absolute date in the workflow. (yyyy.MM.dd HH:mm:ss)
      Ok, that's poor, I must confess.

      2. But here is the power feature:
      I'm calculating a certain date.
      And store it in the Workflowcontext.

      An example:
      ================================================================
      public class InitProjektBeginnTimerHandler implements ActionHandler {
      /**

      • App Logger
        */
        public final static Logger logger = Logger.getLogger(InitProjektBeginnTimerHandler.class);

      public void execute(ExecutionContext executionContext) throws Exception

      { Projekt projekt = (Projekt) executionContext.getContextInstance() .getVariable(WorkflowDAO.doKey); int offset = projekt.getTraeger().getMandant().getEinstellungen().getOffsetMonatsbericht(); Calendar dateForNextReport = new GregorianCalendar(); dateForNextReport.setTime(projekt.getBeginn()); dateForNextReport.set(Calendar.DAY_OF_MONTH, 1); dateForNextReport.add(Calendar.MONTH, 1); dateForNextReport.set(Calendar.DAY_OF_MONTH, offset); executionContext.setVariable(MbEnum.Variable.DateForNextReport.name(), dateForNextReport.getTime()); logger.info("Leaving node."); executionContext.leaveNode(); }

      }
      ===========================================================================

      With my modifications in the class CreateTimerAction I'm able to assign the variable to a timer by its name.
      I choose the following pattern (variable name: "DateForNextReport") : #

      {DateForNextReport}

      I think this is a very powerful feature and will be appreciated by many other users.

      What do you think?

      Regards,

      Thorsten

              tom.baeyens Tom Baeyens (Inactive)
              thilker_jira thilker (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: