Definition
It is common to redirect the user to/from different features or user task using action buttons or after completing a feature.
Sometimes it is also useful to provide values from the current context to the next one, such as initializing form fields with values entered in the previous features.
URL schemes
There are two URL schemes available to redirect to features and user task respectively:
Feature
The scheme starts with feature:// followed by the id of the feature and eventually the object id.
Exemple: feature://my-user-card-read/john.doe.
For features nested inside a hub, the scheme accepts a dotted notation to reference the feature:
Example: feature://my-hub-feature.a-feature-in-hub/john.doe
User access rights to the feature(s) will be checked when resolving the link.
User Task
The scheme starts with task:// followed by a valid action and eventually an id.
The available actions are:
to-approve
submitted-requests
about-me
admin
Example: task://to-approve/1234
Contexts
Links can be templated using context variables.
routeObjectId: A shortcut for “object.id”
object: The current object of a feature (access or set attributes of the object using “object.<attribute id>”)
field: Field values (note that “Fields” are not attributes, they are input in a form that are not linked to the attributes of an object. To read or set attributes, use the “object” context).
user: The current user (access its attributes using “user.<attribute id>”)
dataKey: Access to a row element in a list (same as the “row” context)
row: Access to a row element in a list
widgetData: Available in some specific widget to access their context data
workflow: Access workflow information (contains “id” for the workflow id and “taskInstanceId” for the task instance id)
Use cases
Redirect to a feature from an action button
XML
<action id="view-object-card" xsi:type="ctdbum:ButtonWidgetType">
<hidden>false</hidden>
<config>
<link>feature://object-card-read/{object.id}</link>
<linkTarget>SELF</linkTarget><!-- or NEW_TAB -->
<outline>true</outline>
<size>XS</size>
</config>
</action>
Redirect to a feature in an action button in a list row
XML
<action id="view-object-card" xsi:type="ctdbum:ButtonWidgetType">
<hidden>false</hidden>
<config>
<link>feature://object-card-read/{dataKey.id}</link><!-- dataKey is the context of the row (the "row" context is an alias for dataKey) -->
<linkTarget>SELF</linkTarget><!-- or NEW_TAB -->
<outline>true</outline>
<size>XS</size>
</config>
</action>
Redirect to a feature that creates a child organization from a parent organization
In this use case we want to provide a button in an organization feature that allows creating a child organization. We want to initialize the parentOrganization attribute of the child organization for convenience.
Redirect to a feature that creates a child organization from a parent organization
XML
<action id="create-child-organization" xsi:type="ctdbum:ButtonWidgetType">
<hidden>false</hidden>
<config>
<icon>fa fa-plus</icon>
<label>true</label>
<link>feature://test_organization-create?object.parentOrganization={object.id}</link><!-- This assumes that the test_organization-create screen's contains an attribute editor with attributeId "parentOrganization" -->
<linkTarget>SELF</linkTarget>
<outline>true</outline>
<size>XS</size>
</config>
</action>
Redirect to another feature after the execution of a feature
Use the “completionRedirectURL” option of a feature to redirect to another feature after the current feature is submitted.
Redirect to another feature after the execution of a feature
XML
<ctdbum:FeatureConfiguration xmlns:ctd="http://www.memority.com/citadel/1_0" xmlns:ctdbum="http://www.memority.com/citadel/bum/1_0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="simple-role-publication-card-create">
<name>simple-role-publication-card-create</name>
<description>Create a new role publication</description>
<type>CREATE</type>
<scope>...</scope>
<options>
<completionRedirectURL>feature://simple-role-publication-view/{routeObjectId}</completionRedirectURL>
<!-- or feature://simple-role-publication-view/{object.id} -->
...
</option>
</ctdbum:FeatureConfiguration>
Provide the user task instance id to another feature and use it to return to the user task after completion
For this use case we will need to provide the user task instance to another feature, save it somewhere and use it when completing the feature.
We will save the task instance id in a hidden field.
In the user task screen, provide a link to the desired feature and initialize a field with the task instance id:
Workflow screen action button configuration
XML
<action id="edit-entry-btn" xsi:type="ctdbum:ButtonWidgetType">
<hidden>false</hidden>
<config>
<icon>fa fa-edit</icon>
<link>feature://business-role-edit/{widgetData.id}?field.myTaskInstance={workflow.taskInstanceId}</link>
<linkTarget>NEW_TAB</linkTarget>
<outline>true</outline>
<size>XS</size>
</config>
</action>
Feature screen
Use the “completionRedirectURL” and your field value to redirect back to the user task.
Feature screen
XML
<ctdbum:FeatureConfiguration xmlns:ctd="http://www.memority.com/citadel/1_0" xmlns:ctdbum="http://www.memority.com/citadel/bum/1_0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="business-role-edit">
<name>business-role-edit</name>
<description>Edit a business role</description>
<type>UPDATE</type>
<scope>...</scope>
<options>
<completionRedirectURL>task://to-approve/{field.myTaskInstance}</completionRedirectURL>
...
</option>
<screen>
....
<widget id="field" xsi:type="ctdbum:FieldEditorWidgetType">
<fieldId>myTaskInstance</fieldId><!-- The taskInstanceId will be saved in this hidden field -->
<hidden>true</hidden>
<config>
<editor>
<editWidget xsi:type="ctdbum:TextInputEditWidgetType">
<hidden>true</hidden>
<config>
</config>
</editWidget>
</editor>
<label></label>
<lockedInUi>false</lockedInUi>
<mode>READ_WRITE</mode>
</config>
</widget>
</screen>
</ctdbum:FeatureConfiguration>
Read Next