---
schema_version: "1"
id: 6629221469d5aa1b01cca88fe4b6a9c6c01436c8872a45cdad47bd821ba6ed22
title: Create the TestReserializeApex Class (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_create_the_testreserializeapex_class.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_create_the_testreserializeapex_class.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 15c017b52235f6a418e4c957685534e02d5218b6cb6d64e9832d75abf4e43a8a
description: For the managed package runtime, before you can create the Integration Procedure example, you must create the TestReserializeApex Apex class that it calls.
products:
  - Omnistudio
release: "264"
---
# Create the TestReserializeApex Class (Managed Package)

For the managed package runtime, before you can create the Integration Procedure example, you must create the TestReserializeApex Apex class that it calls.

![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).

1. From Setup, in the **Quick Find** box, type apex.
2. Click **Apex Classes**.
3. Click **New**.
    
    ![On the Apex Class Edit page, the Apex Class tab is selected and the cursor is at line 1. This is where you paste the code.](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/apexclassnew.png)
4. Enter the following Apex code in the **Apex Class** tab:
    
    ```
    @JsonAccess(serializable='always')
    global with sharing class TestReserializeApex implements Callable { 
        public Object call(String action, Map<String, Object> args) {
            Map<String, Object> input = (Map<String, Object>)args.get('input');
            Map<String, Object> output = (Map<String, Object>)args.get('output');
            Map<String, Object> options = (Map<String, Object>)args.get('options');
            return invokeMethod(action, input, output, options);
        }
        private Object invokeMethod(String methodName, Map<String,Object> input, 
          Map<String,Object> output, Map<String,Object> options) {        
            return output.put('result', new TestReserialize());    
        }    
        @JsonAccess(serializable='always')
        global class TestReserialize { 
            global String name = 'Dave Smith';    
        }
    }
    ```
    
    Also note the use of the [JsonAccess annotation](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_JsonAccess.htm) on the class and method.
5. Click **Save**.

What’s next: [Create the Integration Procedure with the Remote Action (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_create_the_integration_procedure_with_the_remote_action.htm&release=264.0.0&type=5 "For the managed package runtime, an Integration Procedure retrieves and reserializes the value of a name variable from the TestReserializeApex Apex class.").