Using the CWProcessIn Message to Start a Periodic Process

Purpose: Use the CWProcessIn message to submit a periodic process. For example, you can use this message if you prefer to set up scheduling for periodic processes externally rather than use the setup described under Scheduling Jobs.

This message uses the CWServiceIn Web Service.

What does the request message include? The message needs to specify a valid periodic process to start, and the code identifying the company where the process should run.

Which job queue is used? The web service submits the periodic process to the job queue defined for the periodic process in Working with Periodic Processes (WPPR).

Wait for completion? The wait_for_completion flag in the request message indicates whether to wait until the job is complete before generating the response message.

• If the wait_for_completion flag in the request message is set to Y, the response message is returned after the process completes, and the message indicates the submitted job_number. In this case, the job is not listed on the Job Management Screen; however, you can use the Document Management Screen or Forms Management Screen to review generated reports or forms.

If the wait_for_completion flag is set to Y and the job does not complete, no response is generated.

• If the wait_for_completion flag in the request message is not set to Y, the response message is returned immediately, and does not indicate a submitted job number. In this case, you can use the Job Management Screen to determine when the process is complete and whether it ran successfully. Once the process is complete, you can also use the Document Management Screen or Forms Management Screen to review generated reports or forms.

User ID: When you start a periodic process through the CWProcessIn message, it runs under the default user set up during installation, so you can review any submitted jobs and reports by filtering on this user at screens such as the Document Management Screen or Forms Management Screen. Contact your cloud administrator or system administrator to confirm the user ID of the default user.

Reviewing the job at the Job Management Screen is available only if the wait_for_completion flag was not set to Y in the request message.

Web service authentication: Use the Working with Web Service Authentication (WWSA) menu option to define a valid CWServiceIn user for web service authentication.

Endpoint: The endpoint is in the format of http://server:port/CWDirectCPService/services/CWServiceIn, where server:port identifies the application server.

For more information: See:

Working with Periodic Processes (WPPR) for background on periodic processes

Executing Periodic Processes (EPRO) for information on submitting and scheduling periodic processes using Order Management System Cloud Service screens

Generic Web Services for setup information on the CWServiceIn web service

Scheduling Jobs for background on scheduling jobs, and a listing of periodic functions available to schedule

Using the ProcessIn REST Message to Start a Periodic Process for information on the REST message available to start a periodic process

In this chapter:

CWProcessIn Message

- Sample CWProcessIn Message

- Responses to the CWProcessIn Message

- CWProcessIn Contents

CWProcessIn Message

Sample CWProcessIn Message

Below is a sample CWProcessIn message embedded in a SOAP envelope.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:dom="http://dom.w3c.org">

<soapenv:Header/>

<soapenv:Body>

<dom:performAction type="xsd:string"><![CDATA[

<Message source="SoapUI" target="OMS" type="CWProcessIn"><CWProcessIn company_code="6" process_code="PROCESS" wait_for_completion="N"/>/Message>

]]>

</dom:performAction>

</soapenv:Body>

</soapenv:Envelope>

CWProcessIn Contents

Tag

Description

type

Must be set to CWProcessIn

company_code

The company code where the periodic process should run. Required even for periodic processes that run for all companies, for example, starting or stopping asyncs. The system ignores the company parameter for periodic functions in the process that do not require company.

It is not necessary to include padding zeroes; for example, the message can specify either 006 or 6 for company 6.

Validated against the company table.

Numeric, 3 positions; required.

process_code

The code identifying the periodic process to run. Must be an existing periodic process.

Alphanumeric, 10 positions; required.

wait_for_ completion

Indicates whether to wait until the submitted process completes before returning the response. If this flag is set to:

Y = The response message is not returned until after the process completes, and indicates the submitted job_number. In this case, the job is not listed on the Job Management Screen; however, you can use the Document Management Screen or Forms Management Screen to review generated reports or forms.

If the wait_for_completion flag is set to Y and the job does not complete, no response is generated.

N or any other value = The response message is generated immediately, and does not indicate a submitted job number. In this case, you can use the Job Management Screen to determine when the process completed and whether it was successful. Once the process is complete, you can also use the Document Management Screen or Forms Management Screen to review generated reports or forms.

Responses to the CWProcessIn Message

Successful message (OK): When the request message correctly specifies an existing company and periodic process to submit, the web service returns the following message, presented below in a SOAP envelope. This message does not necessarily indicate that the periodic process has completed successfully.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<performActionReturn xsi:type="xsd:string">&lt;Message>OK&lt;/Message></performActionReturn>

</soapenv:Body>

</soapenv:Envelope>

 

Unsuccessful message (FAILED): If the request message specifies an invalid company or process code, the web service returns the following message, presented below in a SOAP envelope.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<performActionReturn xsi:type="xsd:string">&lt;Message>FAILED&lt;/Message></performActionReturn>

</soapenv:Body>

</soapenv:Envelope>

 

If the wait_for_completion flag is set to Y and the job does not complete, no response is generated.

Job number: The job_number is returned in the response message only if the wait_for_completion tag was set to Y. In this case, you search for the completed job at the Document Management Screen by job number as well as by the default user; however, in this case the job is not displayed on the Job Management Screen.

CWProcessIn OMSCS 19.0 December 2019 OHC