[
http://jira.jboss.com/jira/browse/JBPM-1144?page=comments#action_12401418 ]
Ronald van Kuijk commented on JBPM-1144:
----------------------------------------
put the date as as java.util.Date object in a processvariable, e.g. named
"DateForNextReport"
then use #{DateForNextReport} in the duedate or timer. This currently works with the CVS
version of jBPM
Calculate dates for timers
--------------------------
Key: JBPM-1144
URL:
http://jira.jboss.com/jira/browse/JBPM-1144
Project: JBoss jBPM
Issue Type: Feature Request
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.2
Reporter: thilker
Assigned To: Tom Baeyens
Attachments: CreateTimerAction.java
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
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira