Close Human Activity from screen

Close Human Activity from screen

  

Hi, I have new to outsystems BPT. I have a process with human activity. I want to invoke close action of that human activity from the screen using ActivityClose action but I have no idea how to get the activityid of human activity from the screen. Hope someone can help. Thanks. 

Hi Aung Thiha,

You will have to pass the ActivityId as input parameter to the screen that supports the Human Activity, that way it will be available when the user opens the activity from the taskbox and you will be able to use the ActivityClose action then.

Jorge Martins wrote:

Hi Aung Thiha,

You will have to pass the ActivityId as input parameter to the screen that supports the Human Activity, that way it will be available when the user opens the activity from the taskbox and you will be able to use the ActivityClose action then.

Hi Jorge,

Yes the screen already has the optional ActivityId input parameter. But when the screen is navigated from other screen, I don't have activityId to pass. So it shows as 0. 

As understood, that ActivityId parameter can only be passed from TaslkBox, right?


Or Is there anyway to get ActivityId by correlationId and ActivityName?

Solution

Typically you will pass the ActivityId from the Taskbox, yes.

But you can always query the BPT data model for info on activities, all the definitions and running instances are represented by records on the BPT system entities. You can also extend the Activity entity with your own business specific entity data, that you'd create/update on the OnReady, OnStart, OnClose callbacks of your business process activities

Solution

Another option is to store the ActivityId in the table the user must 'do something'. When the user performs the action he/she should have done via the Taskbox, but entered via another way (another screen or a mail-link), you can search for this id in the save- or onclose event of the screen to see if an action has to be closed.

Thanks Jorge and Joost for your suggestion. 

As per below link, I should be able to get activityId using Process_Entity table joining Activities (under system). 

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Processes/Use_Process_Entities/Process_Entities_Attributes

Unfortunately, it is not recommended way in outsystems best practice. it is also aligned with both of you suggestion.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Processes/Best_Practices_for_Designing_Processes/Scale_Queries_over_Process_Entities


Glad we could help clarify it for you.

If your issue was solved, please mark the post that best answers it as the solution. If what you ended up doing is not described in any of the previous posts, it would be helpful for others if you could share that knowledge here as the solution.

Thanks!