# SailPoint: BeforeOperationRule: getNativeIdentity()

**URL:** <https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475>\
**Category:** IIQ Discussion and Questions\
**Tags:** webservice-connector, rules, aggregation, identityiq\
**Created:** [January 30, 2025, 2:14pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475 "2025-01-30T14:14:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![giafderosa](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@giafderosa](https://developer.sailpoint.com/discuss/u/giafderosa)\
**Post date:** [January 30, 2025, 2:14pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/1 "2025-01-30T14:14:52Z")

</div>

## Which IIQ version are you inquiring about?

8.4p1

Hi,

I’m working on a WebServiceBeforeOperationRule to implement “ **Get Object** ” Connector Operations, I want to provide an “Aggregating a single account from an application” as explained in this topic

[Aggregating a single account from an application](https://community.sailpoint.com/t5/IdentityIQ-Wiki/Aggregating-a-single-account-from-an-application/ta-p/75372#toc-hId--2072605228)

I need to provide an UID in a soap message to the webservice to implemenet the request.

I’ve got an exeption because “ **provisioningPlan is null** ” as shown in this snipped:

```auto
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

String uid= provisioningPlan.getNativeIdentity();

Map bodyMap = requestEndPoint.getBody();
String body = bodyMap.get("jsonBody");
if ( null != uid) {
	body = body.replace("uid", uid);
}
bodyMap.put("jsonBody", body);
requestEndPoint.setBody(bodyMap);
return requestEndPoint;

```

and I don’t know where retreive the account identifier, I also tried to use **$getObject.NativeIdentity$**

Thanks for your help!  
Gianfranco

---

<div class="post-metadata">

**Author:** ![mkumariaas](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mkumariaas/32/40387_2.png) [@mkumariaas](https://developer.sailpoint.com/discuss/u/mkumariaas)\
**Post date:** [January 30, 2025, 5:02pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/2 "2025-01-30T17:02:38Z")

</div>

hi @giafderosa Please check below code  
if ( null != nni) {  
body = body.replace(“uid”, uid);  
}

ALso you can directly use in body like plan.nativeIdentity no need to use before provisioing rule.  
if issue still there then send me Screenshot form ui what is there in Body

---

<div class="post-metadata">

**Author:** ![giafderosa](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@giafderosa](https://developer.sailpoint.com/discuss/u/giafderosa)\
**Post date:** [January 30, 2025, 5:57pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/3 "2025-01-30T17:57:07Z")

</div>

Hi @mkumariaas,

Thank for you answer!

I’ve shared part of the code because it contains client’s custom packages name.

```auto
if ( null != uid)

```

I’m implementing a" **Connector Operation**", in particular the “Before Rule” for the “Get Object” operation.

 ![img1](https://global.discourse-cdn.com/sailpoint/original/3X/a/4/a47c414452296ec0ace17b926c2e1c1d810ba0df.png)

I tried to use “plan.nativeIdentity” directly in the body and it works! Great!

I’m using the before rule becase I need to retreive others parameters, (env specific), to fill out the SOAP message with the UID.

Do you have any idea how retreive “nativeIdentity” in the rule itself?

Thanks,  
Gianfranco

---

<div class="post-metadata">

**Author:** ![angelborrego](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/angelborrego/32/21987_2.png) [@angelborrego](https://developer.sailpoint.com/discuss/u/angelborrego)\
**Post date:** [January 30, 2025, 10:11pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/4 "2025-01-30T22:11:21Z")

</div>

Hi @giafderosa ,

Try with the following code:

```auto
for (AccountRequest accReq : provisioningPlan.getAccountRequests()){
     if (accReq.getOperation().equals(ProvisioningPlan.AccountRequest.Operation.Modify)) {
          Identity id=context.getObjectByName(Identity.class,accReq.getNativeIdentity());
     }
}

```

---

<div class="post-metadata">

**Author:** ![Arpitha1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/arpitha1/32/20512_2.png) [@Arpitha1](https://developer.sailpoint.com/discuss/u/Arpitha1)\
**Post date:** [January 31, 2025, 2:54am UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/5 "2025-01-31T02:54:52Z")

</div>

Hi @giafderosa

In my opinion, this situation is a bit tricky. The ‘provisioningPlan’ may or may not be present, as this operation is intended to aggregate a single object rather than provision it. Therefore, it’s valid if the provisioningPlan is null. This rule might execute immediately after provisioning or during the perform identity request maintenance task. However, this wouldn’t apply if you use it in the body or context URL. I suggest placing $plan.nativeIdentity$ directly in the body, then retrieving the body in the before rule. This way, you can access the plan’s nativeIdentity, modify it, and update the body within the rule itself.

---

<div class="post-metadata">

**Author:** ![SivaLankapalli](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sivalankapalli/32/22436_2.png) [@SivaLankapalli](https://developer.sailpoint.com/discuss/u/SivaLankapalli)\
**Post date:** [January 31, 2025, 3:44am UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/6 "2025-01-31T03:44:03Z")

</div>

Hi @giafderosa,

As you know, the getObject operation will not have a body. You can extract the data from the URL by splitting the full URL.

For example, if the URL is like contexturl/IdValue=$getobject.nativeIdentity$

```auto

String[] urlArr = requestEndPoint.getFullUrl().split("=");

String nativeIdentity = urlArr[urlArr.length - 1];

```

Based on the native identity, call other methods to obtain the desired attributes before constructing the request endpoint.

```auto

requestEndPoint.setFullUrl(requestEndPoint.getFullUrl().concat(**required perms)*));

```

Thanks,  
@SivaLankapalli

---

<div class="post-metadata">

**Author:** ![giafderosa](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@giafderosa](https://developer.sailpoint.com/discuss/u/giafderosa)\
**Post date:** [January 31, 2025, 8:18am UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/7 "2025-01-31T08:18:07Z")

</div>

> [@angelborrego](#):
>
> `provisioningPlan`

Hi @angelborrego,

unfortunately “provisioningPlan” is null in this operation.

Gianfranco

---

<div class="post-metadata">

**Author:** ![giafderosa](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@giafderosa](https://developer.sailpoint.com/discuss/u/giafderosa)\
**Post date:** [January 31, 2025, 8:34am UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/8 "2025-01-31T08:34:14Z")

</div>

Hello,

Thanks everyone for your suggestion! Here how I solved this problem:

**Application Type** : WebService  
**Operation** : Get Object

BODY

```auto
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gar="http:// __SOME__ SCHEMA__">
<soapenv:Header/>
<soapenv:Body>
<gar:AggregUserRequest vtaRequester="VTAREQUESTER" requester="VTAREQUESTER" uid="$plan.nativeIdentity$" />
</soapenv:Body>
</soapenv:Envelope>

```

RULE

**Rule Type** : WebServiceBeforeOperationRule

```auto
import java.util.Map;
import custom.package.IDMService;

IDMService service = new IDMService(context, log);
String vtaRequester= service.getRequester();
   
Map bodyMap = requestEndPoint.getBody();
String body = bodyMap.get("jsonBody");
if ( null != vtaRequester) {
	body = body.replace("VTAREQUESTER", vtaRequester);
}
bodyMap.put("jsonBody", body);
requestEndPoint.setBody(bodyMap);
return requestEndPoint;

```

Finally I used the `$plan.nativeIdentity$` in the body, as @Arpitha1 and @mkumariaas suggested.

Another solution is to use `$getobject.nativeIdentity$` in the requestEndPoint, as SivaLankapalli suggested

Cheers,  
Gianfranco

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [April 1, 2025, 8:34am UTC](https://developer.sailpoint.com/discuss/t/sailpoint-beforeoperationrule-getnativeidentity/99475/9 "2025-04-01T08:34:46Z")

</div>

Closed on April 1, 2025, 8:34am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
