INTRODUCTION
LANDesk Process Manager 4.1 supports three kind of listeners:
- E-mail listener
This kind of listener monitors a mailbox to start a workflow - Database listener
This kind of listener sends periodically a queries to an ODBC source, starts the workflow and ' acknowledges ' the database through an UPDATE query - Web Service listener
This listener waits for a message delivered to him through the invocation of the a Web Service.
To invoke the Web Service we can use any kind of application capable to send a SOAP message to the LPM Web Service. In this article I'll illustrate how to use InfoPath to invoke the Web Service and pass some data to the listener.
LPM exposes only one web service method:
boolean ProcessExternalMessage( String connectorName, String fieldContext )
connectorName: is the name of the web service listener defined in LPM
fieldContext: is the XML produced by the submit of the form
If for example we have defined a web service listener called MyList and our XML will be something like this:
<name>Marco</name>
<surname>Belli</surname>
we need to invoke the method in this way:
ProcessExternalMessage( "MyList", "<name>Marco</name><surname>Belli</surname>")
The location of the web service is:
http://localhost/landesk.workflow.servicehost/webservicelistener.asmx?WSDL
Both the parameters are required.
HANDS ON INFOPATH 2007
- Open Infopath and select "Design a form from a template".
- Choose "Web Service" and press OK
- Choose "submit data" and press Next
- enter the location of the web service ( http://<core name>/landesk.workflow.servicehost/webservicelistener.asmx?WSDL ) and press Next
- Select the method ProcessExternalMessage and press Next
- Press Finish
- Right click on the myFields node in the Data Source GUI and choose Add... to add the fields that you need
You will use these fields to pass data to the workflow. - Add a field called Listener_Name and assign to it a default value. The default value need to be the name of the Web Listener defined (or that will be defined in LPM).
It is not important if the field will appear or not on the form. - drag and drop the fields you just created to the form and then save it.
- Now we need to refine the data connections options in order to invoke correctly the web service:
Click on Tools -> Data Connection, choose the data connection (you should have only one!) and press Modify - Press Next until you arrive to a window that displays the parameters (two times Next basically)
- Highlight the filed tns:connectorName and associate to it the field Listener_Name. To associate a field click on Field or group combo and press the button at the end of field: a list of fields will be shown. Pick the field you want to associate from the list.
- Highlight the field tns:fieldContent, select Entire form and check the Submit as string checkbox
- Click Next and then Finish and close the data connection box.
- Save the form.
Now we need to publish the form to a location where it can be accessed by workflow participants. The location can be a network folder or a shared folder on a computer.
To publish the form
1. In InfoPath, and with the form open, click Tools | Design This Form.
2. Click File | Publish.
3. From the Publishing Wizard welcome screen, click Next.
4. Select To a shared folder on this computer or on a network and click Next.
5. Browse to and select, or type the path and filename where you want to publish the form. If you type a filename, be sure to use the .XSN extension.
6. Click Next, then click Finish.
7. Click Close to dismiss the Publishing Wizard.
8. Close the InfoPath form designer.
Finally we need to generate an XML version of the form. We will use this XML to configure the web service listener.
To create an XML version of the form
- Start InfoPath and open the form. (You need to be in form fill-out mode, not design mode.)
- Click File | Save As...
- Browse to the location where you want to store the XML form, type a file name, and click Save.
- Close InfoPath.
Now we need to define the web service listener in LPM.
- Open the process designer
- Click on Configure -> Event Listeners -> Add
- Select Web Service
- click on the Details tab and give a name to the listener.
NOTE: the name must match the value of the field Listener_Name defined in the InfoPath form - select the workflow that needs to be started by the listener
- click on the Settings tab and click on the Open button. Look for the XML generated previously from the form and press OK
- Click on Mappings tab and check the Autogenerate external unique identifier checkbox
- press the button Autogenerate field mappings and press ok to save the listener.
Notes: this article is not an exhaustive guide to InfoPath and does not cover it in details but will provide you the fundamental information needed to interoperate with LANDesk Process Manager.