Friendly Error Messages and Workflow Control
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2007 02:49 PM
I have and advanced workflow I'm working on, and at one point I am moving the document to a child folder. I'd like to check for the existence of the folder before attempting to move the doc and do the following if the folder doesn't exist:
1. Inform the user with a friendly error message
2. Stop the task without transitioning to another task.
Help?
1. Inform the user with a friendly error message
2. Stop the task without transitioning to another task.
Help?
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2007 10:27 AM
Can you please share your code.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2007 11:37 AM
Within the process definition you can use either a decision node or an exception-handler. You can't display a friendly message, however you can move to a new part of the workflow e.g. assign new task, send e-mail etc
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2007 08:21 AM
Can you please share your code.
Here's the action in question:
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> <variable name="dsa_debugMessage" access="write"/> <expression> if (logger.isLoggingEnabled()) logger.log("========== Entering action to set Move Doc to Pending Approval folder in Start State"); var dest = bpm_context.childByNamePath("_Pending Approval"); if (dest == undefined) { // I want to handle the exception here } else { bpm_package.children[0].move(dest); } dsa_debugMessage = dest; if (logger.isLoggingEnabled()) logger.log("========== Exiting action to set Move Doc to Pending Approval folder in Start State"); </expression> </script> </action>
How do I code an "exception-handler"?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2007 11:27 AM
Everytime an exception is gnerated, no matter what kind of exception it is, the only message that is displayed back to the user is:
Please correct the errors below then click Finish.
A system error happened during the operation: Failed to signal transition 'null' from workflow task 'jbpm$230'
Is there no way to at least display the real error, like access denied?
Please correct the errors below then click Finish.
A system error happened during the operation: Failed to signal transition 'null' from workflow task 'jbpm$230'
Is there no way to at least display the real error, like access denied?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2007 05:50 AM
The root cause exception is probably 'access denied' although it's not displayed in the UI. We need to find a better way to report workflow errors.
However, if you want to control the flow of the process I would use a decision node to test for required state before entering the node that performs the action. That way, you can explicitly control how to handle issues (e.g. by sending an e-mail, moving to a another task etc).
However, if you want to control the flow of the process I would use a decision node to test for required state before entering the node that performs the action. That way, you can explicitly control how to handle issues (e.g. by sending an e-mail, moving to a another task etc).
