26
Views
16
Comments
Using ActivitySetGoup problem
Question

I am trying to assign a group of people to a BPT Human task.  Prior to running the task, the group is determined that should handle the specific task.  In the OnReady event, the Group Id is added to the task with the ActivitySetGroup action.  In the Users app, I see that group to be added to the task.  I can also see that the group has users assigned to the group.  In the Process monitoring on Service Center I can see that the group is assigned to the task.  However, when logging in as a member of the group, the user does not have a task in their taskbox.  

We do have roles established, but having found a way to dynamically assign a role to the task, so using groups instead.  Looking for a way to assign multiple users to a task so that one of the group can pick up the task and complete it.  

I have been through the Master Class and read up on Behaviors, but not finding anything that would provide more details on how to make the ActivitySetGroup or another method to assign multiple people to the task.  As a side note, our BPT is built so the end user can configure their own workflows, so we have the groups and users at runtime.


On Ready event

My User groups


Service Center Process Monitoring


User logged in, no taskbox entry

Looking for any suggestions on how to implement groups assigned to a BPT task.

Thanks for any ideas.

mvp_badge
MVP
Rank: #19

Hi Mark,

You say that you can see the group is correctly assigned to the Activity and that you can see that in your Process monitoring. This means that you are implementing correctly Group assignment, I'd say.

But, along with your last image "Taskbox displays Here", it makes me wonder if (a) you have the EPA Taskbox configured to show on your application (by default it should, but check here for more info) and (b) if you are looking at the right place, as the Taskbox displays by default as a small square with a number on the bottom right corner of the screen and not next to the User Info (which I'm pretty sure you are aware, as you went through the Masterclass but better to mention it).

If neither of my wonderings make sense in your case, the other thing I'd look into is whether you are using different Tenants or maybe have the wrong User Provider setup for for the module that defines the process and/or the module that defines the web screen you are viewing.

Hope this helps!

Rank: #3869

Hi Jorge,


Thanks for the quick response.  We have moved the task box up next to the user name as our users felt it was easier to use at the new location instead of lower right portion of the screen (just simple css to move it).  We are using the EPA Taskbox and it has been running well as far as assigning tasks to staff:

I have just implemented tasks using the ActivitySetGroup action over the last couple of days and this is the first time I have not had the task show up in the users taskbox.  Not sure how to get it to display in the users taskbox.  All the posts have mentioned using the action, but I must be missing something.

mvp_badge
MVP
Rank: #19

The ActivitySetGroup is indeed the way to allow a dynamic set of people to pick the activity.

You are using it on the On Ready Callback of your Human Activity to assign an existing Group (defined in the Users app) to the Activity, correct? Can you do some quick troubleshoot and dynamically create the Group on the On Ready Callback before assigning it to the Human Activity, and adding a well known user to it?

This way, we also have control over the Group itself. If this works, then it is possible that the right users where not added to the Group (if there are multiple users with the same name/username or if there's multi-tenancy involved for instance)

Hope this helps

mvp_badge
MVP
Rank: #19

If you go to the Users application as your user, do you see, in your user details that it belongs to that dynamically generated group?

Can you share your module or recreate the issue in a sample module for us to take a look?

Rank: #3869

I can see the new group in the users application with my user account added to it.  I will need to create a sample module as this is part of a much larger application with multiple modules with proprietary information.  The behavior with the direct creation you suggested and how my application works has the same result as far as the users application with the groups being created and the user assigned to the group.

Rank: #3869

I am attaching a sample oml file.  I do not get an item in the taskbox.  I do see the group assigned to the task and the group is created in the users tables.

DynamicGroup.oml

mvp_badge
MVP
Rank: #19

Hi Mark,

I've just started checking your module and can replicate the behavior you describe: even though a user is part of the Group setup for the Activity, the Taskbox doesn't show up.

I'm not sure if you tried it out, but I'm currently seeing the same behavior in a similar Traditional Web app, with the built-in EPA Taskbox.

I'm currently troubleshooting it to see if it's something I missed in my implementation, but meanwhile I'll bring this to the attention of the team to see if it could be a regression of the EPA_TaskBoxExtension not taking into account groups.

Will keep you posted!

Staff
Rank: #53

Hi Mark & Jorge,

I took a stab at this and was able to replicate the problem.

So I tried to create the group first using the UI interface and it worked fine.

Seems that when you create the group programmatically you need to fill in more information, specifically the created by. Probably there is an inner join on that attribute inside the get_activities, eliminating those.

The fix is quite strait forward:


Please do confirm if this worked for you...


Cheers

Staff
Rank: #53

A bit more into it...

If you debug, you'll notice that at this time (activity on ready) the system does not have the context for the user and the getUserID() returns 0.

Not sure how important the creator of the group is to your logic, if at all, but either you hardcode a user id, perhaps a system user, get the user from who created the process or something similar


Cheers

Staff
Rank: #53

As I suspected it couldn't be this simple...

Must be something else, but now I can't replicate it, it works on my machine ;) 

I wonder what it could be.

In the example you sent it didn't work with empty or getuserid on the created and once I hardcoded it (it was actually my first option) it showed up.

On the screen shot you shared calling the Group_CreateNew, if that call is done asynchronously via timer or BPT then the getuserid would be empty, but in that case you should see groups with the createdby set to 0.

And by the way the behaviour I have is the same for REACT or Traditional web (same getActivities method)

Other than debug I'm at a loss here.

One question though, when you try this fix on the example you sent does it work on your environment?

What platform and studio version are you running?

Cheers