Saturday, April 24, 2021

Get the Request Objects & Request Object

  <?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">

<Rule language="beanshell" name="Get Request Objects">

  <Description>

  </Description>

  <Signature>

    <Inputs>

      <Argument name="log">

        <Description>

          The log object associated with the SailPointContext.

        </Description>

      </Argument>

      <Argument name="context">

        <Description>

          A sailpoint.api.SailPointContext object that can be used to query the database if necessary.

        </Description>

      </Argument>

    </Inputs>

  </Signature>

  <Source>

import sailpoint.api.SailPointContext;

import sailpoint.object.Request;

// fetch all the request objects

String ruleName = "getResourceObjects";

log.error("Entering into the rule : " + ruleName);

List<Request> requests = context.getObjects(Request.class);

log.error("Exiting from the rule : "+ruleName);

return requests;

</Source>

</Rule>


------------------------------------------------##################-------------------------------------------------

------------------------------------------------##################-------------------------------------------------


 <?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">

<Rule language="beanshell" name="Get Request Object">

  <Description>

  </Description>

  <Signature>

    <Inputs>

      <Argument name="log">

        <Description>

          The log object associated with the SailPointContext.

        </Description>

      </Argument>

      <Argument name="context">

        <Description>

          A sailpoint.api.SailPointContext object that can be used to query the database if necessary.

        </Description>

      </Argument>

    </Inputs>

  </Signature>

  <Source>

import sailpoint.api.SailPointContext;

import sailpoint.object.Request;

// fetch specific request object

String ruleName = "getResourceObject";

log.error("Entering into the rule : " + ruleName);

String name2 = null;

boolean flag = false;

List<Request> requests = context.getObjects(Request.class);

log.error("Request objects size is : " + requests.size());

for (Request request2 : requests) {

                    String name = request2.getName();

                    flag = name.contains("999999");

if (flag) {

name2 = name;

break;

}

}

log.error("Exiting from the rule : "+ruleName);

return name2;

</Source>

</Rule>

No comments:

Post a Comment

Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...