This document is part 6 of what builds on my other example: " Part 5: basic HCM Process and Forms scenario (Backend Service)" which can be accessed at: http://scn.sap.com/docs/DOC-35622
You can use any HCM Process you have created for this sample Workflow exercise. The objective of the exercise is to know how to create a WorkFlow for use with HCM Process and Forms. For this example I will use the ZPR6 process that I have been building on in the prior exercises.
Create a Workflow Template and select the “Workflow Builder” button:
Since this WF will communicate with the Process Object from Process and Forms, we need to add a custom container element to allow the data exchange using CL_HRASR00_WF_PROCESS_OBJECT.
Open the WF Container and double-click “Double-Click to Create”:
Enter the new container element as follows:
Now we need to specify that the workflow template will be started by the event “TRIGGERED” from class CL_HRASR00_WF_PROCESS_OBJECT. The procedure follows:
Result:
Since we have now added the custom container element for the Process Object, we need to define a programming exit so that the WF can communicate with the process object. In Basic Data, choose Version-Dependent (Current Workflow Version) tab page. Choose the Program Exits tab and enter: CL_HRASR00_POBJ_WF_EXIT. Press the enter key to check. See below for results:
Now we have defined our basic WF shell, we also need to setup Event Type Linkage. This allows the process object to fire our start up event (TRIGGERED) and have a listener waiting to start the WF. For this we use transaction: SWETYPV select the following entry for your WF: (mine is WS90300159)
Result:
Select the row and then choose “Details”. Enter HR_ASR_CHECK_EVENT in the Check Function Module field and then save you changes:
Now you are ready to actually add some steps to the WF which will process the form. Display the “My Workflows and Tasks” menu bar:
Result:
Double-click the new “Process Form” icon in the Graphical Model area to display the Process Form workflow step details and enter wf_initiator as follows:
What did we do? We created a single step WF which sends the “Process Form” task to the initiator. The initiator will receive an inbox item which they can process and update the SAP back end. This is obviously not a real world scenario, but I’m just trying to show how to create the WF. You will have some other business process.
Choose the “Binding (Exists)” pushbutton and make the following changes:
Result:
Determine the form scenario to use (Ties our WF Step to our form scenario).
Result:
Determine the form scenario step to use (Ties our WF Step to our form scenario STEP).
Result:
For this WF step, we need to add the needed Program Exit to communicate with the HRASR framework. Select the Program Exits tab for this task and enter the following class: CL_HRASR00_POBJ_WF_EXIT:
Now we need to tell the Workflow which Form Scenario we expect it to use.
Display your WF container and double click the container element “FORM”. Go to the “Initial Value” tab and enter your scenario:
Save and Activate your WF. The simple WF is now completed. However, you now need to tell your process to use the WF. Go to your process in design
time and add this WF ID to your configuration as follows:
Now you can test your form. If you fill out the form, you will also get the WF in your inbox. The inbox I’m referring to is the HCM Process and Forms inbox which you can access via the portal (or just use transaction SWIA to see the WF in the WF tool). Remember, you set the WF task to be processed by the initiator. This is just a basic example of creating the WF for Process and Forms. It should be everything you need as a foundation for creating much more extensive business process workflows in P&F. Have fun.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
10 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 |