
You can use FunctionModuleActionHandler to handle execution of items for which a workflow is executed through a given function module.
Provider specific Information
FunctionModuleActionHandler supports WebFlowConnector provider. Items must belong to the WebFlowConnector .
Supported Actions
Action name can be anything.
Properties
FunctionModuleActionHandler expects the following properties:
FunctionModule (mandatory)
A Function Module to execute the workflow.
DeleteItem (optional)
This is a flag, indicating that the item should be removed from the cache after executing the function module. The values are true and false . Default is true .
All other properties are passed to the function module as input parameters.
Special Properties
If the function module doesn't have a standard export structure ( RETURN_CODE as an export parameter and a table MESSAGE_LINES ), a special property name UWL_RETURN_CODE can be provided. And if the return code is not 0 (success), the return error message will be queried by calling export parameter UWL_RETURN_MESSAGE if the message is in the export parameter, or UWL_RETURN_TABLE and UWL_RETURN_TABLE_PARAMETER if the message is in the table (see example below)
If there are input properties that have to be set in the table (structure), it can be done the following way:
<Property name="UWL_TABLE_IN1" value=table name> , so the first special property name is UWL_TABLE_IN# where # is the number of the table affected in input. Then corresponding table parameters will have property names UWL_TABLE_IN1_ROW#_PARAMETER# :
<Property name="UWL_TABLE_IN1_ROW1_PARAMETER1" value="parameter 1">
<Property name="UWL_TABLE_IN1_ROW1_PARAMETER2" value="some other parameter for the table UWL_TABLE_IN1"> ...
And the third corresponding property is UWL_TABLE_IN#_PARAMETER#_VALUE :
<Property name="UWL_TABLE_IN1_ROW1_PARAMETER1_VALUE" value="parameter 1 value">
Configuration for FunctionModuleActionHandler is done in a custom XML for an item type, for which a workflow executed through a given function module is defined.
Following is the definition of an item type for which a workflow with two terminating events (approved and rejected) is defined. The sample task TS91100019 is defined as a vacation approval form of type FORMABSENC and it is executed through a function module SAP_WAPI_CREATE_EVENT :
<ItemType name="uwl.task.approval.webflow.TS91100019" connector="WebFlowConnector"
defaultView="WorkItemsApprovalView">
<ItemTypeCriteria connector="WebFlowConnector" externalType="TS91100019"/>
<Actions>
<Action name="approve" groupAction="yes" handler="FunctionModuleActionHandler">
<Properties>
<Property name="FunctionModule" value="SAP_WAPI_CREATE_EVENT"/>
<Property name="OBJECT_TYPE" value="FORMABSENC"/>
<Property name="EVENT" value="approved"/>
<Property name="OBJECT_KEY" value="${item.externalObjectId}"/>
<Property name="COMMIT_WORK" value="X"/>
<!-- special return parameters -->
<Property name="UWL_RETURN_CODE" value="RET_MESS"/>
<!-- special input parameters -->
<Property name="UWL_TABLE_IN1" value="INPUT_CONTAINER"/>
<Property name="UWL_TABLE_IN1_PARAMETER1" value="ReleaseCode"/>
<Property name="UWL_TABLE_IN1_PARAMETER1_VALUE" value="EX"/>
</Properties>
<Descriptions default="Approve"/>
</Action>
<Action name="reject" groupAction="yes" handler="FunctionModuleActionHandler">
<Properties>
<Property name="FunctionModule" value="SAP_WAPI_CREATE_EVENT"/>
<Property name="OBJECT_TYPE" value="FORMABSENC"/>
<Property name="EVENT" value="rejected"/>
<Property name="OBJECT_KEY" value="${item.externalObjectId}"/>
<Property name="COMMIT_WORK" value="X"/>
<Property name="UWL_RETURN_CODE" value="RET_MESS"/>
<Property name="UWL_TABLE_IN1" value="INPUT_CONTAINER"/>
<Property name="UWL_TABLE_IN1_PARAMETER1" value="ReleaseCode"/>
<Property name="UWL_TABLE_IN1_PARAMETER1_VALUE" value="EX"/>
</Properties>
<Descriptions default="Reject"/>
</Action>
</Actions>
</ItemType>