Developing Duet time approval scenario using Workflow Template 1.0 Part 3
After some busy working on SAP configuration and ABAP coding, now it is time to explore the Duet workflow offerings in MS office front-end. However I should even take one step back and explain to you how the scenario should look like, before I start explaining Visual Studio, .NET C# coding etc. 🙂 No, don’t worry, there will be no coding for the Outlook UI.
In SAP HR, employee usually enters time in CATS. If the system is configured to use workflow, those time entries will be sent to manager’s SAP workplace inbox. Now with Duet, instead of getting the approval in manager’s workplace inbox, manager gets an Outlook approval email, together with a corresponding Outlook task created as well. Manager can then approve directly either from Outlook email or task. It is not a link back to SAP system but manager will use an actual approve/reject button.
What’s more, manager can reassign the approval, or find a substitute approver when he/she is on vacation. The substitute approver will receive and approve the employee’s time entries while the manager is out of the office. Of course, the substitute approver must have Duet client installed in his/her machine in order to handle the approval. The workflow could have multiple approvers (an “OR” relationship, only need either of the approvers to make a decision) or parallel approvers (an “AND” relationship, all the approvers must make decisions). And there could be multiple steps for the approval workflow. That is just the basic idea of Duet Workflow Template, there are more features but I am not going to cover them all here. Below please see example pictures of Outlook time approval email.
Approver clicks on approve button and enter approval note. Decision will be sent to SAP and trigger next step of the workflow.
Approver reassigns the request to a different manager.
Ok, now let’s back to our topic of Outlook UI configuration.
Workflow Template 1.0 comes with a Visual Studio (VS) configuration tool. As developer, you install Workflow Template VS configuration tool in your development machine. It is used to customize the Time Approval email/task UI that meets your corporation’s business requirements. Below is what you should see at Windows Add/Remove Programs after you install Duet workflow template VS configuration tool.
You can use the VS configuration tool to define Duet Workflow Template project that controls Duet Approval Email/Task UI and behaviors. For my time approval Outlook UI, I created a new Visual Studio 2005 project under the type Duet. As shown below in the screenshot.
Once I created the project, the configuration tool will be opened. The configuration tool includes two main areas – “Model Data Source” and “Workflow Item: mail and task”. The “Model Data Source” defines what business parameters passed from SAP system. The “Workflow Item: mail and task” defines how SAP data are presented at Outlook approval mail and task UI.
2.1 Model Data Source
When I open the “Model Data Source”, I can add SAP parameters as shown in the following screenshot. Please notice this is the data that I added in the SAP ABAP outbound custom handler for XPROP, as I described at blog part II. Please make sure to use exactly the same name here as you defined in the ABAP outbound custom handler.
2.2 Workflow Item Actions
In the area of “Workflow Item: mail and task”, you can define Workflow Item Actions and Workflow Approval Details action panel regions. Action items decide what actions approver can take for the Outlook approval items. For my time approval example, I only want the actions as approve, reject and reassign. No need to use reserve and release, as there always has one single approver for the workflow template. Therefore, I disabled reserve and release buttons at the action items window shown as the below screenshot.
2.3 Workflow Approval Details Regions
When user clicks on the button “Workflow Approval Details” from an approval mail, a task panel will be popped up. Please refer to the example Time Approval email screenshot shown earlier in the session. Information from the task panel will help approver make decision against the approval subject. You can retrieve SAP backend data as you defined at the Model Data Source earlier and display them in the task panel region. There are couple regions in the task panel. Some you can customize and some are system controlled. If they are system controlled, you cannot do anything with them.
One of the regions you can use to display SAP backend data is called Object Identification Region. OID region displays requestor name, workflow item submitted date and status. You can add SAP data to OID region here by selecting them from Model Data Source. Or even more, you can add a brand new OID region to display a whole new set of data. For example, for time approval, if I want, I can display in a new OID region percentage of recorded or missing working hours for a requestor. Of course, this data need to be determined in SAP backend and passed from outbound custom handler XPROP structure.
Another region you can play around is called “You Can Also Region”. You can use this region to display static and dynamic links. For example, for time approval, I can display a static link here called “Company Time Card Policy”. Or for a dynamic link, I can use the workflow item ID passed from the Model Data Source and render a link here which will send approver back to the portal for a specific workflow item.
There are three more regions – Branding Region, Dynamic Message Region, and History Region. These regions will be system rendered and you cannot customize them. No need to explain branding region, it just displays the Duet brand. Dynamic Message Region displays system messages, for example information message from backend asking you to approve the request or system error message if there is a sync error to SAP. History region shows the road map of the SAP workflow. This will be useful if the workflow has multiple steps or multiple approvers at the same step.
Once I finish customizing the Outlook approval UI. I then compiled it and built the metadata into a SCA file so that I can deploy it into the Duet server. This is quite simple, you just click the button release in Visual Studio 2005 and a SCA will be created in a local folder. But of course, to make the compile smooth I need to install ANT and JDK in my local development machine. You can find the detailed information for ANT and JDK in the Duet Workflow Configuration Guide shipped together with the Duet software.
If the project compiles successfully, a “Generation Finished Successfully” message window will come up. Check option “Open Generated content folder when generation completes” and click on OK. This will open the generation target folder for the SCA file. Now I just need to copy that SCA to Duet server and deploy it to the landscape.
After deployment, the last step is to refresh the Duet client metadata for the manager machine. Now with the Time Approval Workflow metadata and all the work done at Part I and II, manager will be able to receive and approve time entries directly from Outlook.
As you can see, Duet workflow configuration tool is quite simple to use. One thing that you need to pay attention is to match what parameters you pass from SAP outbound custom handler to what you define at VS configuration tool Model Data Source. Make sure they are in sync. Otherwise, the approval mail will not be promoted to approver’s inbox.
That brings up another topic that is worth talking – testing and trouble-shooting the whole approval process from Outlook to SAP. For that I should dedicate another blog to cover them.
Please let me know what you think. What should be improved in the blog or even in the product itself? Thanks!