SmartForms Task
What does it do?
The SmartFormsTask wizard assists you in adding user tasks to your workflow that use SmartForms to display action information to those assigned a task.
How is it used?
A business process may require a manager to approve anorder. The SmartForms task would present the order data, formatted in a K2 smartform, for the manager to review and approve or deny .
- In the following images, click a field or control to get more information, such as what the field or control is used for and how to configure the field and use the control.
- When integrating a Form with a workflow a state called Workflow Task is created and reused in all subsequent user tasks that appear in the workflow. This reduces the duplication of rules and allows the same state to be used for either multiple steps in the same workflow, or even steps in different workflows. A custom state can be configured if required.
- Wizards can be edited. For more information see Edit Wizards.
Field | Description | Sample Value |
---|---|---|
Display Name | The activity display name. This name is visible at design time and runtime. See Changing the Activity Name | Type the name for this workflow step. |
Name | The activity system name. This name is only visible and configurable at design time. See Changing the Activity Name | Type the name for this workflow step. |
Instruction | Represents an instruction of what the user is expected to do or what the workflow step will do. | Type the instruction or description of what this workflow step will do or what the user is expected to do. |
Action | Represents the action or actions that can be performed with this workflow step for example Approve, Decline | Type a name for each action that needs to be completed by participants on this workflow step. To add multiple actions, press Enter after each action. |
Allow user to action the task without completing the Form |
When selected, participants will be provided with the ability to select an Action without opening the specified form. |
This option is selected by default and is not visible when using the wizard for the first time. Edit the wizard to see this option and amend as required. |
Automatically generate Outcomes for the above Actions |
When selected, Outcomes are automatically created from the entered actions. |
This option is selected by default and is not visible when using the wizard for the first time. Edit the wizard to see this option and amend as required. |
Activity names are unique within a workflow and have two types of names, one for display and one for the system. When changing an activity name, dependency issues might occur due to broken dependencies such as to underlying rules. When designing the form, dependency issue indicators identify these issues. There is a difference between the Display Name and the Name fields of the activity on the user task page, and you must understand the impact of changing these names.
The Display Name of the activity can be configured at design time and is visible at runtime. Changing this name does not cause dependency issues.
The Name of the activity represents the system name of the activity and is only visible and configurable at design time. Changing the Name causes dependency issues as the system name is used in items such as rules associated with the activity. Changing the system name is sometimes necessary if you have a user task, for example, with activity name ‘ABC’, and you delete the user task and redeploy the workflow. The rules associated with the activity are not removed from the form and any instances that were started on a previous version of the workflow continue. However, all new instances started result in an error as there are dependency issues because of the deleted activity. You can resolve this by adding another user task to the workflow using the same system name ('ABC') but perhaps with a different display name. When deploying the workflow, the previous rules are updated with the details and configuration of the new user task. If the user task is to be removed from the workflow entirely, remember to fix the dependency issues as described in Fixing Dependency Issues.
Changing the display name of an activity does not cause any dependency issues as no dependencies are broken. Follow the steps below to configure a scenario where the display name of an activity is changed:
- Create a workflow containing an activity called New Client.
- The user task looks like this. Note the Display Name and Name fields are the same.
- Save and deploy the workflow.
- Open the K2 Designer and edit the client form linked to the workflow.
- Navigate to the rules, select the relevant state and edit the rule When the Form is Initializing.
- Note the name of the activity.
- Open the workflow and change the Display Name of the New Client activity to Capture Client.
- Click Next three times.
- You'll see the different activity name in the rule actions listed before the workflow is deployed.
- Finish the wizard.
- Redeploy the workflow.
- Open the K2 Designer and edit the Client form.
- Navigate to the rules and edit the When the Form is Initializing rule.
- Click configure next to the rule action Open the Capture Client Worklist Item. Note the new activity name.
Changing the activity Name (aka the system name) can help you fix dependency issues created where an activity is deleted from a workflow. Follow the steps below to do this:
- Create a workflow containing an activity called Approval Step.
- The user task looks like this. Note the Display Name and Name fields are the same.
- Save and deploy the workflow.
- Open the K2 Designer and edit the form linked to the workflow.
- Navigate to the rules, select the relevant state and edit the rule When the Workflow View is being submitted.
- Note the name of the activity.
- Open the workflow and delete the activity called Approval Step, including its outcomes. This action raises dependency issues to linked rules in the form used for this activity as the activity is gone and the dependency broken.
- Redeploy the workflow.
- Open the K2 Designer and edit the form.
- Navigate to the rules. Note the items containing dependency issue indicators as a result of the broken dependency between the deleted activity and the rules.
- Edit the rule When the Workflow View is being submitted and note the dependency issue on the activity name.
- Close the form.
- To fix the dependency issues add another user task using the same system name. Edit the workflow and add another user task with outcomes.
- Toggle the button to change the Name. Type "New Approval" for the Display Name field and "Approval Step" for the Name field, matching what the deleted activity's system name was, which fixes the dependency issues.
- Click Next twice.
- Note the new activity display name used on the rule page.
- Finish the user task wizard and deploy the workflow.
- Edit the form and navigate to the rules.
- Note that there are no dependency issues.
- Edit the rule When the Workflow View is being submitted and note the new activity display name. The new activity has been used to fix the dependency issue by using the same activity system name that was used in the first activity, called "Approval Step".
On the User Form page of the wizard, select the SmartForm used to perform the User Task. Click the arrow next to the form name to configure advanced form properties.
Field | Description | Sample Value |
---|---|---|
Form | The Form to use for the User Task. |
Click on the ellipses button to open the Category Tree and drag the required Form from the Category. |
Use Item Reference |
The option to create an Item Reference is enabled by default and the Item Reference will be created using the default SmartObject linked to the selected Form. An Item Reference is an XML structure that contains all the information of the specific SmartObject. The Item Reference feature automatically binds the SmartObject data used in a Form to the workflow making it easier and quicker to design a workflow. This eliminates the need to manually configure certain rules such as the rule to return data on a Form at approval and the need to define each Data Field.
|
This option is enabled by default. Deselect the option if this is not required. Note that when disabling this option manual configuration will be required to configure rules and define data fields for example. |
Item Reference | The SmartObject to be used to create item references. If there is more than one View on the Form, the specific SmartObject to be used as the Item Reference must be manually selected from the Context Browser. | Drag and drop the SmartObject from the Context Browser. |
Create new State | Form States are typically used when using different states for different Client Events in a Workflow, but the same Form is used for the different events. Each Form State will have it's own Rules but will inherit the Base State Rules. So different Rules can be applied to the same Form in different states of the Workflow. | Select this option if a new State should be created, then type a name for the State. This state can be edited in the Form Designer. |
Use an existing State | States can be created in the Rule Designer. If previously configured, the existing state can be selected here. See above for more information in States. | Select this option if an existing State should be applied, then select the State from the drop-down list. |
Form Parameter | Parameters are used to parse data from one Form to another. The Data Type of the Parameter should be consistent where data mappings etc. are done. | A list of Form parameters are displayed. Specify the mapping by typing text or drag and drop a value from the Context Browser into the Value field. |
Value | The value to be mapped to the Form parameter. See above for more information on parameters. | There are two ways to specify Form parameters:
|
Action Settings | Determines where the workflow view appears when participants execute the user task.
|
Select the appropriate action. |
Data Bindings | Defines the relationship between data fields and form fields. | Open Task
Drag data fields from the Context Browser to the form fields and controls list to bind them together. Fields such as pre-configured Data Fields, Item References or SmartObject Load method property. Note that when a SmartObject Load method property is used, an input property is required for the correct information to load. When the form loads, those data fields are used to populate values in the form. Action Task The Action Task data bindings tab defines how form data is mapped onto data bindings when participants complete the task. To bind data fields and form data:
|
When selecting to Create a new State, the When the Workflow View is being submitted rule is automatically added to ensure the Form is saved, and the worklist item is actioned when certain conditions are met.
Note how the Activity name and action is used in the condition to confirm the correct Workflow activity and action the worklist item.
On the Rules screen of the SmartForms Task wizard, define the set of actions to open the work item for participants.
Field | Description | Sample Value |
---|---|---|
Select Rule | Default rules are added to identify the specific activity. | Select the rule to execute the workflow activity. |
Rule Actions | Rule action execution can be customized within the workflow. | To modify an action, select the action and click one of the available options:
|
Allocate worklist item on Open | A Workflow may be assigned to multiple Users/Groups. When a user opens the worklist item, the worklist item is then allocated and will be visible to other users with a different status. This setting is selected by default. The status of a worklist item changes from Available to Open when the item is opened. View this status in Workspace at runtime. | Deselect the check box if the worklist item should not be allocated when the Form opens. |
The Allocate worklist item on Open option on the User Form page is selected by default. If this setting is deselected, the worklist items are not allocated. In other words, the status of the assigned worklist items do not change to open. If you need to allocate the worklist item manually it can be done via a rule in a form. This is useful when you need to raise a condition before the item is allocated, for example if the status of a field determines whether the worklist item should be read-only to the person who receives the task or allocated and available for them to action.
In the example below, the Report can either be read-only or edited by assigned users, depending whether a field is selected. If the field is selected, the worklist item is allocated and the status changed to open. If the option is not selected, the form remains read-only and the worklist item is not allocated to the user, leaving the status as-is.
Follow the steps below to set up the scenario:
- Configure the user task to open the Form. Deselect the option Allocate worklist item on Open.
- Finish the wizard and deploy the workflow.
- Edit the Form and add a check box and label to the Form. Rename the label to Edit.
- Save the Form by clicking on the Save icon in the bottom right corner.
- Navigate to the rules and select the state linked to the user task, in this instance it is the Workflow Task state.
- Add the following rule:
- Click configure on the then open the Reports worklist item action.
- Select Yes next to Allocate.
- Save the rule and the Form
- Create a new item in the SharePoint list or library.
- Go to the worklist. Note the status of the worklist item.
- Open the worklist item.
- Select the Edit check box.
- The status of the worklist item changes from Available to Open.
Participants define who executes the User Task (one participant minimum). To add participants to a Task Group, drag the icon from the Context Browser onto the Participants window. Select participants based on relationship (such as Manager), role, group, or individual accounts.
Field | Description | Sample Value |
---|---|---|
Task Group | Represents the users or groups worklist items will be sent to |
|
Add participants to Favorites | Adds the members of the Task Groups to the Favorites list for easy access. | Select this option to add the members of the Task Groups to the Favorites list. |
Notify participants when they receive a work item | Sends a notification to members of the Task Groups when they receive the work item | Select this option to send a notification to members of the Task Groups when they receive the work item. |
This task is routed to users |
All at once - All members of all Task Groups receive the User Task at the same time. |
Select the routing option to be executed. |
You can customize the notification sent to participants. (Notify participants when they receive a work item must be selected in the Participants window of the wizard.)
Customize the notification message by providing a subject line, additional recipients, and custom message text. Use the Context Browser to add fields (form, list, and data) from the workflow item.
Field | Description | Sample Value |
---|---|---|
Customize the Notification Message | If this option is not selected, a default event notification will be sent. When selected, the notification can be customized. | Select the option to customize the notification. |
Subject | When configuring the customized notification, not all the available options are displayed at first. Clicking the drop-down in front of the Subject property will display all of the options that can be configured. Add a subject for the e-mail | Add a subject for the e-mail for example Approve Leave. |
Cc | Configure this property to send a carbon copy | Type a value, or drag a value from the Context Browser such as a pre-configured |
Bcc | Configure this property to send a blind carbon copy | Type a value, or drag a value from the Context Browser such as a pre-configured |
Attachments | Send an attachment with the e-mail | SmartObject methods, Workflow Context Attachments, and Inline Functions that return images or files, can be used to configure the Attachment property. Note that when a SmartObject Load method property is used, an input property is required for the correct information to load. The Process Instance node of the Workflow Context Browser contains the Attachment field for use when a workflow has attachments enabled. See the Use the Workflow Comment and Workflow Attachment SmartObjects topic for more information. |
Message Format |
HTML - Full formatting of the message, including fonts, colors, and images. |
Select one of the two options. |
Message | Enter the e-mail message. | To include information from the workflow task, drag values from the Context Browser into the editor such as a pre-configured Data Field, Item Reference or a SmartObject Load method property. Note that when a SmartObject Load method property is used, an input property is required for the correct data to load. If the message is HTML, formatting can be applied using the toolbar above the message editor. |