on 08-23-2017 10:56 AM
Hi experts,
I am trying to persist the last successful run date of an interface in a data store to be used for the next run.
However, how can I do this?
Do I 'write variable' or do I 'Data Store -> Write'?
Also, how can I get this value and output it in content modifier or use it in channels?
edit: also, how can I persist a value that I computed in a groovy script?
Thanks.
Hi Sriprasad,
How will I know if the value has been persisted? I tried your proposed solution, with 1900-01-01T00:00:00.000Z as default value on the initial run. However, on the succeeding runs, it seems like the test process is still using the default value on the query.
Thanks!
Jon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jon,
You will not be able to view the data stored in Global Or Local Variable directly.alternatively you can do 2 things
1) Set the global variable value to Header or property and you can view it by adding Send Step with Sender channel ( mail or file ) and content modifier with header which you have set earlier as body,this is purely for testing purpose.
2) If you are using Script to form compound employee query with filter just add below code snippet ( You need to add this to your Script) which will print the query you have performed in MPL every time you run the interface.
//Set the query or filter to Property "Prop_QueryFilter"
property_WhereClause = pMap.get("Prop_QueryFilter");
def messageLog = messageLogFactory.getMessageLog(message)
if (messageLog != null) {
messageLog.setStringProperty("WhereClause", property_WhereClause);
}
Regards,
Sriprasad Shivaram Bhat
You can't directly manipulate the date in channel, instead you can do the manipulation in script and save that date into a property or header and later use it in communication channel.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Raye,
You can use write variable ( either Local or Global it depends on your requirement ).
You can retrieve the same in your content modifier.
When you run your interface for the first time value would be blank ( you can design in such a way what needs to be added if its first run or else you can provide default value)
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sriprasad,
Thank you for your answer. How can I use the variable from Script for Channel? Example, I need to retrieve records from SF 1 month before current date. Since, we are not able to add dynamic dates in the query, can we store the value (currentdate - 1 month) in a variable and place it in a channel filter for request/reply?
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.