22 Messages
•
1.9K Points
Candidate user expression not working in a called workflow instance
Hi,
I'm working on a global workflow that creates a new asset including data owner responsibilities (resource role). After the asset has been created successfully, the global workflow starts an asset-bound workflow for the newly created asset using a script task and "workflowInstanceApi.startWorkflowInstances". I pass the ID of the new asset as businessItemId. The asset-bound workflow is started correctly and I can also execute user tasks for the asset. Unfortunately executing user tasks only works if I specify a group in the candidate user expression. As soon as I try to use a role (e.g. role(Data Owner)) in the candidate user expression, I get the following error message in the logs:
In the UI:
Candidate User ProblemThe workflow could not be started. No enabled users were found for role 'Data Owner'.
In the Logs:
com.collibra.common.api.exception.ApiIllegalArgumentException: wfCandidateUserCheckFailedOnStart
However, I'm 100% sure there are users assigned to the Data Owner role on the relevant asset.
If I test exactly the same candidate user expression in a script task inside of the same workflow, the correct user names are shown in the logs:
def userExpr = "role(Data Owner)"loggerApi.info("${userExpr } == ${users.getUserNames(userExpr)}")
Any ideas why the candidate user expression is not working for the user task?
@SeanPyle Saw you left many helpful answers in the forum. You've probably already come across this case :)
Accepted Solution
SeanPyle
88 Messages
•
2.8K Points
7 months ago
HI Laurenz,
I assume you have the option Perform candidate user check on workflow start selected in the settings of the second workflow. When the second workflow fires up, it looks through all of your tasks and makes sure there is a candidate user assigned to each one. The candidate user assigned must return at least one eligible user.
Based on that, I would ask at what point are you assigning the Data Owner role to the asset (in the first or second workflow)? The asset must have users assigned to the Data Role before the second workflow starts or the candidate user check will fail.
You could try unchecking that box so the candidate user is not required until you reach that user task in the workflow.
Otherwise, you could assign the Data Owner role in the first workflow before the candidate user task is performed.
I’m making a few assumptions based on what I understood, so not 100% sure that will work, but I hope so.
Let me know how you make out.
(edited)
1