Scheduled Export - Delta Report - Not Always grabbing correct RITM

jlaps
Kilo Sage

As part of our offboarding workflow, there is a process that exports the RITM#/username/userID to a file via mid server export. I have been trying to figure out where it is having trouble, which is typically when terminations get 'batched' and trigger at same second or within a few seconds- Friday afternoons typically. I have been refining the workflow and adding in some randomizing timers, and that may still be the option here, but now that I have a better idea one where this is failing, I am seeking advice.

 

From the OFFBOARD WORKFLOW there is an EXPORT TO MIDSERVER activity-

var gr = new GlideRecord("scheduled_data_export");


gr.addQuery("sys_id", 'cd0af7921bb9a5505d8b41d5ec4bcbe1'); // sys_id of your scheduled export


gr.query();


if (gr.next()) {


gs.executeNow(gr); // if using in scoped app



//SncTriggerSynchronizer.executeNow(gr); // if using in non-scope app i.e global


}

There is a 40 minute wait timer after this, at the end of which it does a data import on the table that tracks success/failure looking for the RITM#. I had previously thought the problem was after the export, but after refining and changing things, that is not the case.

jlaps_0-1755623562937.png

Above is the screenshot of the scheduled job that gets triggered to send the file to mid server. What is happening is related to the DELTA REPORTS option above... the call from the offboard workflow DOES NOT include a RITM#, just the gs.execute to do this. And because there is several offboards being started within seconds, by the time one RITM gets to here, another has already been created, and this is exporting the following (wrong/incorrect/subsequent) RITM details. 

The retry-loop I added is not helping because this job is not looking for the RITM# specifically that is triggered, just the most recent since the RITM was created... which is not always the RITM in question when several get created at the same time.

 

I would think the ideal solution would be to somehow pass the current.number over for the scheduled job (which results in export target/definition) to pull the correct RITM details... but not sure how to do that given this sequence of events before it gets to the EXPORT.

 

How do I get the scheduled export/definition to lock onto the correct RITM# with the above as a starting point and being called from the offboard workflow?

 

Jeff

 

7 REPLIES 7

JenniferRah
Mega Sage

I'm a little confused by your scenario. Your Scheduled Data Export record has an Export Set called Database Termination Details. Within that record, there should be an Export Definition linked to it. That record will give the fields that are exported.

The export definition and target are working, but they sometimes export the wrong RITM info because of this-

jlaps_0-1755787801359.png

When this runs and grabs the most recent updated RITM... that RITM is not the one that triggered this data source; another RITM was created in the ticks between, and that RITMs details are the ones exported.

I am trying other kludgy methods on slowing down RITM creation for offboards to give a few seconds for this to work correctly, but ideally... the data source should be passed the exact RITM somehow and there would be no chance for this delta reports thing to lock onto the wrong RITM when say 5 are created within 10 seconds. Does that make sense?

I think the Scheduled Data Exports are supposed to be just that... scheduled. So there is a filter in the Export Definition that determines which records are exported. 

 

I think the disconnect is that you are trying to manually trigger a scheduled export. Is there a reason you need the export to happen at that exact point?

That is how this process was designed however many years ago, so I am working with what I have. This process is not capable of handling more than one RITM info at a time, so no option to queue them up and batch a bunch over in one export- one at a time only.

 

I can think of ways to redesign the whole process, but that is another thing entirely.

 

I agree that we should not be calling delta reports assuming the most recent updated one is the one we want, but I don't know how, within the current process, to have the workflow pass out the RITM# in question, and have the rest of the process continue as-is. Can I call the export set directly from the workflow instead of using the data source/scheduled export? I don't think I can get it all the way out to the mid server like that. Frustrating.

 

I am relegated right now to adding a delay on the transform map scripts on record creation to give it time, which is definitely a duct tape solution, if it even works.