BPT | Re-assign human activity to another user

Hi Devs, 

I'm trying to re-assing a human activity to a user using HumanActivity_AssignToUser but I'm having some problems. I have a button in my form that when is clicked it calls the ActivityClose API to close the activity ValidationRequest that I want to assign to another user, if in the decision the Result is Yes than I call the Execute Process and inside the Execute Process I put a Automatic Activity where I open again the ValidationRequest activity and try to assign the new user to the ValidationRequest activity. The problem is that I'm recieving the following error in the Module Management:

E.g of the workflow:

This is what I have inside the automatic activity that is inside the "RequestForMo.."


I'm using Outsystem 10.

Does anybody deal with this error before?


Best Regards

Hi Vanilson,

I believe Jorge’s solution in this post explains how you can re-assign a human activity to another user.

Regards,

Nordin

Nordin Ahdi wrote:

Hi Vanilson,

I believe Jorge’s solution in this post explains how you can re-assign a human activity to another user.

Regards,

Nordin

Hi Nordin,

Thank you for your feedback, and I'm using the HumanActivity_AssignToUser  that is giving me the error presented.

Best Regards


Hi Vanilson,

It's not the HumanActivity_AssignToUser  that is giving the error. It's ActivityOpen. That action is being used to manually open an activity and requires, as the error message states, an logged in user. This is not the case here.

Regards,

Lennart

Lennart Kraak wrote:

Hi Vanilson,

It's not the HumanActivity_AssignToUser  that is giving the error. It's ActivityOpen. That action is being used to manually open an activity and requires, as the error message states, an logged in user. This is not the case here.

Regards,

Lennart

Hi Lennart, 

Thanks for your reply, understood, but in this case is strange because I have logged in user iin the application.

Best Regards


Hi,

You're calling the ActivityOpen in a BPT process. This process runs asynchronously and thus uses its own session. This means there isn't a logged in user, just as with timers.

Regards,
Lennart

Lennart Kraak wrote:

Hi,

You're calling the ActivityOpen in a BPT process. This process runs asynchronously and thus uses its own session. This means there isn't a logged in user, just as with timers.

Regards,
Lennart

Hi Lennart 

OK ok, so this means that I have to use the User_Login action before I call ActivityOpen so I can authenticate the user again?


Best Regards


No, that is not the way to go.

Nordin's suggestion to check out that other thread was a good one.

I must say I don't really understand what you are trying to do here. If you really need another user to pick up that activity, because the first user couldn't finish it (or whatever decision there is), then you must not close the activity. You can put it back to ready (reset it), assign it to another user. Since the activity is back in status Ready, this user will see it in the task box and can pick it up. On this moment it will be opened again.