Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #1 
Hello,

I have a process in which a certain Form has to be completed only if certain conditions are true.  Otherwise, it is not required.  If it is required, a loopback option is available to allow the user to complete the Form.

Before proceeding to the final approval Stage, I currently check to see if the Form is required and if so, if it has been completed.  I do this on the 'When action started' code of the 'Send to Final Approver' Action.  If the Form hasn't been completed I use the statement

ProcessContext.UserError = "You must complete the Check List before submitting to next Stage.";

Okay, so this does the trick (in a fashion) and the following message pops up

[image]

The error message can be seen if you click on the 'View Details'.

However, is there a better way of doing this?

Ideally, I don't really want a 'Process Engine error' with 'An error occurred in the process.  Please report the problem to your administrator'.  Users think that the application has crashed and don't even bother to read the 'View Details' message.  Also, it creates a line in the error log, which I don't really want.

What I'd like is simply a pop-up with the error message to alert the user that the additional form needs to be filled out before proceeding.




0
BMellert

Guru
Registered:
Posts: 676
Reply with quote  #2 
We do exactly what you are seeking, but don't use UserError for the reasons above.
There are two approaches, and we've used both depending on actual requirements.

The one I think fits better for you is when the leave the form (or last form if chained action forms) which chains into another action (or perhaps stage).  This new action/form does the validation and displays an applicable message / details on the form.  In our case we offer two options chosen by a radio button -- return to edit (which chains back to the original form) or save as draft (which sends an email in our case advising it wasn't submitted, making it easier for them to return later, and returns to the editing stage.

An alternative we've also used is to do validation "when user exits form" and writing contents to a hidden field, then to also have a "on form submittion" client script which checks this field and if applicable produces a Alert message and returning false if validation is not good.  (If validation is good, return true and the form can be saved normally.)
0
KarlD

Avatar / Picture

Guru
Registered:
Posts: 112
Reply with quote  #3 
You could also use the dynamic roles to make the intermediate action available only if applicable and hide the final submission until the intermediate action is complete. This way your process doesn't require any error activity and the User is directed through the flow as part of the process.

It is quite straightforward to set up and does not fail or require additional validation.

The simplest way is often the best.
0
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #4 
Thanks to both of you!

I'll give these methods a trial.
0
BMellert

Guru
Registered:
Posts: 676
Reply with quote  #5 
I forgot to mention, but as part of the "save/submit" strategy we also use the dynamic role to indicate whether to allow it to actually submit or not, so they don't bypass the "validation" screen.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!