Renaming the Form Instance within the Process
Workflow Form Instance Renaming
In our March 14th blog we added a “lastName” variable to our “TestFormDef” workflow definition and mapped the value from the “txtLastName” form field to our new workflow process variable. Today let’s rename the Form Instance using the value stored in the “lastName” workflow process variable.
Open the existing “TestFormDef” workflow definition in the designer for editing. Drag and drop a renameforminstance step into the designer and connect the last step (getFormFieldValues) to the new step as shown in the graphic below.
As a reminder, the start step of our workflow definition currently holds two process variables, “formID1 and “lastName”, and our instantiateform step maps the form instance id to the “formID1” variable.
Click on the new renameforminstance step to configure its properties. Enter “variable:formID1” in the “Variable to hold the form instance ID:” field and “variable.lastName” in the “name for the form” field.
Save the changes to the step and the workflow definition.
Now let’s re-execute our “TestFormInst” workflow instance to view the change to the Form Instance name.
The routeform step of the workflow instance will create a task with a new form instance for us to fill out. For this example, we will enter “Simpson” in the txtLastName field and complete the task.
After completing the task, the getformfieldvalues step will map “Simpson” from the txtLastName form field to the variable:lastName process variable. Then our new renameforminstance step will rename the form instance using the “Simpson” value in variable:lastName.
Back on the cDevWorkflow “Instances” tab, we can select and render our latest “TestFormInst” workflow instance to view its execution.
From here, clicking on the instance “Forms” button displays a list of the workflow’s form instances. That list should contain a Form Instance called “Simpson”.
You can click on the “Simpson” instance link to view the form instance content.
Setting Form field values using a Workflow step
Open the Workflow Definition within the designer and drag the “setformfieldvalues” step from the toolbox to the designer. Connect the new step to the last step on the process.
Click on the step and configure the following values for the properties:
Let’s click on the mappings button and set the first name field to a value of “Joel”.
Save the step properties and Workflow Definition and let’s re-execute the Workflow Instance. Once the Instance executes, open the task and enter a value of “Bill” for the first name.
Submit the task and navigate to the Form Instances page within the Configuration Manager. Select the Form Instance “Simpson” and render the form, you should see the value “Joel” within the first name field.
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.