|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[newbie] Error Handling with JSP's HELP!! |
« View previous topic :: View next topic » |
Author |
Message
|
gr8plum |
Posted: Sun Feb 06, 2005 10:25 am Post subject: [newbie] Error Handling with JSP's HELP!! |
|
|
Newbie
Joined: 06 Feb 2005 Posts: 4
|
Howdy, we need a little design help on ho,w to handle an error condition in a command handler.
We currently have the following workflow setup, and I need to figure out how to design it the easiest and FASTEST way:
1. Workflow is started via XML
2. User checks out the workflow task. When it is displayed, the JSP makes a datebase call to retrieve some XML, and it is displayed in the JSP utilizing XSLT. The JSP has 3 buttons that will set a process flag that will tell the flow what path to take next. The user can file it, not file it, or cancel it. The process flag is a field in the container, and a hidden field in the JSP.
3. When one of the buttons is pressed, the process flag is changed (to file or not file), and then is forwarded to a custom command.
4. The custom command does a database update, a webservice call, and then sends out an email.
Here is where we are having some trouble.
5. If there is an error in any of the functions in the custom command, we need to re-set the process flag to indicate that there was an error (not filable), and check it in, and display an error.
6. Our issue is that In the custom command, we do not have access to the context, so we cannot change the process flag to indicate that it is not filable.
We have trid quite a few different things, but have had no luck. Since we have a very tight deadline, we really need some insight on how to handle this logic.
Thanks in advance!!! |
|
Back to top |
|
 |
jmac |
Posted: Sun Feb 06, 2005 12:14 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
If I understand correctly, it would seem to me like a simple check-in fail exit condition will accomplish what you want. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
gr8plum |
Posted: Mon Feb 07, 2005 7:03 am Post subject: |
|
|
Newbie
Joined: 06 Feb 2005 Posts: 4
|
Thanks for the response. Can you tell me how that works?, or point me in the right direction on how to do a check-in fail exit condition? |
|
Back to top |
|
 |
jmac |
Posted: Mon Feb 07, 2005 7:18 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Here is a brief explanation.
All program and (sub)process workflow activities have an associated assigned program or process. Every workflow activity also has an associated exit condition. When the program, block. or (sub)process activity ends, that does not cause navigation to the next activity to occur. What it causes is the exit condition to be evaluated. If the exit condition evaluates true, then navigation continues to the subsequent activities. If the exit condition fails, the current activity (program, block, or (sub)process) goes ready again.
What I understand from your explanation, is that your command is doing the checkin. So if it is doing the checkin it must have access to the output container, and therefore can set the some member (what you are calling the process flag) in the container to fail the exit condition. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
gr8plum |
Posted: Mon Feb 07, 2005 11:24 am Post subject: |
|
|
Newbie
Joined: 06 Feb 2005 Posts: 4
|
Okay, here's the deal. We have a custom command called x-checkInAndFile, which is a java class. It extends GenericCommandHandler and is the action on our jsp page's 'File' and 'Not Fileable' buttons. In the java code, once everything is said and done, it does a render with the "checkInWorkItem" command. We have not over-ridden workflow's checkInWorkItem command.
The issue is if we encounter a database error and are unable to insert the record, we need to somehow pass that error condition back to the calling jsp page so that we can set the filingStatus field to take a different path (error path). Currently the activity has 3 transition paths: 1) transfer the item to someone else (filingStatus = 'F' or 'A'; filingStatus is a string field on the data container); 2) file the item (filingStatus = 'Y', user clicked 'File' button); or 3) don't file the item (filingStatus = 'N', user clicked 'Not Fileable" button). When the java code is executed, it cannot reset the filingStatus on the data container . I am not sure how to set the exit error code that you are referring to or how that would really help in this matter. |
|
Back to top |
|
 |
vennela |
Posted: Mon Feb 07, 2005 11:29 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
This is not an answer:
BUT
Instead of going through the pain of writing your custom handlers, I would suggest you to write your own web client. It will fit in directly into your app and you can have the control. |
|
Back to top |
|
 |
gr8plum |
Posted: Mon Feb 07, 2005 2:38 pm Post subject: |
|
|
Newbie
Joined: 06 Feb 2005 Posts: 4
|
We want to do that later, but we were required to use the out-of-the-box functionality for this phase of our project, since our timeframe is so short (next week), and it was assumed that it would be quicker. |
|
Back to top |
|
 |
Ratan |
Posted: Mon Feb 07, 2005 5:47 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
set exit condition of the activity to (filingStatus = 'Y' OR filingStatus = 'N'). If it is anything else (set that to indicate any processing error), the activity will restart and get into ready state. _________________ -Ratan |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|