Workflow validations
A workflow validation validates the attributes that are associated with an entry, the edits that were made to the entry, and the overall process to successfully complete a step. You perform a validation to check if all the required attributes of that step are populated.
- validations enforced by the IBM® Product Master application
- business logic related validations that are coded in script. This type of validation is a type of processing can be applied using the step scripts.
You can validate data during two main steps: when uploading data through imports and during step transitions.
You can choose to validate data or apply custom validations through scripting. Custom validations can be run at step entry or exit; additional steps or processing will need to be planned for failed items. Using the OOB functionality, you can specify a required set of attributes for an item at a particular step. The item will not continue successfully until all of those attributes have a valid value.
Most spec level validations, such as field length, minimum and maximum, and required, do not get applied between steps, but is applied upon the workflow exit step. If you do not validate whether all of the spec validations will pass before reaching the Success step, the items are sent to Fixit.
In a workflow, performers often want to enrich their product information. To enrich the information of an entry, a performer can add valuable attributes such as financial information, like the price of an entry, or the sales margin. These attributes are then associated with that particular entry and therefore, need to be validated.
If you specify one or more attributes in the Attributes to validate field when you create or edit a step in the workflow, then the specified attributes are validated when the performer finishes editing the entry. Attributes that are required and can be modified in a workflow, must be added to a Required attribute collection on those steps where they can be, even if a rule is specified on a spec. Every entry must have a unique primary key. Only the attributes that are editable or required within a step are validated. If the attribute collection is set to be Required for the step, all of the attribute values in the attribute collection need to be filled in when the item is in that step, otherwise validation errors will be thrown.
By default, the items and categories in a workflow step get saved
as draft in a collaboration area. Under the save as draft mode, even
the invalid assigned values of attributes gets saved, provided they
are of valid attribute type. This allows you to save an in-progress
version of the item or categories in a workflow step of a collaboration
area, and then return to this workflow step later to continue processing
the item or category. This save-as-draft behavior of entry save in
workflow steps can be disabled by setting the value of save_as_draft_enabled
parameter
to false
in the common.properties file. Regardless
of whether the save_as_draft_enabled
parameter is
set to true
or false
, the item or
categories can move out of this workflow step only after all of its
attributes successfully pass the validation.
- Uniqueness
- Validates against the Catalogs and Hierarchies view before submitting values from a workflow when the workflow exits.
- Required
- Validates the values in a workflow when the workflow exits.
- Dynamic view
- The Fixit attribute collection is dynamically defined when your workflow is saved. The Fixit step is given a union of all editable and required attribute collections from the workflow (and any nested workflows) as the Fixit editable view.
- Timeout
- During the submit process of a given step with a timeout, the system validates any target steps that contain an equivalent set or superset of the editable attributes on that same step with the timeout. For nested workflow steps that have timeouts, the target will be equivalent to or a superset of the attributes that are modifiable within the nested workflow.
Values are validated based on attribute data types. Data type validation also checks for the mandatory and minimum occurrence criteria for all the attributes for a specific entry.
- Number
- Integer
- Currency
- Date
- Period
- URL
- Image URL
- Thumbnail Image URL
- Image
- Thumbnail Image
- Data types
- When the performer provides a value for an attribute, the validation framework validates the data against the corresponding data type. Any validation errors, are reported back to the performer at the top of the screen.
- Format
- Some data types, such as Date and Period, are checked for the correct format and an error message displays with the expected date format.
- Invalid values
- The error messages provide information for the performer to resolve, such as the attribute display name, the invalid value entered, and the attribute data type. An error message displays against each attribute for which an invalid value is entered.
- Mandatory attributes
- If no value is entered for mandatory attribute an error message displays.
- Minimum occurrence
- If an attribute requires a minimum number of occurrences and values do not exist for that number of occurrences, an error message displays.