Question about Additional Challenges on Constrain Your Data Using XPath

0
Hey,   One of the challenges is: Make a dashboard of requests with no approver assigned. Write a microflow that allows managers to claim these requests for themselves.   The manager can see the new page with the correct information, but I am struggling to set up the microflow.   In the microflow I add a Retrieve and set the XPath to [id = '[%CurrentUser%]']    then, I want to add a change object and set the VacationManagement.VacationRequest_Approver to the CurrentUser but I dont know how to achieve this   Can someone help me out ?   Thanks
asked
2 answers
0

Since I do not know how your domain model is in relation to Approver and the system user my assumption is that you have an Approver entity that has a one on one reference to the Account entity.

The XPath for retrieving all the request without the approver will be something like:

[not(MyFirstModule.VacationRequest_Approver/MyFirstModule.Approver)]

If you show this in a grid you can create an action button to claim that request. In the microflow of that button make a parameter VacationRequest so you get the object that has been selected. Now retrieve over the reference of the current user the approver object (see my assumption that there is a relation between Approver and the account entity but all depends on your domain model and do note that a user has an account not is an account). You can retrieve the Approver in a microflow with something like below.

So if you now have the Approver object for this user you can change and set the reference of the VacationRequest to the Approver and commit it.

 

Good luck and regards,

Ronald

answered
0

Not entirely sure what you mean but this is my take on it:

 

I have a similar project.

I setup an account entity that is a generalization of systeem.user.

I then grab the account object via xpath where currentuser = account/username.

So basically I used the username as an identifier to retrieve information from different entities.

This can be used to store information in different entities as well.

A manager could retrieve this by using an xpath like: where information/username = {username}.

If I misunderstood, please show some picture of your setup or elaborate on the goal. 

answered