cancel
Showing results for 
Search instead for 
Did you mean: 

HCI: Using variables from data store / global variables

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Sriprasadsbhat
Active Contributor
0 Kudos

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

Sriprasadsbhat
Active Contributor
0 Kudos

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

Sriprasadsbhat
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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?