There are cases that item execution is fairly straightforward operation, such as user decisions. Selecting option for an individual task can easily be done along with the other similar tasks. For example, a user can choose to withdraw from or revise an application, an employer can approve or reject multiple requests at one time.
For example; a user can choose Reject or Accept for a work item and / or for multiple items and submit decisions.
There are three common scenarios for providing options for users to choose and complete the task. they are:
Generic User Decision
Terminating Events
Work item Completion with Container Update
Generic User Decision
In SAP Business Workflow, user can define a task as a decision task by assigning DECISION as the underlying business object type. The task definition allows user to create two or more decision options to complete the task. Refer to the standard generic user decision task TS00008267 .
During runtime, UWL retrieves the available options from the workflow provider and these options are visible in the detail view of the item.
It is also possible to display these decision options directly in the UWL list and execute the decisions, provided technical data of decision options is known in advance and can be configured in the configuration file, for example: Revise or Withdraw (a rejected request)
The main update is the definition under your customized view (<View> section). Below shows a sample to display two options as checkbox to either revise a request (with internal value 1) or withdraw from a request (with internal value 2):
<DisplayAttributes> <DisplayAttribute name="reviseCol" type="checkbox" width="" actionRef="1" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description="Revise"/> </ShortDescriptions> </Descriptions> </DisplayAttribute> <DisplayAttribute name="dropCol" type="checkbox" width="" actionRef="2" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description="Withdraw"/> </ShortDescriptions> </Descriptions> </DisplayAttribute>
(Optional): Include custom attributes in the view for each item to assist the decision making process.
The following steps describe how to configure the UWL to display decision options from items of the generic user decision type TS00008267 in your own view myRejectedRequestView
Open your existing configuration XML file, or create a new one as described in ý0.
Add a new item type within the <ItemTypes> tag with a unique type name:
<ItemType name="uwl.task.webflow.decision.TS00008267" connector="WebFlowConnector" defaultView="myRejectedRequestView">
</ItemType>
Map the new type to a backend task id (which is the external type) by specifying the item type criteria within the <ItemType>:
<ItemTypeCriteria
externalType="TS00008267" connector="WebFlowConnector"/>
Do not specify the systemid attribute. It is recommended to keep the configuration independent of a specific system. The system, to which the configuration should apply to, is better specified in the upload page (Adapt to system).
Define view to include the display of the decision options as check boxes
<Views> <View name="myRejectedRequestView" width="98%" supportedItemTypes="uwl.task.webflow.TS00008267" columnOrder="attachmentCount, detailIcon, subject, priority, creatorId, createdDate, reviseCol, dropCol" sortby="priority" selectionMode="SINGLESELECT" tableDesign="STANDARD" visibleRowCount="10" headerVisible="yes" tableNavigationFooterVisible="yes" tableNavigationType="CUSTOMNAV" actionRef=""> <Descriptions default="Rejected Requests"> <ShortDescriptions> <Description Language="en" Description="Rejected Requests"/> </ShortDescriptions> </Descriptions> <DisplayAttributes> <DisplayAttribute name="reviseCol" type="checkbox" width="" actionRef="1" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description="Revise"/> </ShortDescriptions> <LongDescriptions> <Description Language="en" Description="Revise the request"/> </LongDescriptions> </Descriptions> </DisplayAttribute> <DisplayAttribute name="dropCol" type="checkbox" width="" actionRef="2" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description=" Withdraw"/> </ShortDescriptions> <LongDescriptions> <Description Language="en" Description="Withdraw from the request"/> </LongDescriptions> </Descriptions> </DisplayAttribute> </DisplayAttributes> …………….other definitions go here <Actions> <!-- the user decisions are for rendering in the column, not in the tool bar. Option Revise has internal value 1 and option Withdraw has internal value 2 and both are to be handled by the UserDecisonHandler--> <Action name="1" userDecision="yes" handler="UserDecisionHandler "/> <Action name="2" userDecision="yes" handler="UserDecisionHandler "/> <!-- the following referenced actions are defined in uwl.standard --> <Action reference="submitUserDecisions" /> …………….other definitions go here </Actions> </View> </Views>
Save the xml definition and verify the validity in Internet Explorer .
Upload the configuration.
Create a work item of this task for a user, and go to UWL page. A link of the newly defined view 'Rejected Requests' should be visible.
Terminating events
Definite terminating events can also be displayed for users to pick as user decision options, for example: Approve or Reject, and then complete the item. In Business Workflow, there is this section in task definition that user can create terminating event(s) .
This can be specified in the configuration file to enable the options in the view with extra columns when the terminating event id is known.
The main update is the definition under the itemtype for such task and your customized view (<View> section), refer to previous section Generic User Decision. Details in the following table.
(Optional): Include custom attributes in the view for each item to assist the decision making process.
The following steps describe how to configure the UWL to include terminating events Approved and Rejected as user decision and display these 2 options as checkboxes in the view for task TS91100019
Open your existing configuration XML file, or create a new one as described in ý0.
Add a new item type within the <ItemTypes> tag with a unique type name:
<ItemType name="uwl.task.webflow.TS91100019" connector="WebFlowConnector" defaultView=" myApprovalRejectView_TE">
</ItemType>
Map the new type to a backend task id (which is the external type) by specifying the item type criteria within the <ItemType>:
<ItemTypeCriteria
externalType="TS91100019" connector="WebFlowConnector"/>
Do not specify the systemid attribute.
Include the action definition for the <ItemType> with the precise event id as action name, add the definition accordingly within the <Action> block:
<ItemTypes> <ItemType name="uwl.task.webflow.TS91100019" connector="WebFlowConnector" …………………………….other definitions go here> … <Actions> <Action name="approved" userDecision="yes" handler="TerminatingEventHandler"> <Descriptions default="Approve"/> </Action> <Action name="rejected" userDecision="yes" handler="TerminatingEventHandler"> <Descriptions default="Reject"/> </Action> </Actions> …………………………….other definitions go here> </ItemType> ….. </ItemTypes>
Define view to include the display of the decision options as check boxes
<Views> <View name=" myApprovalRejectView_TE" width="98%" supportedItemTypes="uwl.task.webflow.TS91100019" columnOrder="attachmentCount, detailIcon, subject, priority, creatorId, createdDate, rejectCol, approveCol" sortby="priority" selectionMode="SINGLESELECT" tableDesign="STANDARD" visibleRowCount="10" headerVisible="yes" tableNavigationFooterVisible="yes" tableNavigationType="CUSTOMNAV" actionRef=""> <Descriptions default="My Reject Approval_TE"> <ShortDescriptions> <Description Language="en" Description=" My Reject Approval_TE"/> </ShortDescriptions> </Descriptions> <DisplayAttributes> <DisplayAttribute name="rejectCol" type="checkbox" width="" actionRef="rejected" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description="Reject"/> </ShortDescriptions> </Descriptions> </DisplayAttribute> <DisplayAttribute name="approveCol" type="checkbox" width="" actionRef="approved" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description="Approve"/> </ShortDescriptions> </Descriptions> </DisplayAttribute> </DisplayAttributes> …………….other definitions go here <!-- the user decisions are for rendering in the column. Option Approve and option Reject are both to be handled by the TerminatingEventHandler --> <Actions> <Action name="approved" userDecision="yes" handler="TerminatingEventHandler"> <Descriptions default="Approve"/> </Action> <Action name="rejected" userDecision="yes" handler="TerminatingEventHandler"> <Descriptions default="Reject"/> </Action> <!-- the following referenced actions are defined in uwl.standard --> <Action reference="submitUserDecisions" /> …………….other definitions go here </View> </Views>
Save the xml definition and verify the validity in Internet Explorer.
Upload the configuration.
Create a work item of this task for a user, and go to UWL page. A link of the newly defined view My Reject Approval_TE should be visible. Click on the link and view (depends on your configuration, with or without custom attributes).
Work Item Completion with Container Update
A special handler in UWL to simply complete the task item and update the Business Workflow container with the specified data in the configuration file under the <ItemType> section defined for the item.
No particular prerequisite in Business Workflow required.
The main update is the definition under the itemtype for such task and your customized view (<View> section).
The following steps describe how to configure the UWL to include options Option1 and Option2 as user decision and display them as checkboxes in the view. Each option, implicitly, will update the webflow container accordingly and complete the item of type TS91100019.
Open your existing configuration XML file, or create a new one.
Add a new item type within the <ItemTypes> tag with a unique type name:
<ItemType name="uwl.task.webflow.TS91100019" connector="WebFlowConnector" defaultView="webflowView">
</ItemType>
Map the new type to a backend task id (which is the external type) by specifying the item type criteria within the <ItemType>:
<ItemTypeCriteria
externalType="TS91100019" connector="WebFlowConnector"/>
Do not specify the systemid attribute.
Specify the action handler for the <ItemType> as 'UpdatingContainerHandler'.
<ItemTypes> <ItemType name="uwl.task.webflow.TS91100019" connector="WebFlowConnector" …………………………….other definitions go here> <ItemTypeCriteria connector="WebFlowConnector" externalType="TS91100019" /> <Actions> <Action name="option1" userDecision="yes" handler="UpdatingContainerHandler" > <Descriptions default="Option1"/> <Properties> <Property name="param1" value="value1"/> <Property name="param2" value="value2"/> <Property name="param3" value="value3"/> </Properties> </Action> <Action name="option2" userDecision="yes" handler="UpdatingContainerHandler" > <Descriptions default="Option2"/> <Properties> <Property name="param4" value="value4"/> </Properties> </Action> </Actions> …………………………….other definitions go here> </ItemType> ….. </ItemTypes> <Views> <View name=" myCompleteItemView_CU" width="98%" supportedItemTypes="uwl.task.webflow.TS91100019" columnOrder="attachmentCount, detailIcon, subject, priority, creatorId, createdDate, option1Col, option2Col" sortby="priority" selectionMode="SINGLESELECT" tableDesign="STANDARD" visibleRowCount="10" headerVisible="yes" tableNavigationFooterVisible="yes" tableNavigationType="CUSTOMNAV" actionRef=""> <Descriptions default="My Simple Complete View"> <ShortDescriptions> <Description Language="en" Description="My Simple Complete View"/> </ShortDescriptions> </Descriptions> <DisplayAttributes> <DisplayAttribute name="option1Col" type="checkbox" width="" actionRef="option1" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description="Option1"/> </ShortDescriptions> </Descriptions> </DisplayAttribute> <DisplayAttribute name="option2Col" type="checkbox" width="" actionRef="option2" vAlign="TOP" hAlign="CENTER"> <Descriptions default=""> <ShortDescriptions> <Description Language="en" Description="Option2"/> </ShortDescriptions> </Descriptions> </DisplayAttribute> </DisplayAttributes> …………….other definitions go here <!-- the user decisions are for rendering in the column. Option Option1 and option Option2 are both to be handled by the UpdatingContainerHandler -- > <Actions> <Action name="option1" userDecision="yes" handler="UpdatingContainerHandler" > <Descriptions default="Option1"/> <Properties> <Property name="param1" value="value1"/> <Property name="param2" value="value2"/> <Property name="param3" value="value3"/> </Properties> </Action> <Action name="option2" userDecision="yes" handler="UpdatingContainerHandler" > <Descriptions default="Option2"/> <Properties> <Property name="param4" value="value4"/> </Properties> </Action> <!-- the following referenced actions are defined in uwl.standard --> <Action reference="submitUserDecisions" /> <!-other definition goes here -- >
Save the xml definition and verify the validity in Internet Explorer .
Upload the configuration.
After completing the item in UWL, verify the Business Workflow container content in the SAP Business Workflow that it is updated with the specified values.