Automatic Activity is not executed if it present after a human activity in a flow

Hi, 

I was trying to run one automatic activity after a human activity. But its not going to automatic activity after the human activity gets executed. 


Hi Sourav,

Human Activities need to be explicitly closed in your code, using ActivityClose (with an ActivityId) or Close MyActivity (in case the Human Activity is public). You are talking about "executing" the Human Activity, but do you explicitly close it?

You can also check in Service Center / Monitoring / Processes whether the Human Activity is still Ready or Open, or whether it's Closed (in which case your process should advance).

Yes I actually close activity using "CloseaAtivity" function in flow. That I do. But in this flow just one confusion for me is like, if I have one automatic activity after a human activity - is that automatic activity will run after the human activity is getting closed? 

Or the use case is like, if want to run a human activity and want to save the activityid using a automatic activity where I can call a server action to save that id in one of my entity. Then what should be the way to do this?

Solution

Hello Sourav, 

Your understanding is correct, the automatic activity will run after you close the human activity before it. 


In the HumanActivity the ActivityId can also provided as a input parameter to your  Destination Screen. You can save in any of the screen actions if you want to.

Can you elaborate on what are you actually trying to achieve ?

Regards

Solution

Hi Sourav,

Or the use case is like, if want to run a human activity and want to save the activityid using a automatic activity where I can call a server action to save that id in one of my entity. Then what should be the way to do this?

You needn't save the ActivityId. What we typically do is saving the ProcessId (in an Entity dedicated to keeping all relevant process information), and using an Aggregate to get the current open Activity, so we can close it. The Aggregate is very simple: it uses the Activity Entity from System, and filters on the ProcessId (Attribute Process_Id) and StatusId (must be Entities.Activity_Status.Open).


hi,

here u are:

https://www.outsystems.com/forums/discussion/38699/automatic-activity-created-and-then-the-process-is-waiting-is-it-a-bug-or-else/

Hi Amal,

You are correct Amal. Usually we follow the same process. In human activity we set a destination page where we can set ActivityId as input parameter. Now from the taskbox when we click any pending activity, it goes to that page with activityid and we can do anything with it(like closeActivite, may be save to entity). Exactly I usually do this.

I was trying to do some experiment with BPT. So some thing came in mind like, Suppose I have a tablerecord (Grid) in my page and in each row I have an option to do "Accept" or "Reject". I was just trying to close the activity from that same page rather that going to the details page where I have the ActivityId. So here actually I need the ActivityId per row and when I click any of this button it will get the Id and able to close it. So some how I was trying to save this ActivityId per row.

But I can understand that BPT process is giving the task box from where I can easily do this. And in this type use case it is not possible because when it hits the HumanActivity, it will be waiting for the end user activity to go forward. So if I have one automatic activity to save the humanactiveId just after it will not work.

I was trying different user case in BPT that actually coming to my mind.

Thanks to "Kilian" also for the suggestion. 

Thank you "Amal" for your quick reply.