-
Feature Request
-
Resolution: Cannot Reproduce
-
Major
-
jBPM 3.2.2
-
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") : #
I think this is a very powerful feature and will be appreciated by many other users.
What do you think?
Regards,
Thorsten