HI WELCOME TO SIRIS

Creating a Business Process Flow for multiple entities

Leave a Comment

 Business process flows can definitely help guide our application users – they always look nice in the demos, and they easily draw positive feedback. But, it seems, when the BPF is designed to cover multiple entities, there are some quirks there.

Here is the BPF I wanted to create:

image

There are two entities involved:

  • Main Entity
  • Stage 1 Entity

Once that simple BPF above is created, here is how it looks like in the user interface while I’m still looking at the Main Entity record::

image

In order to move that BPF to the next stage, I can create a Stage 1 Entity record, save it, and it’ll be fine.

But what if I made “Start” stage active again?

image

My BPF would lose that link to the Stage 1 Entity record – I could try moving that process to the next stage at this point, but I would have to create another record:

image

In order to fix this, I need a lookup from Stage 1 Entity back to the Main entity:

image

With that new relationship in place, it will also show up in the BPF designer:

image

That relationship will now be used as a filter for the BPF.

For example, once the lookup is set on the Stage 1 Record:

image

I will see that Stage 1 Record in the dropdown when trying to navigate to the next stage in the BPF:

image

Well, let’s say it’s all been set up as per the above, so the BPF is, currently, in the second (“Details”) stage:

image

What happens if I choose to move that BPF back to the “Start” stage again? It will go back to the previous state – Stage 1 Entity records won’t be in the “process path” anymore:

image

Looking at the Advanced Find for the “BPF Automation” entity at this point, and it’s obvious that link to the “Stage 1…” record has been removed:

image

Would not it be great if the BPF kept that relationship somehow instead?

Well, since it does not, it seems this is where we may end up getting more than one “Stage 1 Entity” record for the same BPF if the user decided to create another one. Which is not, necessarily, what we wanted to.

One workaround would be to raise an error when an attempt is made to create another “Stage 1 Entity” record for the same BPF, but how do we do it?

For example, here is how it might work:

  • We could create a lookup from the Main Entity to the Stage 1 Entity
  • Then, we could use a real-time workflow on create of the Stage 1 Entity record to check if that lookup on the Main Entity had already been populated. In which case we could terminate the workflow and raise an error. If it had not been populated yet, then the workflow could put a value in that lookup and allow the BPF to proceed
  • Here is what that lookup would look like in my example:
  • image

And the workflow follows below.

Checking the condition (if that new lookup from the Main entity to the Stage 1 Entity has been set):

image

Terminating the workflow if the condition is met:

image

Setting the lookup otherwise:

image

Now if I used the same BPF again, went to the “Details” stage, got “Entity 1 Stage” record created, and went back to the “Start” stage, here is what it would look like:

image

And, if I tried creating another Stage 1 Record, I’d get an error:

image

Actually, since Quick Create forms are supported in business process flows, we can make this experience a little better by adding a quick create form for Stage 1 Entity:

image

  • In the example above, our users would get an error message without really leaving “Main Entity” screen.

Is there a better option to handle this scenario? Let me know if you have other suggestions!

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.