It is time to consider running your Data Management Rules attached to forms like run on save or consider giving an action menu to users to pull some data in by triggering data load rule from business rules. There are multiple different potential use cases for this mechanism. You can not only start data load rules in your environment you can even trigger data load rules that you can remotely connect to as well. It all starts with creating a connection from your cloud service as usual.

This example is connecting environment to itself but you can imagine connecting to other environment in similar manner.
URL: http://localhost:9000/aif/rest/V1/jobs
Header: Content-Type, application/json
We essentially create a connection named “DM” which we can use from our groovy script as follows to trigger data load rules.

HttpResponse jsonResponse = operation.application.getConnection("DM").post()
.body(json(["jobType":"DATARULE", "jobName":"INT666_Pull_Alien_Information2Oracle", "startPeriod":"Jul-21", "endPeriod":"Jul-21", "importMode":"REPLACE", "exportMode":"STORE_DATA", "fileName":"inbox/INT666_Pull_Alien_Information2Oracle/Aliens.txt"]))
.asString();
boolean pushData = awaitCompletion(jsonResponse, "DM", "Test run")

For those of you who are familiar running data load rules from EPM Automate, you can relate parameters of groovy to EPM automate.
epmautomate runDataRule RULE_NAME START_PERIOD END_PERIOD IMPORT_MODE EXPORT_MODE [FILE_NAME]

// Wait for DM job to be completed
def awaitCompletion(HttpResponse jsonResponse, String connectionName, String operation) {
final int IN_PROGRESS = -1
if (!(200..299).contains(jsonResponse.status))
throwVetoException("Error occured: $jsonResponse.statusText")
// Parse the JSON response to get the status of the operation. Keep polling the DM server until the operation completes.
ReadContext ctx = JsonPath.parse(jsonResponse.body)
int status = ctx.read('$.status') 
for(long delay = 50; status == IN_PROGRESS; delay = Math.min(1000, delay * 2)) {
    sleep(delay)
    status = getJobStatus(connectionName, (String)ctx.read('$.jobId'))
}

println("$operation ${status == 0 ? "successful" : "failed"}.\n")
return status == 0
}
// Poll the DM server to get the job status
int getJobStatus(String connectionName, String jobId) {
HttpResponse pingResponse = operation.application.getConnection(connectionName).get("/" + jobId).asString()
return JsonPath.parse(pingResponse.body).read('$.status')
}

awaitCompletion and getJobStatus functions are very useful to provide a mechanishm to wait until data load rule is completed. You can run the rule from action menus or behind the forms etc. You can monitor running data load rule when it is triggered from Data Management.