cancel
Showing results for 
Search instead for 
Did you mean: 

How do you include the value of a custom organization attribute in the vendor dictionary of FlexNet Publisher trusted activation responses?

No ratings

How do you include the value of a custom organization attribute in the vendor dictionary of FlexNet Publisher trusted activation responses?

Summary

How do you include the value of a custom organization attribute in the vendor dictionary of FNP trusted activation responses?

Question

How do you include the value of a custom organization attribute in the vendor dictionary of FlexNet Publisher trusted activation responses?

Answer

We provides a sample class, VendorDictResponseGenerator in site/samples/trusted, that can be used as an example to populate vendor dictionary values in FNP trusted activation responses. This sample can be modified to populate the vendor dictionary with the value of a custom organization attribute from any of the organizations in the channel partner set of the fulfillment's entitlement.

Once compiled against the FlexNet Operations public API, placed in the custom/webapps/flexnet/WEB-INF/classes directory, and deployed, the name of this callout is configured in FlexNet Operations in System -> Configure -> Trusted Storage -> Generator for Custom Attributes in Online Response. Once configured, the server must be restarted.

This example will populate the vendor dictionary with the fulfillment ID and the non-null value of an organization text attribute named ORG_TEXT from the organization in the End Customer tier of the simple entitlement. In this simple case where the organization in the End Customer tier is used, the getSoldTo method can be used instead of traversing the entire channel partner set of the entitlement.


import java.util.HashMap;
import java.util.Map;
import java.util.Iterator;
import java.util.List;

import com.flexnet.operations.publicapi.CustomAttribute;
import com.flexnet.operations.publicapi.EntitlementLineItem;
import com.flexnet.operations.publicapi.FulfillmentRecord;
import com.flexnet.operations.publicapi.FulfillmentRequestTypeENC;
import com.flexnet.operations.publicapi.OperationsException;
import com.flexnet.operations.publicapi.OrganizationUnit;
import com.flexnet.operations.publicapi.SimpleEntitlement;
import com.flexnet.operations.publicapi.VendorDictionaryResponse;


public class VendorDictResponseGenerator implements VendorDictionaryResponse {

public Map<String, String> getResponseVendorDictionary(FulfillmentRecord fr, boolean isSuccess,
FulfillmentRequestTypeENC operationType) throws OperationsException {
Map<String, String> responseMap = new HashMap();

if (fr != null) {
responseMap.put("FULFILLMENT_ID", fr.getFulfillmentId());

EntitlementLineItem eli = fr.getLineItem();
SimpleEntitlement se = eli.getParentEntitlement();
OrganizationUnit soldTo = se.getSoldTo();
List<CustomAttribute> attrs = soldTo.getCustomAttribute();
Iterator<CustomAttribute> iter = attrs.iterator();
while (iter.hasNext()) {
CustomAttribute attr = iter.next();
if (attr.getName().equals("ORG_TEXT") && attr.getValue() != null) {
responseMap.put("ORG_TEXT", attr.getValue());
}
}
}

return responseMap;
}
}


The following entries are added to the response:

Vendor dictionary entry: FULFILLMENT_ID = <fulfillmentId>
Vendor dictionary entry: ORG_TEXT = <orgAttrValue>
Was this article helpful? Yes No