BizSolo Adapter Managing exceptions and response
BizSolo processes are one of the great ways to work with Savvion and build basic web applications. From my experience, most of the time you would use BizSolo to manage your master data. Often people ask me questions on how to manage response from your adapters for better user experience.
For this discussion I will use the following example. The BizSolo has been designed to manage a location master. Location master is a table with two columns – Location and country. Since the database server resides on a different machine, and some locations could already exist, there are possibilities of exceptions happening. The master provides a screen to add Location and choose country.
We would like to have a user experience as
- If the location is new it should get added to database on form submit. End user should see a success message
- If the location already exists he should see the details i.e. primary key of the already existing location
- If the database server is down, user should see a message and should see an option to retry
Here is how you can do it.
- Provide a dataslot called “status”. We will use this as a flag to know what has happened
- Create an adapter which takes location and country as input/output and sends status as output
- Write code that updates the database. Throw exceptions if the item already exists.
- Do exception handling in your adapter itself. Set the data slot “status” to “success” ,”duplicate” and “failure” based on the exceptions.
- Create work steps which show the following messages
- Addition Successful
- Unable to Insert. Would you like to retry?
- Record already exists
- After you adapter provide decision box which takes the flow to the correct workstep based on the value in the data slot “success”
- You can provide a retry button in case there is a failure. Connect the retry button to the adapter
Hope this is helpful. Questions are welcome