Share via


4.2.5 Associate the Workflow to a List

Once the workflow (2) has been compiled, the next step is to associate it with a list on the server so that it can be run on items in the list. This is done with the AssociateWorkflowMarkup operation, which also takes the URL of the workflow configuration file.

A sample request is similar to the following:

 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
       <AssociateWorkflowMarkup xmlns="http://microsoft.com/sharepoint/webpartpages">
          <configUrl> Example/Example.xml</configUrl>
          <configVersion>V1.0</configVersion>
       </AssociateWorkflowMarkup>
    </soap:Body>
 </soap:Envelope>

A sample response is similar to the following:

 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
       <AssociateWorkflowMarkupResponse xmlns="http://microsoft.com/sharepoint/webpartpages">
          <AssociateWorkflowMarkupResult>&lt;Success&gt;0501c0dc-a90d-4464-b880-8c0a15d5aced&lt;/Success&gt;</AssociateWorkflowMarkupResult>
       </AssociateWorkflowMarkupResponse>
    </soap:Body>
 </soap:Envelope>