keep the results of interim population between two executions - How to monitor and turn off with a work flow

Avatar

Avatar

Ken_Qrious

Avatar

Ken_Qrious

Ken_Qrious

28-02-2021

We have discovered that our campaign users routinely set the "keep the results of interim population between between two executions" for campaigns, hypothesis and technical work flows.  This can causes issues with DB disk usage so we would like to create a technical work flow to monitor for this setting and turn it off.

 

I can see the the event table contains "KeepResult" which allows us to identify campaigns etc which have been run with this setting on but the information is historical and not necessarily the current setting for the campaign.

 

Is there a way to check the current setting for "keep the results of interim population between between two executions" for a campaign/hypothesis/work flow and update this setting through an automated process?

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

ParthaSarathy

Avatar

ParthaSarathy

ParthaSarathy

01-03-2021

Hi @Ken_Qrious ,

Yes you can achieve this by creating a workflow.

keepInterim.PNG

Schedule to run the Workflow weekly once.

 

In Query, Target all the workflows for the initial run and later you can have condition like created date on or after DaysAgo(7) OR last modified on or after DaysAgo(7). Lets say the internal name of the Query is 'allWorkflowQuery'

 

In JavaScript Code,

var query = xtk.queryDef.create(
<queryDef schema="temp:allWorkflowQuery" operation="select">
     <select>
          <node expr="@id"/>
     </select>
</queryDef>
);
var record = query.ExecuteQuery();
for each (var variable in record) {
var primaryKey = variable.@id;
var keepInterimResult = 0;
xtk.session.Write(<workflow xtkschema="xtk:workflow" _operation="update" id={primaryKey} keepResult={keepInterimResult} />);
}
 
Now When you run the workflow, All the "keep the results of interim population between between two executions" will be unchecked automatically.
 
Regards,
ParthaSarathy S.

Answers (0)