XPath Filter Constraint is not working over association

0
Team, We have a requirement, to implement the user delegate functionality(Where one user can setup other user as backup, to work on his cases within specific start date & end date). So we did this way, where for Account Entity(System.User type) has association with Backup entity(like below). And below criteria is used at tab XPATH: And with user login, we have setup two backup users like below. As per the given dates the first entry(red-colored box) is not eligible to view the records, only second-entry(green-colored box) is eligible. However the issue that we are seeing is, both backup users are able to see the cases of delegated user with above mentioned XPATH.  Could you please let us know, where it is going wrong here ? also appreciate if you can provide any suggestions for required solution.    FYI- Modeler version 8.5.0 Thank you.   Regards, Ashok B.      
asked
2 answers
3

Do you also have an xpath constraint on the Backup object? It looks likt the table is showing backup objects (Over association, xpath,…?) but the constraint you show in your posting is a constraint on SampleOrders. It will only limit the visibility of SampleOrder objects, but not the visibility of backup objects. You may need to restrict them as well.

answered
1

I realize I’m late to the party here but for completeness let’s answer this question so others will benefit. 

This particular way of structuring XPath queries will not have the desired effect. The XPath will show all entries that have an association with a Backup entity where startDate is in the past. In addition, it will add all entities that have an association with a Backup entity that has an endDate in the future. This is because the date comparisons will not be considered together but separately. To ensure that the date comparisons will be considered together you should use the XPath below. This will ensure that the backup entity will have a date that is after startDate AND before endDate.

[MyFirstModule.SampleOrders_User/Administration.Account/MyFirstModule/AwayEmployee_Account/MyFirstModule.Backup/ 
	[startDate <= '[%CurrentDateTime%]'
	 and
	 endDate >= '[%CurrentDateTime%]']
]

 

answered