Integrate Software AG Products Using Digital Event Services 10.4 | Integrate Software AG Products Using Digital Event Services | MashZone NextGen Help | Appendix | Legacy Presto components | Mashables and Mashups | Mashups in EMML | Advanced Mashup Techniques | Pre-Processing/Post-Processing Mashables with Mashups | Post-processing Mashup
 
Post-processing Mashup
At its simplest, any mashup that invokes a mashable and performs an action using the result is providing post-processing.
* To implement post-processing logic that is directly provided by mashup script statements
1. Write the logic to handle the post-processing as a Java class oruse Java libraries, as needed.
2. Add the custom Java classes to the classpath for the MashZone NextGen Server.Copy them to:
*The external configuration folder, if any, for the MashZone NextGen Server.
Important: Deploying additional resources, such as custom XPath classes, to an external configuration folder simplifies future deployments or MashZone NextGen Server clusters.
*web-apps-home/mashzone/WEB-INF/classes. This is the default location, but is not recommended as it complicates MashZone NextGen Server deployments.
*web-apps-home/mashzone/WEB-INF/lib. This is the default location, but is not recommended as it complicates MashZone NextGen Server deployments.
3. Restart the MashZone NextGen Server.
4. Create a mashup script with the following components:
a. <variable>s , as needed, to receive the results from the mashable or other data to be post-processed and an <output> variable for the result. For example:
...
<operation name="encryptResult">
<variable name="svcResult" type="document"/>
<output name="result" type="string"/>
b. Invoke the mashable. For example:
...
<output name="result" type="string"/>
<invoke service="AmazonREST" operation="getData"
inputvariables="'AWSECommerceService', '2007-07-16',
'xOtPy9Sy7JCI3Y8aNqEkZBxmkPQw/ZH8', 'ListSearch', 'WishList',
'someone@myOrg.com'"
filterexpr="//ns:List[ns:TotalItems > 1]"
outputvariable="$svcResult"/>
<constructor outputvariable="$svcResult">
<ns:mylist>{$svcResult/ns:ListSearchResponse/ns:Lists/ns:List}</ns:mylist>
</constructor>
5. Add a <script> statement to call the post-processinglogic.
This example uses JavaScript scripting. It shows an encryptionclass that encrypts the filtered and constructed results from the mashable. Tocall the post-processing logic in JavaScript, you must use fully qualifiedclass names starting with the Packages keyword.
...
</constructor>
<script type="text/javascript" inputvariables="$svcResult"
outputvariable="$result">
<![CDATA[
var encrypter = new
Packages.com.myOrg.services.Encrypter("My Pass Phrase!")
result = encrypter.encrypt(svcResult);
]]>
</script>
...

Copyright © 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release