---
schema_version: "1"
id: 9a1dc3cc100a2f91767c626c79cd33d0a7971ccef4de42e4cd5f09f2fe540de4
title: Example (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_example_1.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_example_1.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 69e9bd1739e8befceaa50fe53092d56b1d69da4723fca0c53a46db94227fa9d9
description: For the managed package runtime, in the Troubleshooting Omniscript, the callOut1 Remote Action element calls an external system to check if the asset is still under warranty.
products:
  - Omnistudio
release: "264"
---
# Example (Managed Package)

For the managed package runtime, in the Troubleshooting Omniscript, the callOut1 Remote Action element calls an external system to check if the asset is still under warranty.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

This example references the Troubleshooting Omniscript and the OmniCallout and DataObjectService Apex classes. It implements the OmniCallout class and the checkWarrantyStatus method:

![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/remote_call_lwc_os_designer.png)

Since this is a sample Omniscript, the method contains a hard-coded response:

![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/salesforce_apexclassdetail_omnicallout.png)

The callOut2 Remote Action calls the `returnItemOrder` method, which in turn calls the `DataObjectService` class that calls out to a Heroku instance to return an order number:

![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/salesforce_apexclass_dataobjectservice.png)

## Sample Class Structure

The following class structure can be used to call out to an external system:

```
global with sharing class CustomClassName implements NS.VlocityOpenInterface
   {

    global CustomClassName() {}
			
    global Boolean invokeMethod(String methodName, Map<String,Object> inputMap, Map<String,Object> outMap, Map<String,Object> options) {
			
              Boolean result = true;
			
      try{
			
             if(methodName.equals('customMethodName')){
			
             // your implementation, use outMap to send response back to OmniScript                                                                  
			
            }
			
            } 
 
	else if(methodName.equals('customMethodName2')){
			
            // your implementation, use outMap to send response back to OmniScript                   
			
         }                              
			
      } catch(Exception e){
			           
         result = false;
			        
      }
			 
             return result;
			      
   }
			
}
```