Hi there AppWorks fans,
Welcome to a new installment of AppWorks tips.
A small post about 2 nice tricks I learned during my own daily job. When you work a lot with BPMs in your solution (and eventually you will…trust me!) you also want to know how to continue when activities start to fail. Maybe you noticed (there is also a law for this!?) that things always start to fail at the wrong moment in time…This is always during the creation of something totally different, but when you need to test your brand-new implementation you just want to ‘skip’ that annoying failed activity for later investigation. It might for example fail because that one activity calls an external service which is unreachable. This post jumps into this scenario, and we’ll dive into 2 tricks on how to ‘temporarily’ skip that one failed activity, so we can get on with our life to move our JIRA to DONE (and after this, fix that 1 problem afterwards to finalize the full test!)
Let get right into it…
Start with your daily VM spin-up and jump directly (with our developer role account) to our project where we create a simple BPM te play around with. Don’t make it difficult, just craft a 2 steps flow that calls a webservice (Country.State.ReadState) twice with incorrect input…Or better no input at all!
We save this BPM nicely in our ‘bpms’ folder with the name ‘test’, and we do a publication for validating the flow to be fine. When ready we go back to our project where we can right-click our just crafted BPM and do a first test run…
It will fail in our first activity and that is exactly what we want to happen for this post, so we can demo our 2 lessons learned.
TRICK 1 - The skip failed activity
Now our run got executed, it’s time to enter the ‘Process Instance Manager’ artifact where we see a ‘Summarized view’ of all the BPM. In my daily job I learned to change this view with 2 actions!
- Show only BPMs from the last hour
- Switch to the ‘All Instances View’
Now we see a nicer overview of our running BPM instances…
I did already some pre-testing for this post…12 minutes ago! 😜
Great…Now what?
Well…Check out that failed BPM (by clicking on that blueish activity icon in the far right of the row)
You get a new overview where you see your ‘Aborted’ activity passing by, and some actions for you to investigate why it failed:
We know why it fails, so we just want to skip this activity as at this point in time it’s not in scope for further investigation. Ok, but how to skip it?
For this we go back to the parent overview where we can mark the ‘Aborted’ flow, so we can choose the ‘skip’ action:
Is it wise? Well, for us, it is! But always keep in mind you skipped the activity and if following activities depend on the output of this activity they will probably fail too!…So, it’s an administration task where you need to have knowledge about your system!
We skip it…We refresh…And we fail again…Only this time in the second activity (as intended!)
That’s trick one…next…
TRICK 2 - The false conditioned activity
For this trick we need to update our BPM…Always tricky as you could forget to disable it when you’re done! So again, keep it in mind before you do your commit on finished features.
Back in the design model of our BPM and get the properties of our first ‘ReadState1’ activity. To skip this particular state we make sure we set a condition on the state…A real simple condition: false()
When you made that condition, you see an interesting icon in the left corner of the activity…Where did we see that icon? Correct! It’s a small ‘Decision’ construct!
What did we create?…See it as an entry condition on the activity which makes it ‘allowable’ to execute!…So, with false()
it’s never executed? CORRECT! That was part of the trick…Now you also know it and can share it with someone else.
Let’s save, publish, and run it to see that nicely skipped activity in the BPM overview of the PIM:
Exactly what we wanted to accomplish…Focus on the ‘real’ activity we’re working on! I know…It also fails, but we all know why…And we all know how to skip it from now on!
Sleep tight…😴
That it…”DONE”…two nice, shared tricks for you to benefit from during your own BPMs journey. Nothing less, nothing more…Have a nice week-end, and I see you in another great installment with new AppWorks Tips…Cheers!
Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The AppWorks guy”?