Using Web Services
The following topic covers both inbound and outbound web services.
Procedure
Map a Web Service to a Process Definition
- Navigate to "Definitions > Processes".
- Choose Edit from the process definition you want to map to a web service.
- On the Published Web Services tab, choose Add.
- Optionally change any field.
- Choose Save & Close.
Create an UpdateJob1 Web Service
- Navigate to "Definitions > Processes".
- Choose New Process Definition and Select Web Service.
- Fill
http://<host>:<port>/<context>/api-soap/update/Job/UpdateJob1?WSDL
into the WSDL URL field. - Choose Next.
- Select UpdateJobPortType -> UpdateJob1.
- Choose Next.
- Optionally, if you want to test your settings, fill a valid ID into the JobIdentifierIn field and choose Test.
- Optionally, if this process definition is used to update the status of an asynchronous process, select StatusIn.
- Choose Save.
- In the Process Definition Editor, choose Save & Close.
Create a Process Definition for Asynchronous Processes
- Navigate to "Definitions > Processes".
- Choose New Process Definition and Select RedwoodScript.
- Fill the code under section Asynchronous Process Definition Source below into the Source field.
- Fill a name into the Name field.
- On the Published Web Services tab, choose Add.
- Choose Save & Close.
Asynchronous Process Definition Source
import com.redwood.scheduler.api.model.enumeration.CompletionStrategyType;
{
jcsJobContext.setCompletionStrategy(CompletionStrategyType.External);
}
Values
Published Web Services Tab
Field | Description |
---|---|
Name | The name of the web service, usually WS_ followed by the process definition name. |
Description | An optional description. |
Documentation | An optional comment for the web service. |
Add Note | Should a note be added to the process when this process definition is submitted by a web service. |
WSURL | Web service URL, default is http://<server>:<port>/<context>/submit/WS_<Process_definition> . |
Example
The following examples use the inbound and outbound Redwood Server web services for illustration purposes. It does not make much sense to create an asynchronous process in Redwood Server and update it via a Redwood Server web service with a third Redwood Server web service process definition.
Create the Asynchronous Process Definition
- Navigate to "Definitions > Processes".
- Choose New Process Definition and Select RedwoodScript.
- Fill the code under section Asynchronous Process Definition Source into the Source field.
- Fill a
MSLN_ANSYC_JOB
into the Name field. - On the Published Web Services tab, choose Add.
- Choose Save & Close.
Create the UpdateJob1 Web Service
- Navigate to "Definitions > Processes".
- Choose New Process Definition and Select Web Service.
- Fill
http://pr1.example.com:50000/redwood/api-soap/update/Job/UpdateJob1?WSDL
into the WSDL URL field. - Choose Next.
- Select UpdateJobPortType -> UpdateJob1.
- Choose Next.
- Select StatusIn.
- Choose Save.
- In the Process Definition Editor, choose Save & Close.
Create a Web Service Process Definition to Submit MSLN_ANSYC_JOB
- Navigate to "Definitions > Processes".
- Choose New Process Definition and Select Web Service.
- Fill
http://pr1.example.com:50000/redwood/api-soap/submit/WS_MSLN_ANSYC_JOB?wsdl
into the WSDL URL field. - Select SubmitMSLN_ANSYC_JOBPortType -> SubmitJob.
- Choose Next.
- Choose Save.
- Choose Save & Close.
Submit MSLN_ANSYC_JOB from a Web Service and update its Status
- Navigate to "Definitions > Processes".
- Choose Submit from the context-menu of SOAP_SubmitWS_MSLN_ANSYC_JOBPortType_SubmitJob.
- Choose Submit.
- Navigate to "Monitoring > Processes".
- Locate the process for MSLN_ANSYC_JOB, check its status is Running and write down the ID.
- Navigate to "Definitions > Processes".
- Choose Submit from the context-menu of SOAP_UpdateJobPortType_UpdateJob1.
- Fill the ID of the MSLN_ANSYC_JOB process into the JobIdentifierIn field.
- Choose Submit.
- Navigate to "Monitoring > Processes".
- Locate the process for MSLN_ANSYC_JOB, check its status is Completed.
webservice