Save input on service request
How do i use a filter chain on a service request input connector in commuications builder to save the input as a xml file?
https://webapp.opentext.com/piroot/ccmprj/v210300/ccmprj-cgd/en/html/jsfilter.htm
Comments
-
The problem is that if i use a redirect i get the already transformed xml from the event, i want to save the data i get before the event
0 -
Yes, this is possible and something we use in all projects.
It's useful as you say to store away the original data and any filter manipulated data. Also, it can help you troubleshoot "invalid" incoming data that does not trigger any event, in those cases a redirectout process would not even be triggered.
And of course, if you have a process based license it will also save you some transactions from not calling a redirect process :-)
What exactly are you struggling with? The javascript itself, or how to invoke it as a filter.
/Petrus
0 -
Yes the Javascript itself, if you could provide a example of the javascript it would be very helpful.
To invoke the filter, correct me if i am wrong:
-I should create a .js file containing the javascript
-create a filterchain(javascript filter)
-select the .js
-apply the filter chain on the input connector
/Chris0 -
Yes, your invocation method looks fine.
Here is a very simple and scaled down example of a javascript that will save the original data to a file named "bu-{randomvalue}_original.xml" and the manipulated data to a file named "bu-{randomvalue}_manipulated.xml"."use strict";
var repo = require( 'repo' );
function generateRandomString() { return Math.floor(Math.random() * Date.now()).toString(36); }
//create a unique name for output file var uniqueName = 'bu-' + generateRandomString();
//get the input data stream var str = repo.loadInput();
//save the orignal data to file repo.save( uniqueName+'_orignal.xml', str );
//do your required manipulation on str data here
//…
//…
//save the manipulated data to file repo.save( uniqueName+'_manipulated.xml', str );
//update data stream with the manipulated data repo.saveOutput( str );The files will by default (you can change) be saved in the root directory of the running application.
Good luck!
/Petrus
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 151 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories