Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titlePre-requisites
  • To add a REST task, you need to add a Java task in place within the BPMN process where you need to do the invocation. Therefore, you have to first create a BPMN process
  • This guide demonstrates adding a REST task using the Eclipse BPMN Designer. Use the update site, to add this plugin to your eclipse if you have not already done so. You can do the same in any other editor by adding the same property values.
  1. Add a “Service task” from Create a BPMN process and a BPMN diagram. For instructions, see Creating a BPMN Process.
  2. Drag and drop a REST Task from the tools palette in the place where you need to invoke the endpoint. 
    Drag and drop a REST taskImage Added
  3. Go to the properties panel of Service Task and select the Main config tab. 
  4. Select Java Task as the Task Type.
  5. Add the following fields to the Documentation section by clicking the New button.

    Field NameString ValueExpression
    serviceURL 
     

    <REST ENDPOINT URL>
    methodHTTP method (GET or POST only)
     

    outputVariableName of the variable to save response
     

    basicAuthUsernameUsername if the endpoints are secured
     

    basicAuthPasswordPassword for the username above
     

    inputRequest payload
     

    headersheader values in the format "headerName1:headerValue1,headerName2:header Value2"
     

The following code block provides an example service task definition to use as the REST task.

...