Hey everyone
Quick question. We currently use Laserfiche for all of our internal forms and business processes and are currently in the process(In the next year or two), switching them on for our external processes as well.
Because of this, I've started deep diving more into the Laserfiche Workflow API, with the hopes of building more custom applications around Laserfiche and Workflow when needed. I've dived into the API before but only on smaller scale projects and mainly as a means to an end.
So here is my situation. In test, I have setup a small webhook in Python that can hit the Workflow API and pass parameters.
import time import requests from requests_ntlm import HttpNtlmAuth import webhook_listener def process_post_request(request, *args, **kwargs): workflow_url = "https://xxx-workflow-url-here" r = requests.post(workflow_url, json={"ParameterCollection":[{"Name":"testParameter", "Value":"HELLO WORLD"}]}, auth=HttpNtlmAuth('domain\\xxxxxx','xxxxxx')) print(r.content) return webhooks = webhook_listener.Listener(handlers={"GET": process_post_request}) webhooks.start() while True: print("Still alive...") time.sleep(300)
Again, this is just test server to test server, all internal. Here is where the problem comes into play.
As soon as the workflow INITIATES, it returns a response like this.
b'<InstanceCreationResultData xmlns="http://schemas.datacontract.org/2004/07/Laserfiche.Workflow.ComponentModel.DataContracts.Creation" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><fault><Status xmlns="">0</Status><Detail i:nil="true" xmlns=""/><DetailCode xmlns="">0</DetailCode></fault><instanceId>UUID-HERE-FOR-EXAMPLE</instanceId></InstanceCreationResultData>'
This is all fine and good, and it's great to know that the Workflow Initiated, but I don't want the response to be returned UNTIL AFTER the workflow has finished, not when it initiates.
I would want the response to come back AFTER the End Workflow step is complete, that way I could also have more flexibility if I wanted to put features like Try/Catch...I could relay to the end user the status of the workflow.
Does anybody have a solution for this or encountered this before, am I doing something wrong? Is there an option I can pick to relay the workflow status back up instead of "Yeah your workflow started."?