I posted an update yesterday to this question but it seems to have got lost.
I have made the changes that you suggested to the sample policy plugin.
I have added the private string approver - is this necessary or does the interface already have this variable?
I am trying to convert my updated policy assignment plugin java file into jar file. How do I do this?
Original Message:
Sent: Mar 08, 2024 12:43 AM
From: Srinath Samudrala
Subject: Assigning a form derived approver to a policy
Hi Patrick,
In Policy Designer , we have option to dynamically assign approvers through plugins. Please refer to the below techdoc link:
https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/ca-service-management/17-4/building/building-ca-service-catalog/use-api-plug-ins-to-load-data-into-policies-and-forms.html#concept.dita_ab6f884da825b5de96764d57cbb96e8111234283_UseAPIPluginsforPolicies
Example: The changes required on top of sample policy assignment plugin:
public void setInputs(Map<String, Object> inputs) { this.inputs = inputs;// Receive the approver userid passed as variable to this plugin as read from the form value using the expression in policy builder for (Map.Entry<String,Object> entry : inputs.entrySet() { approver = (String)entry.getValue(); break; //Break after reading the first value passed on for approver. Assumed to deal with only one approver } } public List<ApprovalLevel> getApprovalLevels() { // create an approver UserApprover userApprover = new UserApprover(); userApprover.setUserId(approver);
Original Message:
Sent: Mar 06, 2024 09:54 AM
From: Patrick Price
Subject: Assigning a form derived approver to a policy
In my request form I select an approver based on certain data object derived values. The data object queries select the department that the requester belongs to, as well as a list of possible approvers from that department whose job grade is higher than the requester. The select field presents the requester with a list of names and the requester then selects any one of these names.
I then have another data object query that puts the 'userid' of the selected approver in an 'approver userid' field in the form.
I have defined a Policy with the Condition of _service.code of 'PD' , the _service.id of my service, and the _request.status = 400 to the Condition in my policy. e.g. $(_.service.code=='PD'&&_.service.id==11257&&_.request.status==400)
How can I reference that 'approver userid' field from my request form in my policy as the approver of the request?