Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Ken_Qrious
Level 3
Level 3

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?

 

1 Accepted Solution
ParthaSarathy
Correct answer by
Level 5
Level 5

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.

View solution in original post

4 Replies
ParthaSarathy
Correct answer by
Level 5
Level 5

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.

View solution in original post

Ken_Qrious
Level 3
Level 3
One additional question. When this setting is changed is the data storage released or does the workflow need to be rerun with the setting set off to release the data storage?
ParthaSarathy
Level 5
Level 5

@Ken_Qrious, no need to re-Run the workflow again.

In Workflow property > Execution (Tab) you can see History in days. If it is 7, those temporary data will get released automatically.

Capture.PNG

 

Ken_Qrious
Level 3
Level 3
Thanks Partha for the comment regarding release of the data storage after the keep results flag is set off.