BPT: How to model a process where the first step can be completed at the start

BPT: How to model a process where the first step can be completed at the start

  

We are using BPT to model an hiring process. The first step is to invite a candidate for a job interview. From the menu a user is able to start a new process. On the 'Invite candidate' screen a user needs to fill in a form and can either [A] save the form, so he can complete it later, or [B] can save and complete the activity.

We came up with the following (simple) process:

We are struggling with directly closing the ScheduleInterview activity in the situation described with [B]. 

Are current approach is shown below. This way the proces works as intended.



We would like to see that the ScheduleInterview activity has been completed in the logging of the process. The thing is that in case of [B] this activity is immediately done when the process starts.

We have tried several different things but can't seem to figure out a best practice to solve this. Any help or advice would be appreciated.


What about controling your entity with a status and triggering your process only when the status comes to your [B] scenario? This way the process only starts when it's really interesting to be followed up by BPT engine.

João Melo wrote:

What about controling your entity with a status and triggering your process only when the status comes to your [B] scenario? This way the process only starts when it's really interesting to be followed up by BPT engine.

The thing is that in the [A] scenario the task should show in the (custom) inbox of the user, so he knows that he needs to finish it. That is the reason why we already start the process at that point.

I'm wondering if there is any objection against the approach with the decision. That seems to be working fine, but it just 'feels' wrong.


Hi Kilian even though we have access to the activity and process tables, it is my opinion that you should not use them directly to control OR as log for your process. 


Thus "We would like to see that the ScheduleInterview activity has been completed in the logging of the process" shouldn't be a problem because your history would be in a separate table completely controlled by your and your logic.


If you really want to go ahead and keep your model as is then you need to model a parallel flow with that "ToSchedule" condition that closes the activity on yes and keeps ahead on no, you also need to put all this in a subProcess so that the flow doesnt keep going in case it's a no. Here's an example:



You also need to implement some sort of control to make sure the decision is not reached before the HumanActivity is ready

Hi Afonso, Thank you for taking the time to respond. Just for my understanding, why do you advise against using the Process and Activity tables? BPT has a lot of functionality. For one it logs all the information about all the process steps. So I figured why not use that for reporting purposes? So I'm curious to learn why you don't think this is a good idea.


Thank you for your proposed solution.

Well there's two main reasons imo:

 - First, Activity Definition and Process Definition are generated by Outsystems code and you have no reference for them in compile time, this means your data is VERY loosely coupled (by string probably), which can lead to silent errors if for example someone changes the process name in the bpt.

- Second, if an error occurs in a process, your business data is coupled with the process, which will lead to a few problems when you try to solve it, forcing you to change data in several tables.


Again this is my opinion, it is not a best practice or anything,