---
schema_version: "1"
id: aef3abf1c4394ff8acc43eeafb8faea8cd74000bc78523962c04efa035fff0a5
title: Preprocessor Class 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_preprocessor_class_example.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_preprocessor_class_example.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a28a8a27806e30f7263e8990b1e27b7505329b22656f34a29a4cc7dd3f725432
description: For the managed package runtime, the following example shows the typical structure of a preprocessor Apex class for a declarative Calculation Procedure.
products:
  - Omnistudio
release: "264"
---
# Preprocessor Class Example (Managed Package)

For the managed package runtime, the following example shows the typical structure of a preprocessor Apex class for a declarative Calculation Procedure.

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

```
global with Sharing class PricingCalculationPreProcessExample implements VlocityOpenInterface {

   public Boolean invokeMethod(String methodName, Map<String,Object> inputMap, Map<String,Object> outMap, Map<String,Object> options) {
        Boolean success = true;
        try{
            if(methodName == 'calculate') {             
                 calculation(inputMap, outMap, options);                
            }
          }catch(Exception e){
                    logger.err(e);
                    success=false;
         }

        return success;        
    }
    
    private static void calculation(Map<String,Object> inputMap, Map<String,Object> outMap, Map<String,Object> options){
         Logger.dbg('in preprocess input map is '+inputMap);
         for(String key : inputMap.keySet()){
         	if(key == 'ABCD1234'){
	         	Object realData = inputMap.get(key);
	         	Map<String, Object> real = (Map<String, Object>) realData;
	         	for(String key1 : real.keySet()){
	         		if(key1=='Payor_code'){
	         			real.put('Payor_code', 'kpf');
	         		}
	         	}
	         }
         }
         Logger.dbg(' in preprocess after conversion, input map is '+inputMap);
    }
    
  }
```