Sorry, I am not sure if I understand you correctly. Just to make sure. Your WEB API uses REST ?
Let me describe how to execution and check Task status
Execute an Automic Job/Workflow
content-type: application/json
Authorization: Basic <username> <password>
{
"object_name": "JOBS.10.ASYNC.LONG.RUNNER"
}
It returns
{ "run_id": 1091008 }In order to retrieve the Job Status you to call
content-type: application/json
Authorization: Basic <username> <password>
{
}
It returns following status information
{
"name": "JOBS.10.ASYNC.LONG.RUNNER",
"type": "JOBS",
"queue": "QUEUE.DATABASE",
"run_id": 1086005,
"status": 1550,
"status_text": "Active",
"activation_time": "2020-01-14T07:38:02Z",
"start_time": "2020-01-14T07:38:02Z",
"agent": "WIN01",
"platform": "WINDOWS",
"parent": 0,
"user": "<user>",
"estimated_runtime": 22,
"title": "10 Ping - Waiting",
"alias": "JOBS.10.ASYNC.LONG.RUNNER"
}
Check for the 'Status' code. The 'status' code of a running Automic Job lower 1572 and not 1701.
Alternatively you could create in Automic a Job which informs your solution that the Automic Workflow has ended. You have to add this Job as the last task in your Automic Workflow,
------------------------------
Sr. Solution Architect
Broadcom
------------------------------
Original Message:
Sent: 01-14-2020 02:13 AM
From: BERGERON
Subject: workflow do while
"You have to check periodically the Task status until it has finished. "
That's exactly my problem ! I'll try to be clearer with my poor English....
I have a job that is executed via a WEB API command (on another system than AE).
I can only control the end of this job through another WEB API.
So I have to run this control WEB API several times to know when the job is finished.
Hence my question how can I run this job until I have the expected value?
I started working on an event time but it forces me to script to kill the event when the right value is found. I don't find it very clean.
I hope I made myself clearer! :)
Original Message:
Sent: 01-14-2020 01:57 AM
From: Kay Koll
Subject: workflow do while
it is much simpler.
The REST call which executes your Task returns the Automic runid. Use this RunID in a follow up call to check the status of the Task execution. You have to check periodically the Task status until it has finished. You find all details in the REST documentation.
I could send you a PowerShell example which does this. Send me a private message.
------------------------------
Sr. Solution Architect
Broadcom
Original Message:
Sent: 01-13-2020 05:46 PM
From: Reed Byers
Subject: workflow do while
Would an Event.DB do the trick?
I haven't tried this, but I believe you could select your status variable from dual, compare it, and rerun your task until you got the result you wanted...?
------------------------------
Reed Byers
Programmer/Analyst
Oregon State University
Original Message:
Sent: 01-13-2020 09:29 AM
From: BERGERON
Subject: workflow do while
Hi all,
I have to monitor the end of a task via API REST.
I can test the task and put its status in a variable.
But I would need to be able to run this control task until the launched task is finished.
I would actually need a worflow while that doesn't exist....
Any idea how best to do that?
Thanx