I have just tried the following code (in my process definition) to set the date
to the current date. And it worked only once or twice!! It actually changed the
variable field in the database with the expected value.
<start-state name="start automatic_date">
| <task swimlane="demandeur">
| <controller>
| <variable name="myDate"/>
| </controller>
| <event type="task-create">
| <script>
| <expression>
| Date today = new Date();
|
executionContext.getContextInstance().setVariable("myDate",today.toString());
| </expression>
| </script> </event> </task>
| <transition name="" to="task1"> </transition>
| </start-state>
|
|
| <task-node name="task1">
| <task swimlane="demandeur">
| <controller>
| <variable name="myDate"/>
| </controller>
| </task>
| <transition name="" to="end1"></transition>
| </task-node>
|
| <end-state name="end1"></end-state>
|
The problem is: it doesn't want to work anymore, and i don't know what the
reason is !!!
I checked to see if my code was right, and i saw an example of use of
setVariable in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=73364
The process works fine, but the variable 's value is still null. I can't figure
out what went wrong !! I redeployed the whole webapp, and dropped the database
and started it all over again.
I tried with another setVariable, the one in the link above:
executionContext.getContextInstance().setVariable("stv", new Integer(11));
And it only changed the LONGVALUE_ field value to 11.. but doesn't want to
appear on the webconsole. (the STRINGVALUE_ field is empty)
Thanks in advance,
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3925019#3925019
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3925019
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user