Select to view content in your preferred language

Workflow Manager REST APIs

213
2
Jump to solution
a month ago
IanTidy-ET
Esri Contributor

I am trying to build a Widget for Experience Builder to integrate with Workflow Manager.

My problem is that I can't figure out how to update the step with the result from the user via the REST API.

I can:

  1. 'Run' a 'Update Job Properties' step via the '/${workflowItemId}/jobs/${encodeURIComponent(selectedJobId)}/action' end point,
  2. Update the Job Properties values via the '/${workflowItemId}/jobs/${encodeURIComponent(selectedJobId)}/update' end point

But when I try to 'Finish' the step, I get a 'WaitingForInfo' response.

{
    "success": false,
    "stepResponses": [
        {
            "stepId": "c764e20c-8d5e-4b1d-b043-9e09e30485d0",
            "status": "WaitingForInfo",
            "statusDescription": "The step is waiting for information"
        }
    ]
}

 It looks like I need to post something to the step itself, but I can't find what in the documentation.

Any help would be greatly appreciated.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JFarmer
Esri Contributor

Hi @IanTidy-ET 

Lets see if I can help get you on track here. To start, I want to go over what's expected. 

When you run an Update Job Properties step (I'm demoing in the web application here for simplicity), you should see both step started and step info required messages

JFarmer_0-1765807105676.png

When you add in your values and send proceed, you should then see these messages below, starting with the step information message which is the update that you sent.

JFarmer_1-1765807160476.png

 

Our WebSocket Message API has the information you're looking for on what to submit to the step. Specifically, this is what you'll need https://developers.arcgis.com/workflow-manager/api-reference/web-sockets/#message-updateJobPropertie...

The updateJob REST API call is specifically for updating a job when you are not running a step. https://developers.arcgis.com/workflow-manager/api-reference/rest/update-job/. In this case, you're running a step and so I would expect that when you send this request, you get an error that the job is currently running. If that's not happening, then we'd want to look into that.

Hope that helps get you going, let me know if you have any further questions.

Jonathan

View solution in original post

2 Replies
JFarmer
Esri Contributor

Hi @IanTidy-ET 

Lets see if I can help get you on track here. To start, I want to go over what's expected. 

When you run an Update Job Properties step (I'm demoing in the web application here for simplicity), you should see both step started and step info required messages

JFarmer_0-1765807105676.png

When you add in your values and send proceed, you should then see these messages below, starting with the step information message which is the update that you sent.

JFarmer_1-1765807160476.png

 

Our WebSocket Message API has the information you're looking for on what to submit to the step. Specifically, this is what you'll need https://developers.arcgis.com/workflow-manager/api-reference/web-sockets/#message-updateJobPropertie...

The updateJob REST API call is specifically for updating a job when you are not running a step. https://developers.arcgis.com/workflow-manager/api-reference/rest/update-job/. In this case, you're running a step and so I would expect that when you send this request, you get an error that the job is currently running. If that's not happening, then we'd want to look into that.

Hope that helps get you going, let me know if you have any further questions.

Jonathan

IanTidy-ET
Esri Contributor

Thanks Jonathon,

I will leave this until the new year, but I now can see the traffic (which I couldn't before).  I had guessed that it was a WebSocket call, but I couldn't find it.

I didn't think about when the WebSocket was being setup, which is when the page initially loads (which makes complete sense), I was looking at the point the form is displayed and the actions of the form.

Thanks Ian.

0 Kudos