[jboss-user] [JBoss jBPM] - Re: required variables
dleerob
do-not-reply at jboss.com
Thu Sep 13 06:26:13 EDT 2007
I found that code in the submitParameters() method earlier, which is why I thought an exception should be thrown. However, I've just tried again, and still no exeption.
My task definition:
<start-state name="Request For New Employee">
| <task name="Request For New Employee" swimlane="Initiator">
| <controller>
| <variable name="IsReplacement" access="read,write,required"></variable>
| <variable name="EmployeeReplaced"></variable>
| <variable name="TestVariable" access="read,write,required"></variable>
| </controller>
| </task>
| <transition name="" to="Financial Director Approval 1"></transition>
| </start-state>
My action class then completes the task in the following way, but I have added a few printout lines to make sure that my IsReplacement variable is null, and they confirm that the IsReplacement variable is still null, even after calling the end method.
if (completeTask != null && completeTask.equalsIgnoreCase("Yes")) {
| try {
| log.debug("Completing Task Instance: "+taskInstance.getId());
| if (sys_transition != null && !sys_transition.equals("")) {
| taskInstance.end(sys_transition);
| }
| else {
| taskInstance.end();
| }
| messages.add(ActionMessages.GLOBAL_MESSAGE,
| new ActionMessage("task.completed"));
| }
| catch (Exception e) {
| System.out.println("####Exception when ending task!!");
| e.printStackTrace();
| }
| }
| else {
| log.debug("Saving Task Instance: "+taskInstance.getId());
| messages.add(ActionMessages.GLOBAL_MESSAGE,
| new ActionMessage("task.saved"));
| }
|
| String isReplacementVar = (String)taskInstance.getVariable("IsReplacement");
| if (isReplacementVar == null) {
| System.out.println("###isReplacementVar is NULL");
| }
| else {
| System.out.println("###isReplacementVar is NOT NULL");
| }
Please let me know if you figure out what's wrong. I will try a few more things and update this post if I find the answer.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083856#4083856
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083856
More information about the jboss-user
mailing list