Adding/Removing Members from the Workgroup Based on JobTitle with the Task.

Hi All,
There was a requirement, we need to add/remove the members from the workgroup based on their job titles. I have worked on it. here, the sample.

  1. Custom Object :
    Custom jobtitle List.xml (383 Bytes)

  2. TaskDefinition:
    Adding and Removing Workgroup Members Task.xml (1.4 KB)

  3. Rule :
    Adding and Removing Workgroup Members Rule.xml (3.1 KB)
    Import all these files.

Step 1: Open the task and select the Rule.


Step 2: Save and execute it.

1 Like

Good one !
few pointers , think how this can be scaled if you have to assign different group based on different titles , what about if tomorrow you need to assign based on department .

2 Likes

Thanks for your ‘show and tell’.

To make this work in large environments without OutOfMemory issues it is better to do a context.search on IDs. This will provide an iterator of Strings instead of an iterator of Identity-objects which can be huge.

An example:

Iterator iterator = context.search(Identity.class, addQo, "id");
while (iterator != null && iterator.hasNext()) {
  Identity id = context.getObjectById(Identity.class, iterator.next()[0]);

Add the end of the loop you can decache the identity to free memory again :slight_smile:

  context.decache(id);
}

Can you also mention this task will only work for searchable attributes (you cannot Filter on non-searchable attributes).

Again thanks for sharing :smiley:

– Remold

3 Likes

Hi @Vb_Bellamkonda thanks a lot for sharing this, and a good one as well!

I have a side note here, away from the show and tell, what was the need exactly because in general, you can achieve this requirement without doing any custom objects or any other challenges like (large scale Org Chart, Memory leakage, etc…) you can use the LoopBack Connector or Attribute Listener Rule, so just wanted to know the reason behind using this approach :slight_smile: .

Once again, thank you so much for sharing this way/method as well :+1:

Cheers,
Muhammad

1 Like

ThanQ @Remold for the good suggestion.:blush:

Hi @MuhammadMustafa,
Actually, They have an executive workgroup, which is having some set of capabilities to perform the actions. Here, the ask is we need to provide the capabilities based on job titles. They have some set of job titles, if user have any of the job title they should get all the capabilities. And, if the user no longer had particular job title we need to remove the set of capabilities. The process should be automated like scheduled task.

Hi @vishal_kejriwal1 , thanks for the pointers.
Here, we have the requirement for single work group with multiple job titles. Let me try for multiple workgroups with multiple job titles. :slightly_smiling_face:

It is also possible to create ‘Capabilities Role’ :slight_smile:

With these settings you can assign these ‘Capabilities Role’-roles using an Assignment Rule, like match list based on job title.

But that might be another Show & Tell :slight_smile:

– Remold

2 Likes

My Show&Tell for creating Capability-Roles: Assigning Capabilities using a Role

– Remold

1 Like