CA Service Management

 View Only
  • 1.  Assigning a form derived approver to a policy

    Posted Mar 06, 2024 09:54 AM

    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?



  • 2.  RE: Assigning a form derived approver to a policy

    Broadcom Employee
    Posted Mar 08, 2024 12:44 AM
    Edited by Srinath Samudrala Mar 08, 2024 12:46 AM

    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);
    Sample changes that are required at Policy Designer:
    Thanks,
    Srinath




  • 3.  RE: Assigning a form derived approver to a policy

    Posted Mar 12, 2024 01:20 AM

    Hello Srinath,

    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?

    Thank you,

    Patrick




  • 4.  RE: Assigning a form derived approver to a policy

    Posted Mar 12, 2024 04:19 PM

    Hello Srinath,

    I have compiled the jar file and have placed it in the plugins folder.

    this is the contents of my properties file:


    I have restarted the Catalog service.
    I do not see the plugin in the catalog Tools/plugins window


    I am unable to see the plugin being adopted

    What do I still have to do?

    Thank you,

    Patrick