Hi matej256
We cannot dynamically send action item via GEL.
The workaround I used is - create a "Timesheet Approvers" (lets say time_approvers) field on resource object. make sure the look up you select is "SCH_BROWSE_RESOURCE"
Now link the resource obj to timesheet obj in your timesheet process. In process GEL, you can have a query that selects the basic information of timesheet submitter (to be placed in XOG)
and the names of timesheet approvers (srm_resources.unique_name) and use resource write XOG to update the approvers on resource instance (timesheet submitter)
<gel:parse var="v_xml_root">
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_resource.xsd">
<Header action="write" externalSource="NIKU" objectType="resource" version="15.1.0.149"/>
<Resources>
<Resource employmentType="${xog_employmentType}" externalId="${xog_externalId}" includeInDatamart="${xog_includeInDatamart}"
isActive="${xog_isActive}" isExternal="${xog_isExternal}" resourceId="${xog_resourceId}" resourceType="LABOR" username="${xog_username}">
<PersonalInformation displayName="${xog_displayName}" emailAddress="${xog_emailAddress}" firstName="${xog_firstName}" lastName="${xog_lastName}"/>
<CustomInformation>
<ColumnValue name="time_approvers"/>
</CustomInformation>
</Resource>
</Resources>
</NikuDataBus>
</gel:parse>
Also, I have multiple timesheet approvers, so I run a loop for timesheet approvers later and fill that in the write XML using gel: insert as below-
<gel:set insert="true" select="$v_xml_root/NikuDataBus/Resources/Resource/CustomInformation/ColumnValue" value="${vApproverUniqueName}"/>
If you have a single approver at all time, you can add ColumnValue Value in the xog and dont need to use gel:insert
This of course depends on what ID you keep for your field in Resource obj. You may create a manual sample write file to see what comes out.
After this XOG sets value in your custom field - Timesheet Approvers on res, you can later have another step in your process that sends action items to the Timesheet Approvers field. But pls make sure you select only SCH_BROWSE_RESOURCE as lookup or else the field will not appear as an option to select to send action items to.
Also, pls be advised that once you have set timesheet approvers, they will not have timesheet approval instance right over the submitter automatically. So you may want to grant them approve time instance right manually or in the process.
Hope this helps!
Thanks,
Ashmi