When entering data into a cDevWorkflow form instance, values can be looked up in real-time from other systems using database connections or web-service connections. In order to configure lookups, you must first define your connections to retrieve data. From the cDevWorkflow Configuration Manager, let’s navigate to Status –> Connections page:
Enter a name for the new connection, a type, and a connection string. If you are trying this on the http://demo.cdevworkflow.com website you can select the type of “MS SQL Server – OLEDB” and enter a connection string of “Provider=SQLOLEDB.1;Password=testdata;Persist Security Info=True;User ID=testdata;Initial Catalog=TestData;Data Source=kansas.innovativeglobal.com”.
Next let’s navigate to the Form definitions and open the “TestFormFile” (from our previous blog) within the form designer. Drag and drop a Lookup Control to the designer:
Set the Data Connection Type to “Database” and select the “TestData” connection we defined in the previous step. In the “Select Query” box, enter a SQL query text to return the desired data from the connection. In the example above, lastName and firstName are columns in the dataLookup table in the TestData database on kansas.innovativeglobal.com.
Scroll down on the dialog and map the database fields to the form fields.
Now let’s save the control properties, save the form and navigate to the Form Instances tab. Select the “TestFormFile” Form Instance created in the last blog (or create a new instance of your form definition) and click the “Edit” button to edit the form instance data. The Form Instance should render as follows:
Select a row from the lookup dialog and click the “OK” button. Based on the selected row, the value of “Jones” is entered in the “Last Name” field and the value of “Tom” is entered in the “First Name” field. Click the “Submit” button to save the data entered.
Use the same retrieve data concept to perform a lookup based on a web-service connection.
You may also be interested in reading more on the subject of Configuring a Custom Workflow Step.
A small sampling of the Workflow Technology for BPM Solutions contained within our cDevWorkflow product offering can be found here: Workflow Technology That Works.
Learn more about our Process Automation & IT, QA Services or Software Development products and solutions on the Web! Visit us at: Innovative Process Solutions