Dynamically assign a task to the users, where users list are dynamically retrieved from third party systems maintained users list

Users list are maintained in a database like NOSQL store(not in LDAP server) and also we will access the users list only by REST API provided by third party systems.

In this case we cannot use DatabaseIdentityProvider or LDAPIdentityProvider to get the userlists and assign a task to those users.

So the users we retrieve from third party systems are more dynamic based on the inputs. In this scenario, how to assign a task to the users dynamically at runtime which we retrieved from the third party systems without storing those users list into LDAP or any other databases?

1 Like

Can you create a task listener that queries your rest API and use the result of the API query as the input for your task assignee field?

Already task listener configured for “assigned” status of the task to notify the user about action required.

So is that possible to configure more than one task listener for same task?

And can we create more than one task listener for same event like “task created”?

And can we have more than one task listener(lets say: taskcreated and taskassigned) with different event for same task?

Nice and clean way I find that offers the most visibility: set your assignee field to a expression such as ${myAssignee}.
Then create a input mapping that is your code that calls the rest API. And then have your return value of your code be the assignee. The name of your input mapping would be “myAssignee”, which will create a local variable that is picked up by the ${myAssignee} expression.

1 Like

@StephenOTT I understood the way of setting assignee. And also i need clarifications of below few questions on listeners as well.

  1. is that possible to configure more than one task listener for same task?

  2. And can we create more than one task listener for same event like “task created”?

  3. And can we have more than one task listener(lets say: taskcreated and taskassigned) with different event for same task?

:slight_smile: :slight_smile: :slight_smile:

  1. is that possible to configure more than one task listener for same task?

Yes. Just add more entries in the modeler

  1. And can we create more than one task listener for same event like “task created”?

Yes. See answer to 1.

  1. And can we have more than one task listener(lets say: taskcreated and taskassigned) with different event for same task?

Yes. You can check the event in the implementation with DelegateTask (Camunda BPM Javadocs 7.9.19-ee).

For further details you can find the way the engine gets the task listeners from the process definition in this method: camunda-bpm-platform/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java at master · camunda/camunda-bpm-platform · GitHub

Cheers, Ingo

If assignee list are dynamic, we can’t determine the assignee during bpmn design time so we make it as expression for all user tasks whether assignee field or candiadate user or candidate group.

In this case we are not storing any users in database or we are not retrieving it from LDAP directory. All the users are provided from rest api(third party systems) . If i enable Camunda BasicAuth security for accessing camunda rest api’s, it will throw exception. because we don’t maintain users list locally in database or LDAP. So how basic auth will work in this scenario if users are dynamic?

Note: we are not creating any users in camunda, users list was provided by third party rest api.

In this case, you have to implement the IdentityService to connect to your user database. See https://docs.camunda.org/manual/7.9/user-guide/process-engine/identity-service/ for further details.

Hope this helps, Ingo