25.1.10.2 Determining Participants Dynamically
To determine workflow participants dynamically, use a participant Value > Type of SQL Query, Function Body, or Expression.
When using the SQL Query option, your single column SELECT list returns one case-sensitive username per row. For the Function Body or Expression options, return a comma-separated list of case-sensitive usernames.
Your query, function, or expression can use bind variable syntax to reference workflow parameter values, workflow version Additional Data column names, application items, or other APEX substitution strings.
Tip:
Workflows execute in the background where there is no "logged-in user". So the APP_USER substitution returns nobody in a workflow context. Use APEX$WORKFLOW_INITIATOR to reference the username that initiated the workflow. If it is not the user you need, define a workflow parameter to accept a username for other purposes.
For easiest maintainability, your expression can invoke a PL/SQL package function as well. The function can be specific to the workflow at hand, or by passing the value of the pre-defined bind variable APEX$WORKFLOW_ID your generic function can lookup the related workflow definition using the APEX_WORKFLOWS dictionary view's WORKFLOW_DEF_STATIC_ID column.
your_app_pkg.owners_for_workflow(:APEX$WORKFLOW_ID)Caution:
Participant usernames are case-sensitive. If :APP_USER returns DAVID, then use DAVID.
Parent topic: Identifying Workflow Participants