Everyone says they want more choices. But the truth is that more choices just confuse people, particularly when there is only a single right choice. This is true with workflow templates. Your users don’t want to select from a huge list workflow templates every time they want to start a new process. It’s annoying and can lead to mistakes which you have to fix.
Fortunately you can limit their choices and make both your users and your own lives easier.
There are two basic steps:
- Create workflow template filters.
- Remove the ability for users to access any workflows except those which have been assigned.
Create Workflow Template Filters
Workflow template filters define which workflows are available for a particular object type, within each group. When a user selects an object and starts a new process the dialog will only show the assigned workflows.
To create a workflow template filter you
- Select a group
- Select an object type
- Specify a list of workflow templates
You can do this through the GUI in the Workflow Designer application. Go to Edit → Template Filter. That works fine for setting up one or two filters. But, it can be cumbersome when you have several combinations of group and object type to configure.
That is why I prefer to create filters by setting Teamcenter preferences. That is what the GUI in Workflow Designer is actually doing.
The three steps mentioned above become:
- Select a group: Create a group level preference
- Select object type: Name the preference
TC_objectType_release_procedure. objectType is the type of object the filter is applied to. Often this will be Item or ItemRevision or one of their descendants. The preference type should be string with multiple values.
- Specify a list of workflow templates: Add the names of the workflows as values for the preference you just created.
Hide Unassigned Templates From Ordinary Users
Change the value of the site preference
CR_allow_alternate_procedures to none.
The valid values are all, Assigned or none. For all or Assigned the New Process dialog will have two radio buttons which allows users to view either all templates or just those that are assigned. The difference between all and Assigned is which button is pre-selected.
When you change the value to none you remove the radio buttons completely. Users can only select from the list of assigned workflow templates.
Give Certain Users Special Privileges
Some users, such as DBAs and workflow designers, should be able to see all of the workflows.
Create group or user
CR_allow_alternate_procedures preferences set to all or Assigned for those groups or users to override the site preference.
Export → Edit → Import
If you have several similar sets of template filters to configure:
- Define the preference for one group and object type
- Use the using the
preferences_managerutility to export the preference
- Edit the XML if necessary to add preferences for additional object types or to list additional workflows
- Import the XML with
preferences_managerfor each group
Template filters are not foolproof. If a user selects multiple objects of different types then they will see the list of assigned templates for only one of the object types. They will be able to submit all of the objects to any process template in that list. To absolutely ensure that only specific types are submitted to a workflow you need to add a rule handler for that to the process template.
Also be aware that users could define their own values for
CR_allow_alternate_procedures, overriding the values you have set at the site or group level.
Credit Where it is Due
Logresh Rasumani did a post a while ago on his blog about setting up workflow filters using the Workflow Designer application. That pushed me to write this post about the preferences.