-
1. Re: How to set timeCycle on boundryEvent at runtime
onkarruikar Dec 21, 2010 9:20 AM (in response to onkarruikar)Found a solution, instead of boundary event, I used Timer. And before timer placed one Script Task.
Following script did the job:
org.jbpm.workflow.core.node.TimerNode timerNode =
(org.jbpm.workflow.core.node.TimerNode)
kcontext.getNodeInstance().getNode().getNodeContainer().getNode(237);
timerNode.getTimer().setPeriod(reminderInterval);
timerNode.getTimer().setDelay(reminderInterval);
reminderInterval is process variable and 237 is id of the timer node.
-
2. Re: How to set timeCycle on boundryEvent at runtime
krisverlaenen Dec 21, 2010 10:06 AM (in response to onkarruikar)You should be able to use something like <timeCycle xs:type="tFormalExpression">#{time}</timeCycle> to dynamically resolve the value of the time cycle, just make sure that you define the parameter as a process variable, so the process knows where to look up the value.
Kris
-
3. Re: How to set timeCycle on boundryEvent at runtime
onkarruikar Dec 21, 2010 10:18 AM (in response to krisverlaenen)When I use <timeCycle xs:type="tFormalExpression">#{time}</timeCycle> I get following exception:
org.drools.RuntimeDroolsException: Error parsing time string: [ #{time} ]
at org.drools.time.TimeUtils.parseTimeString(TimeUtils.java:132)I debuged it and found TimeUtils gets '#{time}' value as it is.
The expression is not getting evaluated.
-
4. Re: How to set timeCycle on boundryEvent at runtime
krisverlaenen Dec 21, 2010 11:23 AM (in response to onkarruikar)1 of 1 people found this helpfulNot sure which version you are using, but support for dynamic resolution of timer properties was added on November 26th, so it should be included in the latest CR1 release:
(check the resolveValue(..) in the createTimerInstance method)
If you are using the latest version, but still have issues, could you give an example process + java file that show this issue?
Kris