optimajet / WorkflowServer

Workflow Server is a ready-to-use Workflow Engine-based application that you can deploy into your infrastructure. It can be integrated with NodeJS, PHP, Ruby, .NET, or Java applications via a REST API. Workflow Server is a key component for managing the lifecycle of business objects within your enterprise.
https://workflowserver.io
191 stars 54 forks source link

Send Persistent Parameters Via RestApi #4

Closed tanjuyayak closed 4 years ago

tanjuyayak commented 5 years ago

Hi,

I am trying to send parameters to /workflowapi/executecommand api but couldn't find the way. Documentation says that it is possible to send parameters via "parameters" json data at request body (https://workflowengine.io/documentation/workflow-server/workflow-api/).

Thanks

optimajet commented 5 years ago

Hello.

Did you try to add parameters to request's parameters in URL or the body?

tanjuyayak commented 5 years ago

Hello.

Did you try to add parameters to request's parameters in URL or the body?

Hi, I tried both of them and didnt work. Finally found the solution. When I create parameter and define this parameter as any transition's command it works.

tanjuyayak commented 5 years ago

Hi,

Finally I solved the problem when I create parameter and define this parameter in as command.

optimajet commented 5 years ago

Hi, you can send initial process parameters. If you want these parameters to be saved, that is, to be persistent, then you need to explicitly declare them in the schema. Look at the parameters documentation https://workflowengine.io/documentation/scheme/parameters/. Then you can pass these parameters using POST or as part of the json request body, or as fields in the form. The first method is described in the swagger file, which describes the API. https://workflowengine.io/downloads/assets/workflowserverapi.yaml Look at the CreateInstanceWithParameters method. How to work with the second method can be found in the SoapUI project. https://workflowengine.io/downloads/assets/soapuitests.zip A look at the test, which is called ParametersTestScheme, when the process is initialized, the amount parameter is passed to it. All described things are available for download from the page https://workflowengine.io/downloads/server/