Você está na página 1de 54

How-to Guide

Developing a Decision Making Scenario using Duet Approval Workflow Template


Version 1.5 March 2010

Copyright 2009 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

Contents 1 Introduction................................................................................................................ 5 1.1 Target Audience ................................................................................................ 5 1.2 Duet Approval Workflow Template Overview ..................................................... 5 1.2.1 1.3.1 1.3.2 1.3.3 2 How an Approval Workflow Application Works in Duet ........................... 6 Prerequisites .......................................................................................... 7 Terms ..................................................................................................... 8 SAP Notes.............................................................................................. 8 1.3 Creating Your Approval Workflow Application .................................................... 7

Configuring the SAP System for Your Workflow Application ...................................... 9 2.1 Scheduling Core Workflow Reports for Use in Duet ......................................... 13 2.1.1 2.1.2 Defining an OSP Filter.......................................................................... 13 Scheduling Reports .............................................................................. 15

2.2 Maintaining Status Mapping ............................................................................. 16 2.3 Workflow Application Handlers......................................................................... 17 2.3.1 2.3.2 2.3.3 2.3.4 Customizing Custom Handlers ............................................................. 18 Customizing the Default Custom Handler for Use in Application-specific Custom Handler .................................................... 21 Using the Default Custom Handler Together with your Application-specific Custom Handler .................................................... 22 Configuring the Body and Subject of your Emails and Tasks................ 22

2.4 Workflow Default RFC and Application Custom Handler RFC.......................... 29 2.5 Creating Client Proxy Objects for Groupware Objects...................................... 29 2.5.1 2.6.1 2.6.2 2.6.3 2.6.4 3 ABAP Client Proxies............................................................................. 29 Defining an RFC Destination for the Action Item and Email Proxy ........ 30 Assigning an RFC Destination to a Logical Port for the Action Item and Email Proxy ................................................................ 32 Configuring Communication Destinations for Role Management .......... 32 Assigning an RFC Destination to a Logical Port for Role Management ................................................................................ 33 2.6 Configuring Logical Ports and Remote Destinations ........................................ 30

Installing the Duet Approval Workflow Configuration Tool........................................ 34 3.1 Overview of the Duet Approval Workflow Configuration Tool ........................... 34 3.2 Gathering Information for Your Approval Workflow Application ........................ 36 3.3 Post-Installation Procedures ............................................................................ 36 3.4 Creating a New Duet Approval Workflow Configuration Template.................... 37

Customizing the Duet Approval Workflow Template ................................................ 37 4.1 Modifying the Default Model............................................................................. 38 4.2 Editing the Model Data Source Entity............................................................... 40 4.3 Editing the Workflow Item: Mail and Task Entity............................................... 43 4.4 Editing the Action Pane Entity .......................................................................... 44 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 Editing the Object Identification Region ................................................ 45 Editing the You Can Also Region ......................................................... 46 Editing the Links List Region ................................................................ 48 Editing the History Region .................................................................... 49 Editing the Details Region .................................................................... 49

Generating the Files for Your Approval Workflow Application .................................. 49 5.1 Generating the Application Files ...................................................................... 50 5.1.1 5.1.2 5.1.3 Configuring the Application Package and Deployment ......................... 51 Translating your Workflow Application .................................................. 52 Deploying Your Application .................................................................. 53

6 7

Removing a Workflow Application ........................................................................... 54 Uninstalling the Duet Approval Workflow Configuration Template ........................... 54

1 Introduction
This document describes how to create an Approval Workflow application using the Duet Approval Workflow template. In addition, it describes the Duet Approval Workflow Configuration tool with which you modify the Duet Approval Workflow template. Using the Duet Approval Workflow template, developers, modelers, and system integrators can create and package Duet Approval Workflow applications for use in Microsoft Office Outlook.

1.1 Target Audience


Developing a Duet Approval Workflow application requires knowledge in technologies from both Microsoft and SAP. For this reason, the target audience of this document includes people familiar with the following: Skill SAP Business Workflow developer/consultant ABAP developer Business Process expert/.NET Developer SAP system administrator/service engineer Description Developing a business workflow in an SAP system.

Customizing the connectivity code between an SAP system and the Duet application. Modeling the Approval Workflow application using the Duet Approval Workflow Configuration tool. Supporting deployment processes of SAP packages and configuration of systems and Duet environment.

1.2 Duet Approval Workflow Template Overview


The Duet Approval Workflow template enables you, the developer, to create an Approval Workflow application for use in Duet. You can use the template to create a number of approval workflow applications for use with more than one SAP system. You can customize and use the Duet Approval Workflow template based on the SAP Business Workflow to create an approval workflow application containing the actions and features approvers need, along with decision supporting information. Business processes require at least one person to complete a series of tasks. Such processes can benefit from approval workflow applications which automate the tasks, thereby reducing costs, removing errors, speeding processes, and tracking the status of the process. An approval workflow application in Duet lets you automate tasks, which often involve automatically sending mail messages such as making a request for a trip or for vacation.

A business process enabled as an approval workflow application in Duet is initiated by a request. One or more approvers can approve or reject the request, reassign it to someone else, designate someone else in place of an approver for a period, or reserve a request for a later response. In addition, approvers have access to relevant information in Microsoft Office Outlook to help them make an informed decision. The Duet Approval Workflow template supports all types of approver relationships, as defined in the SAP system. The following are the common types of approver relationships: Types Single approver Parallel approvers Description There is only one approver for a request. This is a simple and common workflow. There is an 'AND' relationship between several approvers. Requires all approvers of a particular step to approve a request for the flow to be complete. A rejection by any of the approvers stops and completes this step in the process. For example, both John and Jane must approve a leave request. Multiple approvers There is an 'OR' relationship between several approvers. Requires only one of the approvers to approve or reject the request to complete the task. For example, John, Jane or Bob can approve a leave request. Combined A combination of the types of approver relationships is possible in the template. One of the steps can consist of a single approver while other steps consist of multiple or parallel approvers.

1.2.1 How an Approval Workflow Application Works in Duet


When a request is initiated, it triggers some processes in the SAP system. The SAP system sends a mail and a business task to the approver and the status of the task is set to Waiting for Approval. When the approver approves the request, its status changes to Approved and a message with the new status is displayed in the approvers Duet client (Action Pane). The requestor receives a message confirming the approval in the SAP system inbox. When a step in the task is completed, the request moves on to the following step, the SAP system is updated accordingly, and the requester receives a notification and status information. The request is completed when all the tasks are completed. However, if a request is rejected, then the process is terminated and all approvers at that stage are informed. For example, you can model a workflow application describing the business rules about how a transaction involving the accounts, is approved, rejected or assigned to another person for them to approve.

Travel Request: An Example of an Approval Workflow Application Lances receives a request in his Inbox and opens the trip request from John. He decides to approve the request and adds some comments. The approval process is triggered in the SAP Business Workflow application running in an SAP system, and John receives a mail notifying him of the approval.

1.3 Creating Your Approval Workflow Application


Before you create a Duet Approval Workflow application, carefully plan the actual workflow. There are approval workflow applications already in use in the SAP system. Using the Duet Approval Workflow template, you can enable these existing approval workflow applications for use in Microsoft Office Outlook. To create a completely new approval workflow application for use in Duet, first create it in your SAP system, and then customize and extend it using the Duet Approval Workflow template. By default, the Duet Approval Workflow template provides you with mailing features for your approval workflow application, however, you must decide on the type of approver relationship you want to implement. Doing so allows you to identify the various requirements of the application, such as the roles to enable in the application. In addition, you can identify the various steps and tasks associated with a role, and are able to create an outline of the relationship between the roles. The following is a summary of the sequence of tasks for creating an approval workflow application in Duet: 1. Ensure that the approval workflow application (template) you want to create in Duet already exists in the SAP system. 2. Configure the SAP system for the approval workflow application. 3. Gather information about the approval workflow application. 4. Install the Duet Approval Workflow template. 5. Customize the Duet Approval Workflow template to enable you to create a model of your approval workflow application for use in Duet. 6. Generate the files for the approval workflow application. 7. Deploy the approval workflow application for use in Duet.

1.3.1 Prerequisites
After planning the approval workflow application, make provisions for its requirements. However, the requirements of the Duet Approval Workflow template also determine your applications requirements. For your Duet approval workflow application, make sure that you have satisfied the following minimum requirements: Microsoft Windows 2003 Server SP2 Microsoft Office Outlook 2003, or a later version ANT 1.7 Microsoft Visual Studio 2005 (C# development mode) Duet 1.5 SP1 An SAP system using the SAP Business Workflow engine.

1.3.2 Terms
To use the Duet Approval Workflow template, you must familiarize yourself with the following terms: Term Entity Definition A building block in the model that represents one or more activities. Specifies the business logic that describes the use of the entities. Specifies a specific process with defined steps to accomplish a business goal. Provides the logic for making approval decisions in the Duet environment, and then in the SAP system. Captures the runtime instance of a workflow triggered by an application in the SAP system. Later, it broadcasts this instance to Duet, enabling the user to make a decision within the Duet environment.

Business Rule Business Task

Inbound Process Outbound Process

1.3.3 SAP Notes


Make sure that you read and implement the following SAP notes. You can find these notes at service.sap.com/notes. Note Number 1028938 Description Workflow Release Information Note Explanation Contains relevant information available after the release of Duet Approval Workflow Template.

2 Configuring the SAP System for Your Workflow Application


The Extended Notification Framework (ENF) in SAP NetWeaver is the interaction point between SAP Business Workflow and Duet Approval Workflow components. The ENF takes the instance status of an approval workflow runtime and sends this information to the Duet client. It focuses only on the decision making solutions. The overall process can be divided into the following two sub-processes: Outbound Process: Holds a runtime instance of the workflow triggered by an application in the SAP system and broadcasts the same instance to Duet, enabling the agent of the task to take decisions within the Duet environment. Inbound Process: Provides the mechanism for approval decisions from the Duet environment to the SAP system thereby reflecting the application object. Requirements SAP NetWeaver 7.0 SP15, or SAP NetWeaver 2004 SP22. The SAP system is configured to work with Duet 1.5 Use the following to configure your specific approval workflow application in Duet: Use the Pattern Configuration Manager to configure and customize your approval workflow application in the SAP system. Create logical ports and RFC destinations for existing client proxies to interface with the Duet Item Handler service in Java. The following are the proxies: CO_OSPWEMAIL_VI_DOCUMENT CO_OSPWACTION_ITEM_VI_DOCUMENT /OSP/CO_RMWRAPPER_VI_DOCUMENT /OSP/CO_CALENDAR_EVENT_VI_DOCU Note: You can use existing logical ports and RFC destinations that have already been configured to connect to the Duet Item Handler service. To configure the SAP system for your Duet approval workflow application: 1. Log on to the specific SAP system you have configured for use with Duet 1.5. 2. In the system command line, enter the transaction SIMGH and press Enter. 3. In the Edit IMG Structure screen, place your cursor in the IMG Structure field and press F4. 4. In the Find Structure screen, in the Title field, enter Duet Implementation Guide and click Execute.

5. From Workflow Pattern Customization choose Execute on Workflow Pattern Customization. The following parameters are displayed: Parameter Explanation Roles Roles must be predefined in your approval workflow application. You use the same roles as the roles in the workflow application in the SAP system. Double-click Roles under the Dialog Structure. The Change View screen opens, and you can see the roles for workflow applications.

Application Your workflow application must have the same identifier as the workflow Identifier application in the SAP system. This identifier is unique for the specific workflow application. For example, the workflow application Expense Approval Management: Trip Expense has the identifier EXAMTE. The default application ID in the Duet Approval Workflow template is WOMA. Double-click Applications under the Dialog Structure, to see the identifiers for all workflow applications in the SAP system.

10

Workflow

In the Workflow pane, view or enter the following: Application ID: View the application ID. Workflow ID: View and enter the Workflow ID from the template. Custom Handler Flag: Choose Outbound or Inbound. Counter: Specifies the sequence in which the custom handlers will be called at runtime. Version: Workflow template version. Custom Handler API: The Duet Approval Workflow template comes with the default custom handlers: Inbound custom handler: S_OSP_WF_PAT_DEFAULT_CH_IB Outbound custom handler: S_OSP_WF_PAT_DEFAULT_CH_OB For your workflow application, you must enter application-specific handlers to be invoked in the SAP system.

Tasks

You view and enter the following details of each Task in your Workflow application in the Tasks screen: Sub-Workflow ID: View or enter the name for a nested workflow which is part of a Workflow. Where there is no nested workflow in a Workflow, then enter the Workflow ID. Workflow Task ID: View or enter the task ID from the workflow template. Workflow Step ID: View or enter the step ID from the workflow template. This is called a step or node ID which uniquely identifies the step in a Workflow. Note: You can get the step ID from the Workflow Builder in the SAP system. On the left hand side of the Workflow Builder, there is a section called Navigation Area which displays all the steps of a workflow, including the step IDs.

11

Groupware Object Type: Specifies the groupware object type to be created for the specific task. The following groupware objects are supported in the Duet Approval Workflow template: Task Mail Recipient Role Type The groupware object can be sent to people with different roles. This field is a placeholder for storing bound-item details for various roles. Sub-Workflow Type: Specifies the type of Sub-workflow associated with a workflow. Task Agent Role ID: Specifies the name of the role for the agent assigned to the Workflow dialog task. Every Workflow dialog task has an Agent assigned to it. The role of the agent can be that of an Initiator, Approver, Reviewer, or Administrator. Groupware Bounditem Type: Specifies the client bound item type associated with the Workflow task for a given recipient role. The default bound item types in the Duet Approval Workflow template are: urn:sap:office:mySAP:Workflow.ApproverTask urn:sap:office:mySAP:Workflow.ApproverMail

12

Action

The Duet Approval Workflow template comes with a set of default actions based on the default application ID, WOMA. The default actions are set as active. Depending on your requirements, you can copy these actions to your Workflow application and set them as active. Doing so allows you to define the client behavior as you require. To copy the default actions: 1. Choose Copy Actions from Workflow Management. 2. Select the application and double-click Actions in the Dialog Structure pane.

3. Make sure the Active checkbox is selected for all the actions.

2.1 Scheduling Core Workflow Reports for Use in Duet


The ENF Core Workflow is used in Duet Approval Workflow applications. Thus, configurations of the core workflow are prerequisites for Duet Approval Workflow.

2.1.1 Defining an OSP Filter


To define a filter for Duet Approval Workflow in the SAP system: 1. Log on to the specific SAP system and, in the system command line, enter the transaction SIMGH, and then press Enter. 2. In the Edit IMG Structure screen, place your cursor in the IMG Structure field and press F4. 3. Enter Maintain Workflow Filter Settings and select the Execute icon. 4. Select Business Scenario and then OSP.

13

5. Double-click Filter Basic Data, and select the OSP_DELTA filter type.

6. Double-click Filter settings and under the TASK parameter enter the Workflow Task ID to use in the Duet Workflow application. To add more than one entry, specify a new index value.

7. Repeat steps 1-6 to define the same settings for OSP_FULL filter type.

14

2.1.2 Scheduling Reports


Schedule R/3 reports in the SAP system. To schedule a report to run: 1. Log on to the SAP system. The SAP Easy Access window is displayed. 2. Enter the transaction SM36 in the command line of the SAP Easy Access window. 3. Create a new job using the Job Wizard. a) Enter the Job name. b) Enter the Job class. c) Enter the Target Server (optional) and click Continue. d) Select the ABAP Program Step radio button and click Continue. e) Enter the program name, for example RSWNSEL. f) Enter the relevant variant (OSP_DELTA or OSP_FULL) and click Continue. If the variants do not exist, you must create them. To create a variant follow the procedure described in the Procedure to Schedule Running of Reports section of the Duet for Microsoft and SAP: SAP ERP Configuration Guide located in SAP Service Marketplace at: service.sap.com/instguides SAP Business Suite Applications Duet Duet 1.5 Preview: g) Select the Add Additional Steps checkbox and click Continue. h) Select the ABAP Program Step radio button and click Continue. i) In the ABAP Program Name field, enter the report S_OSP_WF_ITEM_SELECTION and click Continue. Note: There are no variants for this report. j) l) Click Continue (without checking the Add Additional Steps checkbox). Specify the desired start and end time. k) Select the Date/Time radio button and click Continue. m) .Select the Period checkbox and click Continue. n) Select the desired frequency. Select the None of the above radio button. Click Other Periods. Select 15 minutes for the OSP_DELTA variable or 1 day for the OSP_FULL variant. Click Create. o) Click Continue and then Complete. p) Go to Own Jobs, search for the job you created. q) Check that the job status is set to Released. 4. Repeat the Job Wizard procedure for the second variant. Note: Make sure that the user you are scheduling reports (Duet reports) with in the SAP system exists in the Active Directory Service.

15

The following are the R/3 reports to be scheduled: Schedule the NetWeaver Report (or run the report when required) Report Name: RSWNSEL Variant 1: Scenario : OSP Filter : OSP_DELTA Variant 2: Scenario : OSP Filter : OSP_FULL Note: The recommended frequencies for the two variants are: Variant 1 : Every 15 minutes Variant 2 : Once a day Schedule the Duet Workflow Report (or run the report when required) Report Name: S_OSP_WF_ITEM_SELECTION Note: This report should run after the successful execution of the NetWeaver report RSWNSEL. Recommended frequency Every 15 minutes Schedule the Duet Workflow BKT Cleanup Report (or run the report when required) Report Name: S_OSP_WF_PAT_DB_CLEANUP_REPORT Input Parameters: Minimum age (in days): 90 (example figure) Note: The frequency for running this report depends on the volume of requests to be handled.

2.2 Maintaining Status Mapping


Workflow statuses are generic and have different meanings in different applications. For this reason, you must define the mapping relationship between the workflow status and the application status. If you use the default approval workflow in an application, you must define the mapping relationship between the workflow status and the Duet Approval Workflow status. Since application statuses are different, they are displayed differently and inconsistently in the Duet client. Therefore, mapping between the application status and the Duet Approval Workflow status is required so that the Duet life-cycle status is clearly defined and all applications using the Workflow framework can adhere to the manner of displaying Duet status text and icon. To maintain mapping between the following: Workflow status and application status Application status and Duet Approval Workflow status Workflow status and Duet Approval Workflow status

16

1. From Maintain Status Mapping in the Duet Implementation Guide, choose Map Object under Dialog Structure. The screen lists all the scenarios and their corresponding Map IDs and Map Codes as follows: Column Scenario Description Displays the scenario for which the corresponding information is shown. Displays the Map ID for the scenario. Displays the Map code for the scenario. Displays the description text for the map code.

Map ID Map Code for given ID Map Code Description

2. Click New Entries to add another scenario to the list, and enter the details. 3. Select an application from the list and choose Map Info. The screen displays all the mappings that have been defined for the selected application. 4. To define another mapping, click New Entries and enter the applicable scenario name, map ID, and map code. 5. Click Save.

2.3 Workflow Application Handlers


The custom application handler is mainly responsible for application-specific data enrichment and application-specific logic handling. The custom application handler is a pluggable component. You can write application-specific custom handlers or use only the default custom handlers. For example, to obtain detailed information about a trip, such as the cost, the dates, and shipment, you need to develop a custom handler that can retrieve such details. In addition, you can write the complete business logic in your application-specific handler.

17

2.3.1 Customizing Custom Handlers


You can customize and configure the default custom handlers to be used at runtime for inbound and outbound processes using the Pattern Configuration Manager. The following are the default handlers: Default Inbound handler: S_OSP_WF_PAT_DEFAULT_CH_IB By default, the default inbound custom handler writes to the workitem container elements. If the workitem is that of a generic decision task, it calls the appropriate APIs to complete the decision. If the workitem is that of a dialog activity task, then it sets the status of the workitem to complete. If it encounters an error, it constructs an error mail with a link to the approval task. Default Outbound handler: S_OSP_WF_PAT_DEFAULT_CH_OB The default outbound custom handler reads the State Action defined for the workitem records within the application scope. Based on the information obtained as an input, it constructs an XPROP list and reads the details of the groupware object, for example, the email bounditem type, the subject, and the body, before calling the default EMAIL/TASK APIs to Create/Update/Unbind the email and task. All the actions performed in the default outbound handler are controlled by one of the following: The application customization and application data provided as input. The default workflow customization under the scope WOMA and workflow basic data. You can use only the default custom handlers, or use them together with the handlers that you create. If you need to create your own application-specific custom handler, use your own namespace. For example of the name for an outbound custom handler, <custom_namespace>S_OSP_<APPL NAME>_OB_CH, where APPL NAME is the applications name. An example for an inbound custom handler name is <custom_namespace>S_OSP_<APPL NAME>_IB_CH You create your own custom handler in the following instances: If you want to have specific content in the EMAIL/TASK subject/body or notification in place of content provided by default. If you want new elements in the Duet Action Pane such as a start date, and an end date. If the status flow you want to implement differs from the default status flow. To create a custom handler for your application: 6. Log on to the specific SAP system. 7. In the system command line enter the transaction SE37, and then press Enter. 8. In Function Module in the Function Builder initial screen, enter a name for your custom handler and choose Create.

18

9. In the Function Group field, specify the function group you want to use. Note: You cannot use the default function groups. 10. In the Short Text field, enter the descriptive text for the function module, and then choose Save. Note: The function module must be of type RFC.

11. Choose the Import tab. 12. Enter the desired parameter name and its associated data type. Note: You can edit the Parameter Name; however, the Associated Data Type displayed must remain unchanged. The following table shows a list of the default interface for the inbound handler. Parameter Name IV_WORKITEM_ID IV_DECISION_KEY IV_USER_ID IV_OPERATION_ID IV_WORKITEM_STATUS IV_WRT_CONT_FLAG IV_LANGUAGE IT_WF_CONTAINER_TAB IT_APPL_CONTAINER_TAB EV_ERROR_FLAG ET_RETURN Parameter Type IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT IMPORT EXPORT EXPORT Associated Data Type SWN_APPKEY SWR_DECIKEY SYUNAME S_OSP_DT_WI_OPERATION_ID SWW_WISTAT S_OSP_DT_FLAG SPRAS SOSP_TT_WF_CONTAINER SOSP_TT_APPL_CONTAINER S_OSP_DT_FLAG BAPIRETTAB

The following table shows a list of the default interface for the outbound handler: Parameter Name IT_WORKITEM_DETAIL EV_ERROR_FLAG ET_WORKITEM_DETAIL ET_RETURN Parameter Type IMPORT EXPORT EXPORT EXPORT Associated Data Type SOSP_TT_WF_RUNTIME_INFO S_OSP_DT_FLAG SOSP_TT_WF_RUNTIME_INFO BAPIRETTAB

19

13. Choose the Export tab. 14. Enter the desired parameter name and its associated data type. Note: You can edit the Parameter Name; however, the Associated Data Type displayed must remain unchanged. 15. Choose the Source Code tab to enter your code for the application. The following are the default Workflow APIs grouped according to the function of the service. Default Function Groups S_OSP_WF_BKT_PERFM_CRUD Description Maintains all the new and updated work items. Use this API to update the status, recipient ID, and more. Contains the default Workflow services. These APIs are used at runtime to execute both Inbound and Outbound processes. You can use these default services in your applications. This group also contains the default Inbound and Outbound Custom Handlers in Workflow. S_OSP_WF_PAT_DEFAULT_CH_IB The default inbound custom handler that comes with the Workflow Framework. Use this default API in your application for the inbound decision making process. You can use it independently or in conjunction with other application-specific custom handler APIs in the inbound cycle. S_OSP_WF_PAT_DEFAULT_CH_OB The Default Outbound Custom Handler delivered by Workflow framework. You can use the default API for the outbound process of creating and updating Outlook bound items. Use it independently or in conjunction with other application-specific custom handler APIs in the outbound cycle. S_OSP_WF_DEFAULTCH_EMAIL _ITEM Used in CRUD (Create, Update, Delete, and Unbind) operations on an EMAIL groupware object. It is used for creating both Bound and Unbound Emails. The Subject and Body of the Email can be specified as inputs.

S_OSP_WF_PATTERN_DEFLT_CH

20

S_OSP_WF_DEFAULTCH_ACTION _ITEM

Used in CRUD operations on a Task Groupware object. You can use it to create both Bound and Unbound Tasks. You can specify the Subject and Body for a task as inputs.

S_OSP_WF_PAT_DEFLT_BLD _ERRNOTF
S_OSP_WF_GET_WI_RUNTIME_INFO

Used for composing the content and body for an email with links, attachments, and more. Used to provide runtime information for a work item. For example, work item container element, work item status, work item step ID, and work item task ID, etc.

You can use the APIs as follows: Customize the default outbound/inbound custom handler for use in your application-specific custom handler. Use the default outbound/inbound custom handler together with your applicationspecific custom handler.

2.3.2 Customizing the Default Custom Handler for Use in Application-specific Custom Handler
You must specify the groupware information for CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table before passing the information to the default custom handler. This enables the creation of the email subject and body. The default custom handler creates the email subject and body using the details present in SUBJ_BODY_TAB, EMAIL_DETAILS, and TASK_DETAILS under CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table. For the groupware bound and unbound Email/Tasks, provide the details for EMAIL_DETAILS and TASK_DETAILS under CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table. You can add extra information to the client using name value pairs. Add the name value pairs to the XPROP_LIST table under CLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table. Later, pass the IT_WORKITEM_DETAIL table to the default custom handler which takes care of sending the information to the client through the following APIs: S_OSP_WF_DEFAULTCH_ACTION_ITEM S_OSP_WF_DEFAULTCH_EMAIL_ITEM If your application does not include additional information in the XPROP_LIST table, the default XPROP is used. To update transitions status, your application must use the following function, S_OSP_WF_BKT_PERFM_CRUD.

21

2.3.3 Using the Default Custom Handler Together with your Application-specific Custom Handler
To use your application-specific outbound handler with the default outbound handler, first call the application-specific handler before calling the default handler. Then, repeat the steps described in the Customizing the Default Custom Handler for Use in Application-specific Custom Handler section.

2.3.4 Configuring the Body and Subject of your Emails and Tasks
Emails and tasks generated automatically by the workflow have a standard default text. Note: Text for the body of task items must be written in RTF (Rich Text Format) only.

To change the default text:


Note: Make sure that the import and export parameters of the application-specific custom handler match those of the default custom handler. 1. Create a program containing the desired text for the subject line. a) Enter transaction SO10. b) In the Text Name field, enter the desired program name. For example, Z_subjectline_text. c) From the Text ID drop-down list box, select ST (Standard Text). d) From the Language drop-down list box, select the desired language. e) Click Create. The SAPscript editor is displayed. f) In SAPscript mode, enter the desired text for the including the required dynamic variables, for example invoice number or employee name. Note: These variables must be written in the following format: &variablename& g) Click Save. 2. Repeat the procedure for the body. 3. Create a new function to call the new text. Note: The code below shows an example of creating the subject line and body in an email containing for an invoice approval application using the standard text program. How you create workflow approval email subject and body will depend on your application requirements. a) Enter transaction SE37. b) Build a new function. c) Copy the code below and then paste it in the Source Code tab.

22

FUNCTION z_test_invoice_ch_text. *"---------------------------------------------------------------------*"*"Local Interface: *" IMPORTING *" VALUE(IS_INVOICE_TABLE) TYPE ZINVOICE_TABLE OPTIONAL *" VALUE(IT_INVOICE_DETAIL) TYPE ZTTINVOICE_DETAIL OPTIONAL *" EXPORTING *" VALUE(EV_INVOICE_BODY) TYPE STRING *"---------------------------------------------------------------------DATA: ls_header lv_changed lv_invoice_text lv_invoice_text1 lv_invoice_text2 lv_invoice_text3 ls_new_header ls_invoice_detail ls_read_line lt_read_line value TYPE string. TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE thead, string, string, string, string, string, thead, zinvoice_details, tline, tline OCCURS 0, "#EC NEEDED "#EC NEEDED

"#EC NEEDED

CALL FUNCTION 'READ_TEXT' EXPORTING id = 'ST' language = 'E' name = object = 'TEXT' IMPORTING header = ls_header TABLES lines = lt_read_line. *----Dynamic variable for the invoice----* PERFORM: text_setvalue USING '&vendorname&' vendor_name , text_setvalue USING '&invoicedate&' invoice_date , text_setvalue USING '&invoicenumber&' invoice_number."... is_invoice_tableis_invoice_tableis_invoice_table-

CALL FUNCTION 'TEXT_SYMBOL_REPLACE' EXPORTING endline = 99999 header = ls_header init = ' ' option_dialog = ' ' program = ' ' replace_program = 'X' replace_standard = ' ' replace_system = ' ' replace_text = 'X' startline = 1 IMPORTING changed = lv_changed

23

newheader TABLES lines

= ls_new_header = lt_read_line.

LOOP AT lt_read_line INTO ls_read_line. CONCATENATE lv_invoice_text1 ls_read_linetdline INTO lv_invoice_text1. ENDLOOP.

REPLACE ALL OCCURRENCES OF '<(><<)>' IN lv_invoice_text1 WITH '<'. CLEAR: lt_read_line,ls_read_line,lv_invoice_text.

************************ ********************************************** *************************************** LOOP AT it_invoice_detail INTO ls_invoice_detail. CALL FUNCTION 'READ_TEXT' EXPORTING id = 'ST' language = 'E' name = object = 'TEXT' IMPORTING header = ls_header TABLES lines = lt_read_line.

PERFORM: gl_account, cost_center ,

text_setvalue USING '&glaccount&' text_setvalue USING '&costcenter&' text_setvalue USING '&lamount&'

ls_invoice_detaills_invoice_detaills_invoice_detaills_invoice_detail-

amount , text_setvalue USING '&remark&' comments .

CALL FUNCTION 'TEXT_SYMBOL_REPLACE' EXPORTING endline = 99999 header = ls_header init = ' ' option_dialog = ' ' program = ' ' replace_program = 'X' replace_standard = ' ' replace_system = ' ' replace_text = 'X' startline = 1 IMPORTING changed = lv_changed newheader = ls_new_header TABLES lines = lt_read_line. LOOP AT lt_read_line INTO ls_read_line.

24

CONCATENATE lv_invoice_text2 ls_read_linetdline INTO lv_invoice_text2. ENDLOOP. ENDLOOP. REPLACE ALL OCCURRENCES OF '<(><<)>' IN lv_invoice_text2 WITH '<'. ************************************************************************ *****************************************************

CONCATENATE lv_invoice_text1 lv_invoice_text2 lv_invoice_text3 INTO lv _invoice_text. ev_invoice_body = lv_invoice_text.

ENDFUNCTION. *----------------------------------------------------------------------* ***INCLUDE LZTEST_WF_CH_OBF01 . *----------------------------------------------------------------------* *&---------------------------------------------------------------------* *& Form TEXT_SETVALUE *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0072 text * -->P_VALUE text *----------------------------------------------------------------------* FORM TEXT_SETVALUE USING P_name P_VALUE.

CALL FUNCTION 'TEXT_SYMBOL_SETVALUE' EXPORTING name = p_name value = P_VALUE value_length = 0 replace_symbols = ' '.

ENDFORM.

" TEXT_SETVALUE

d) In the first CALL FUNCTION 'READ_TEXT' section, enter the value of import parameter Name with the name of the standard text program you created for the subject line, for example Z_subjectline_text. e) In the second CALL FUNCTION 'READ_TEXT' section, enter the value of import parameter Name with the name of the standard text program you created for the body. f) In the PERFORM: text_setvalue section, set the value for the dynamic variables you entered in the program text. 4. Save the function.

25

5. Activate the function. 6. Create an RFC function. a) Enter transaction SE37. b) Build a new Custom Item Handler function. c) Copy the code below and then paste it in the Source Code tab.
FUNCTION Z_TEST_INVOICE_CH_OB_API. *"---------------------------------------------------------------------*"*"Local Interface: *" IMPORTING *" VALUE(IT_WORKITEM_DETAIL) TYPE SOSP_TT_WF_RUNTIME_INFO OPTIONAL *" EXPORTING *" VALUE(EV_ERROR_FLAG) TYPE S_OSP_DT_FLAG *" VALUE(ET_WORKITEM_DETAIL) TYPE SOSP_TT_WF_RUNTIME_INFO *" VALUE(ET_RETURN) TYPE BAPIRETTAB *"---------------------------------------------------------------------DATA: *---------------Local Variables lv_invoice_body lv_subject_body *---------------Local tables lt_invoice_table lt_invoice_detail , lt_invoice_xprops lt_client_gpw_info lt_subj_body_tab *--------------Local Structures ls_invoice_xprops ls_workitem_detail ls_client_gpw_info ls_invoice_table ls_invoice_detail ls_subj_body_tab CONSTANTS: gc_subject_info ve invoice of vendor'. *----Just for Check---* SELECT * FROM zinvoice_details INTO TABLE lt_invoice_detail WHERE invo ice_number = '556700023'. LOOP AT it_workitem_detail INTO ls_workitem_detail. LOOP AT lt_invoice_table INTO ls_invoice_table.

TYPE string, TYPE string,

TYPE zinvoice_table OCCURS 100, TYPE zinvoice_details OCCURS 100 TYPE sosp_tt_xprop, TYPE sosp_tt_client_gpw_info, TYPE sosp_tt_subj_body_tab,

TYPE TYPE TYPE TYPE TYPE TYPE

sosp_s_xprop, sosp_s_wf_runtime_info, sosp_s_client_gpw_info, zinvoice_table, zinvoice_details, sosp_s_subj_body_tab.

TYPE string VALUE 'Please appro

CALL FUNCTION 'Z_TEST_INVOICE_CH_TEXT' here u put the fm name of the text body/subject EXPORTING is_invoice_table = ls_invoice_table it_invoice_detail = lt_invoice_detail IMPORTING ev_invoice_body = lv_invoice_body.

26

*-----Filling of xprops CLEAR ls_invoice_xprops. CLEAR lt_invoice_xprops[]. ls_invoice_xprops-name = 'DocumentType'. ls_invoice_xprops-value = ls_invoice_table-document_type. APPEND ls_invoice_xprops TO lt_invoice_xprops. ls_invoice_xprops-name = 'VendorName'. ls_invoice_xprops-value = ls_invoice_table-vendor_name. APPEND ls_invoice_xprops TO lt_invoice_xprops. ls_invoice_xprops-name = 'InvoiceNumber'. ls_invoice_xprops-value = ls_invoice_table-invoice_number. APPEND ls_invoice_xprops TO lt_invoice_xprops. ls_invoice_xprops-name = 'InvoiceDate'. ls_invoice_xprops-value = ls_invoice_table-invoice_date. APPEND ls_invoice_xprops TO lt_invoice_xprops. * * ** ls_invoice_xprops-name = 'GrossAmount'. ls_invoice_xprops-value = ls_invoice_table-gross_amount. APPEND ls_invoice_xprops TO lt_invoice_xprops.

*---Prepare the exporting table CLEAR lv_subject_body. CONCATENATE gc_subject_info ls_invoice_tablevendor_name INTO lv_subject_body SEPARATED BY ' '. lt_client_gpw_info = ls_workitem_detail-client_gpw_info. LOOP AT lt_client_gpw_info INTO ls_client_gpw_info WHERE recp_role_id = 'APPROVER' AND gpw_object_sub_type = 'BND'. *-----------------------------------------------------------------------------------------* ******************************************EMAIL************************* ******************** *------------------------------------------------------------------------------------------*

IF ls_client_gpw_info-gpw_object_type = 'EMAIL'. *Fill the application-specific xprops ls_client_gpw_info-email_detailsxprop_list = lt_invoice_xprops. *Fill the email type ls_subj_body_tab-email_type ='BND'. *Fill the subject text information ls_subj_body_tab-subject = lv_subject_body.

27

*Fill the body text information ls_subj_body_tab-body-text_body = lv_invoice_body. *Fill the subject text information APPEND ls_subj_body_tab TO lt_subj_body_tab. ls_client_gpw_info-email_detailssubj_body_tab = lt_subj_body_tab.

*-----------------------------------------------------------------------------------------* ******************************************TASK************************** ******************** *------------------------------------------------------------------------------------------*

ELSEIF ls_client_gpw_info-gpw_object_type = 'TASK'. *Fill the application-specific xprops ls_client_gpw_info-task_detailsxprop_list = lt_invoice_xprops. *Fill the subject text information ls_subj_body_tab-subject = lv_subject_body. *Fill the body text information ls_client_gpw_info-task_details-body-value = lv_invoice_body. *Fill the subject text information ls_client_gpw_info-task_details-subjectvalue = ls_subj_body_tab-subject. ENDIF. MODIFY lt_client_gpw_info FROM ls_client_gpw_info. ENDLOOP. ***Set Client info to Workflow Pattern structure ls_workitem_detail-client_gpw_info = lt_client_gpw_info. APPEND ls_workitem_detail TO et_workitem_detail.

ENDLOOP. ENDLOOP.

ENDFUNCTION.

d) In the Just for Check section, under SELECT * FROM, build a table containing all the details of the dynamic variables you want to display. e) In the Just for Check section, under CALL FUNCTION, enter the name of the function you created in step 3. 7. Save the function. 8. Activate the function.

28

2.4 Workflow Default RFC and Application Custom Handler RFC


When developing application-specific inbound and outbound custom handlers, you must maintain a predefined interface using the Workflow component.

2.5 Creating Client Proxy Objects for Groupware Objects


The Duet Item Handler Web service interacts with the groupware objects in Java. In order to access this functionality from the ABAP environment, you must create corresponding client proxies in the ABAP environment so that the application can use CRUD operations (Create, Update, Delete, and Unbind) in the groupware objects.

2.5.1 ABAP Client Proxies


You must create corresponding client proxies in ABAP to enable the Duet Item Handler to interact with the groupware objects. The following are proxies are available: Proxy Class CO_OSPWEMAIL_VI_DOCUMENT Description Use this client proxy to perform create, update, and delete (CRUD) operations on the EMAIL groupware object. Use the following methods: DELETE_EMAIL MAINTAIN_EMAIL CO_OSPWACTION_ITEM_VI_DOCUMENT Use this client proxy to perform create, update, and delete (CRUD) operations on the TASK groupware object. Use the following methods: DELETE_ACTION_ITEM MAINTAIN_ACTION_ITEM CO_OSPWCALENDAR_EVENT_VI_DOCUM Use this client proxy to perform create, update, and delete (CRUD) operations on the CALENDAR groupware object. Use the following methods: DELETE_CALENDAR_EVENT MAINTAIN_CALENDAR_EVENT

29

2.6 Configuring Logical Ports and Remote Destinations


When you generate client proxies in ABAP for Web services, first define a remote destination and then create logical ports for the calls to these Web services at runtime.

2.6.1 Defining an RFC Destination for the Action Item and Email Proxy
You must define and configure an RFC destination to enable connectivity between the specific SAP system and the Duet environment. To define and configure an RFC destination in an SAP system: 1. Log on to the SAP system you have configured for use with Duet. 2. From the system command line, enter the transaction SM59. 3. Click Create, and enter the following: Field RFC Destination Value to enter CONNECT TO J2EE. Note that the destination name is case sensitive. G (HTTP Connection to Ext. Server) 1 RFC destination from ERP to Duet.

Connection Type Description

4. Select the Technical Settings tab, and enter the following: Field Target Host Values Enter the IP address of the Item Handler Web host service. Note that this is the host for Duet. For example: 127.0.0.1 Service No. Path Prefix Enter the port number of the Item Handler Web service host. For example: 50000. Enter the following for: Action Item: /ActionItem/ActionItemConfig?wsdl&mode= sap_wsdl&style=document Email: /Email/EmailConfig?wsdl&mode=sap_wsdl&style= document Calendar Item: /CalendarEvent/CalendarEventConfig?wsdl&style =document

30

5. Select the Logon/Security tab and select No Logon. 6. Select the Send SAP Logon Ticket checkbox. Note: The username and password must be those of a user in the Active Directory Service (ADS).

7. Save the RFC destination service.

31

2.6.2 Assigning an RFC Destination to a Logical Port for the Action Item and Email Proxy
You must assign an RFC destination to the logical port. This process exposes proxy classes in the specific ERP environment. To assign an RFC destination to the logical port: 1. Log on to the SAP system you have configured for Duet. The SAP Easy Access window opens. 2. Enter the transaction LPCONFIG in the command line of the SAP Easy Access window. 3. Enter the Proxy class: Action Item : CO_OSPWACTION_ITEM_VI_DOCUMENT Email : CO_OSPWEMAIL_VI_DOCUMENT Calendar: CO_OSPWCALENDAR_EVENT_VI_DOCUM 4. Enter a logical port name. This can be any alphanumeric string, without spaces. For example, Duet_LP. 5. Select the Default Port checkbox. 6. Click Create and enter the description. For example, OSP logical port 7. Select the Call Parameters tab. 8. In the HTTP Destination field, enter the name of the RFC destination you created. You defined this RFC destination. For example, CONNECT TO J2EE. 9. Save the logical port. 10. Activate the logical port.

2.6.3 Configuring Communication Destinations for Role Management


You must define an RFC destination and a logical port for role management calls. To define and configure an RFC destination in an SAP system: 1. Log on to the SAP system you have configured for use with Duet. 2. From the system command line, enter the transaction SM59. 3. Click Create and enter the following: Field RFC Destination Value to enter CONNECT TO ROLE. Note that the destination name is case sensitive. G (HTTP Connection to Ext. Server) 1 RFC destination from ERP to Duet.

Connection Type Description

32

4. Select the Technical settings tab, and enter the following: Field Target Host Values Enter the IP address of the Item Handler Web host service. Note that this is the host for Duet. For example: 127.0.0.1 Service No. Path Prefix Enter the port number of the Item Handler Web service host. For example: 50000. Enter the path: /RMWrapper/Config1?style=document

5. Choose the Logon/Security tab and select No Logon. 6. Select the SAP Logon Ticket checkbox. 7. Save the RFC destination service.

2.6.4 Assigning an RFC Destination to a Logical Port for Role Management


You must assign an RFC destination to the logical port. This process exposes proxy classes in the specific SAP system environment. To assign an RFC destination to the logical port: 1. Log on to the SAP system you have configured for Duet. The SAP Easy Access window opens. 2. Enter the transaction LPCONFIG in the command line of the SAP Easy Access window. 3. Enter the /OSP/CO_RMWRAPPER_VI_DOCUMENT Proxy class. 4. Enter a logical port name. This can be any alphanumeric string, without spaces. For example, DuetRole_LP. 5. Select the Default Port checkbox.

6. Click Create, and enter the description. For example, OSP logical port 7. Select the Call Parameters tab. 8. In the HTTP Destination field, enter the name of the RFC destination you created. For example, CONNECT TO ROLE. 9. Save the logical port and activate it.

33

3 Installing the Duet Approval Workflow Configuration Tool


In order to install the Duet Approval Workflow Configuration tool, you must first copy the Workflow Configuration tool zip file from the Duet 1.5 SP1 CD (located at \Client\Tools\Workflow Configuration tool) to your machine, then extract it and run the setup.exe installation file located in the root folder. Note: In order to use the Debug/Preview mode of the Workflow Configuration tool, both the tool and the Metadata Service must be installed on a machine running Windows Server 2003. Requirements Before you install the Duet Approval Workflow Configuration tool, make sure that: You have JDK 1.4, or a newer version on your machine and you have set the %JAVA_HOME% variable. You have added the path to the java bin folder to the %Path% variable. You have installed ANT 1.7; you can download the Ant.zip (Ant 1.7) file at: http://ant.apache.org/bindownload.cgi, and extract the content to your local machine. You defined a new system variable using the name: ant_home. This variable should point to the root folder of the ant package. You have installed Microsoft Office Outlook 2003, or a later version. Note: If the landscape consists of clients using both Microsoft Office Outlook 2003 and Microsoft Office Outlook 2007, then you must install Microsoft Office Outlook 2003. You have installed Microsoft Visual Studio 2005. You have installed Duet client components from Microsoft (Duet 1.5) You have installed the Metadata Service: Note: You can only install the Metadata Service on a Windows 2003 server. Open the Microsoft.OBA.MetadataService.msi file located at: \Server\OBA Server\Metadata Service. If you are using the Group Policy template, open the template and configure the Duet Metadata Service URL to Local Host. If you are not using the Group Policy template, go to C:\Program Files\Microsoft Information Bridge\1.8\Framework and open the Microsoft.OBA.SystemTray.exe.config file. Then, change the URL properties of the Duet Metadata Service to Local Host.

3.1 Overview of the Duet Approval Workflow Configuration Tool


The Duet Approval Workflow Configuration tool is a graphical designer tool based on Domain-Specific Language Tools for Visual Studio 2005.

34

From Microsoft Visual Studio, you use tool to do the following without writing code: Modify and configure the attributes and properties of the Duet Approval Workflow template. Generate and package all the files for the modeled application. In addition, it enables business experts, analysts, and programmers to define tasks and task flows, and to add controls to create a model for a Workflow application. A Workflow application created in this manner can be used for tasks such as, approvals, rejections, substitutions, reservations, and assignment designation. To use the Duet Approval Workflow Configuration tool: 1. Open Microsoft Visual Studio, and click Create Project. 2. From the New Project dialog box, click Duet under Visual C# in the Project Types pane, and select Duet Workflow Project from the Templates pane.

3. Enter a name for the project and specify the location for the projects folder. The model in the default Workflow Template is displayed. From Microsoft Visual Studio, you modify the default Duet Approval Workflow template using the following: Menu bar Contains the menu entries to use for all modeling tasks. Some menu entries are not available. Toolbars Solution Explorer Presents relevant toolbars for modeling. Displays all the files for the model and the project.

35

Toolbox

Contains the entities for building a model. It contains the following: Links List region, Details Region (OIDBuilding block), and History Region.

Modeling Area

This is the working area where you build your model, and edit the properties of the entities of that constitute it. In addition, you can view the text files and the various XML files created for the model. The model area displays the main objects for the Duet Approval Workflow application: model data source, link to approval objects, and approval objects with their action panes.

Properties Configuration Region Edit Content Pop-Up Zoom In and Out

Contains the configuration data for the selected entity in the model. It is available only when you select or drag an entity into the appropriate receptacle entity. Opens as a window in which you edit and configure the content for the selected and active entity. Press <Ctrl> and the plus (+) key of the keyboard to enlarge and display more details of a portion of the model. To display less details, press <Ctrl> and minus (-) of the keyboard.

3.2 Gathering Information for Your Approval Workflow Application


With the Duet Approval Workflow template, you create approval workflow applications for use in Duet. The approval workflow applications that you create extend the functionality of existing approval workflow applications in the SAP system. For this reason, you need to collect specific information about the approval workflow application in the SAP system, and later provide the information collected in the Duet Approval Workflow template when you model your approval workflow application for use in Duet. The following information is collected: User information for running the scheduler in the SAP system. Roles to use in your approval workflow application in Duet. The identifier of the workflow application. The application handlers you want to use.

3.3 Post-Installation Procedures


Once the application has been installed, you can start working in one of the following modes: Release Mode Debug Mode

36

3.3.1 Release Mode


The Release Mode will generate and package the application into an SCA file. This SCA file can then be deployed to the J2EE server to work in a full Duet Landscape. Note: After receiving the confirmation message, verify that the SCA file has been created.

3.3.2 Debug Mode


The Debug mode will enable you to work locally, disconnected from any SAP system or J2EE server. Select this mode if you want to be able to check the client side without having to deploy and configure SAP systems. In order to work in debug mode, you must first perform the following configurations: 1. Under the IBF framework folder (C:\Program Files\Microsoft Information Bridge\1.8\Framework), create another folder called External Resources. 2. Copy the following assemblies from the Template Repository/Binary folder (<Addin installation folder>\Template Repository\BINARY) into the IBF framework folder: CorrelationID.dll SAP.Office.Common.dll SAP.Office.Framework.dll SAP.Office.Framework.UI.dll SAP.Office.Patterns.Workflow.Common.dll SAP.Office.Tools.UI.dll 3. Copy the content of the Template Repository/External folder (<Add-in installation folder>\Template Repository\EXTERNAL) into the External Resources folder.

3.4 Creating a New Duet Approval Workflow Configuration Template


You can create a new Duet Approval Workflow template based on the existing template. Locate the new template in a separate project and as a separate solution. Using your new template, you can create workflow applications. Two Duet Approval Workflow templates cannot be used in the same project.

4 Customizing the Duet Approval Workflow Template


You can modify the Duet Approval Workflow template and save it as a new template, or modify the template and generate your Workflow application. You modify the template in one of the following ways: By adding regions to the default model. By editing the parameters of the various regions in the template one by one. By giving the default template a new name and modifying its content as needed.

37

In order to customize the Duet Approval Workflow template, you must be defined as a Duet user. To define a Duet user: 1. Log on to the specific SAP system. 2. In the system command line enter the transaction SU01 and then press Enter. 3. In the User field, enter the user name. 4. Click Display (or press F7). The Display User page is displayed.

5. Select the Logon data tab. 6. From the User Type drop-down list, select Dialog. 7. Save your changes.

4.1 Modifying the Default Model


When you open the Duet Approval Workflow template, it displays the default model containing 3 main entities: Workflow Application Represents the entire application. Container for all the other elements here described. When selected, you can define the following in the Properties pane: Application ID (ID must not exceed 6 characters) Application Name Application User Role

38

Model Data Source

Represents the SAP system you want to configure for your workflow application. It contains a list of parameters based on the default workflow application identified as WOMA, in the SAP system. This entity is connected directly to the Workflow Item: Mail and Task, denoting a relationship between the two entities. Note: You cannot delete the Model Data Source entity, but you can edit its contents.

Workflow Item: Mail and Task

Represents the default mailing features and the activities to automate for the workflow application. Note: You cannot delete the Workflow Item: Mail and Task entity. In addition, it cannot include other entities except the Action and the Duet Action Pane regions. Action Entity: The Actions entity contains the toolbar definition. You can edit the toolbar definition by adding or removing toolbar items. Duet Action Pane Entity: The Duet Action Pane entity represents the Duet Action Pane that will be invoked for the workflow application in Microsoft Office Outlook. Note that the Duet Action Pane is the only entity to which you can add regions.

Note: Alternatively, you can open the model by selecting the file, WorkflowDsl.dml in the Solution Explorer pane.

39

The Toolbox pane in Microsoft Visual Studio contains the regions available for use in the Duet Approval Workflow template. The following are the available regions in the toolbox: Link List Details History To add a region to the Duet Action Pane entity: 1. From Toolbox > Regions, select the desired region. 2. Drag it while selected and drop it into the Duet Action Pane entity. The Properties pane displays the properties of the selected region in the model.

4.2 Editing the Model Data Source Entity


The Model Data Source entity in the default model of the template contains a list of parameters based on a Workflow application identified as WOMA. You can edit these parameters from the Edit SAP System Content dialog box, which contains the Parameters List and the Parameter Details areas. The Parameters List is a list of predefined data collected based on the default workflow application in the SAP System. The list shows the Default Label and the Parameter Name as they appear in the SAP system. In addition, it allows you to add a parameter and specify a name for it, or to add a parameter directly to the Model Data Source entity. You can change the parameter name or delete it together with its information. Note: You cannot delete the predefined parameters.

40

To change the name of a parameter: 1. From the modeling area, double-click the Model Data Source entity. The Edit SAP System Content dialog box is displayed. 2. From the Parameters List, select the desired parameter. 3. In the Parameter Details pane, select the current name and replace it with the new one. To add a parameter: 1. From the modeling area, double-click the Model Data Source entity. The Edit SAP System Content dialog box is displayed. 2. Click Add New. A new row appears. 3. In the Default Label field, enter the name of the parameter you want to add. The parameter name cannot be more than fifty characters. Note: Changing the default label after the label had been used in the different entities, opens a window with all the locations where the change needs to be applied. 4. In the Parameter Name in SAP System field, enter the name of the parameter as it appears in the SAP system. The parameter name must not contain any spaces. 5. In the Default Value field, enter a value for the parameter. The value you specify is the default value for the parameter. 6. Click Map Values to Labels. In the window displayed, enter the value for the source and the target. Click Add and OK to map a value to a label.

41

7. Use this option to define a mapping relationship between numeric codes in the SAP system and text values presented in the application. 8. From the Parameter type drop-down list box, select the desired parameter type. 9. In the Parameter Description field, enter the descriptive text for the parameter. This information will help others using the template to quickly identify the parameter in the SAP system. 10. From the Synchronization drop-down list box, select the desired behavior for synchronization. This defines the source of the data to use when updating the value. The synchronization options are: Override Outlook Values from SAP System Uses data from the XML from the SAP system. This data is not related to the value of the parameter in Microsoft Office Outlook. Uses the data from Microsoft Office Outlook and not from the XML from the SAP System. Use this option where the value depends on the users actions. SAP System representation UI representation Use only the data from the XML from the SAP system. Use only the data from Microsoft Office Outlook.

Override SAP System Values from Outlook

42

4.3 Editing the Workflow Item: Mail and Task Entity


The Actions region holds all the actions available in the default model. These actions can be edited from the Edit Action dialog box, which contains a list of the available actions for a Workflow application. The list shows an action and its description. The listed default actions are: Approve, Reject, Reassign, Reserve, Show Help, and Workflow Approval Details. Note: You can choose to expose the actions in an email or task. You cannot add or delete actions to the Action entity.

To change the label for an action: 1. From the Workflow Item: Mail and Task entity, double-click the Action entity. The Edit Action dialog box is displayed. 2. From the Actions List, select the desired action name. 3. In the Action Details pane, select the current name and replace it with the new one. Note: The name you specify is the one that will appear in the toolbar for the Workflow application in Microsoft Office Outlook. 4. Click OK.

43

To enable an action as an activity in the Workflow application: 1. From the Workflow Item: Mail and Task entity, double-click the Action entity. The Edit Action dialog box is displayed. 2. From the Actions List, select the desired action name. 3. From the Action Details pane, select the Enable Action checkbox. When you enable an action, the activity and functionality associated with that action are available in the application at runtime. This activity should also exist in the SAP system. When an action is not enabled, it is not available in the application, and it does not appear in the toolbar or in the menus for the application at runtime. To include an image for a toolbar entry at runtime: 1. From the Workflow Item: Mail and Task entity, double-click the Action entity. The Edit Action dialog box is displayed. 2. Select the desired action from the Actions List. 3. In the Icon field, specify the filename for the image.

4.4 Editing the Action Pane Entity


The Action Pane entity in the model represents the Duet Action Pane as it appears in Microsoft Office Outlook. The pane contains the Duet-specific functionality that enables the workflow application in Microsoft Office Outlook. The Action Pane entity contains the following default regions in the specified order: Branding Region: Specifies the branding area in the Duet Action Pane. It contains the Duet logo, and cannot be configured. Object Identification Region (OID): Specifies the various Duet objects in the Duet Action Pane. It can be configured. Dynamic Message Region (DMR): Specifies the message region in the Duet Action Pane. It cannot be edited. You Can Also Region: Specifies other capabilities of the application other than the main automated tasks, in the Duet Action Pane. It can be configured. In addition to the default regions, the Duet Action Pane can contain any of the regions available in the Toolbox, including the following: Link List Region: Specifies the capabilities of other applications that can be used together with the current application. It can be configured. Details Region: Similar to the OID region, it specifies Duet objects. It can be configured. History Region: Specifies a list of previous activities in the current application. It can be configured.

44

Some of these regions represent activities in the Workflow application such as, Approve, Reject, Help, Show Action Pane, Reassign, Reservation, and Substitution. Note: You cannot delete the Action Pane entity, however, you can add regions to it, and edit their properties.

4.4.1 Editing the Object Identification Region


You can edit the Object Identification (OID) region by adding parameters related to the task for the Workflow application, and changing the order of labels and the label-value pairs. The parameters appear as a list of predefined labels. Each label is mapped to a parameter name in the data source.

To change the label: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed. 2. From the Parameters List, select the desired name. 3. In the Parameter Details pane, select the current name and replace it with the new one.

45

To add parameters from the Model Data Source entity: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed 2. From Model Data Source, click Add. The Select Parameter from Model Data Source window is displayed. 3. Select the parameters you want to add. 4. Click OK. To delete an existing parameter: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed. 2. Select the parameter from the list and click Delete. To change the order of the parameters in the list: 1. From the Duet Action Pane entity, double-click the OID region. The Edit Object Identifier (OID) dialog box is displayed. 2. Select the parameter you want to move, and click the Up or Down arrows.

4.4.2 Editing the You Can Also Region


You can edit the You Can Also region by adding links related to the task, such as Open Duet Application Help, for the Workflow application. The Edit Links List dialog box contains a list of predefined labels. Each label is mapped to a URL address.

46

To change the name of a parameter: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. From the Links List, select the desired name. 3. In the Label field, select the current name and replace it with the new one. To change the URL address: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. From the Links List, select the desired label and its corresponding URL address. 3. In the Label field, change the URL address. To add one or more URL addresses and labels: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. Click Add New. A row appears in the Links List pane. 3. Edit the desired URL address and labels as follows: Label: Enter the text for the link. Tooltip: Enter the tool tip information. URL: Enter the URL address including the http:\\ prefix. 4. If you want to modify the URL address, click Set URL Parameters. a) Enter the new URL address. b) Define the variables you wish to add to the URL. The Define URL Parameters dialog box opens with the specified URL address. c) Click Add New to specify the value. 5. To add a single value, select Static. To specify a parameter from the SAP system, select Dynamic. A static parameter is single value and does not change. The value for a dynamic parameter changes according to the value of the parameter from the SAP system. The value you specify is displayed as part of the URL address. 6. If you select Static, enter a name for the value you want to add and specify the value. If you selected Dynamic, from the SAP System Parameter drop-down list box, enter a name for the value and select the parameter from the SAP system. 7. Click Preview to test the address and the changes you have made. 8. Click OK to save the changes.

47

4.4.3 Editing the Links List Region


You can edit the Links List region by adding links to Web sites, and other activities related to your workflow application. To edit the Links List region: 1. From the toolbox, drag and drop the Links List region into the Duet Action Pane. 2. Double-click the Links List region. The Edit Link List dialog box opens. The Edit Links List dialog box contains a list of predefined labels. Each label is mapped to a URL address. To change the name of a parameter: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. From the Links List, select the desired name. 3. In the Label field, select the current name and replace it with the new one. To change the URL address: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. From the Links List, select the desired label and its corresponding URL address. 3. In the Label field, change the URL address. To add one or more URL addresses and labels: 1. From the Duet Action Pane entity, double-click the You Can Also region. The Edit Links List dialog box is displayed. 2. Click Add New. A row appears in the Links List pane. 3. Edit the desired URL address and labels as follows: Label: Enter the text for the link. Tooltip: Enter the tool tip information. URL: Enter the URL address. 4. If you want to modify the URL address, click Set URL Parameters. d) Enter the new URL address. e) Define the variables you wish to add to the URL. The Define URL Parameters dialog box opens with the specified URL address. f) Click Add New to specify the value. 5. To add a single value, select Static. To specify a parameter from the SAP system, select Dynamic. A static parameter is single value and does not change. The value for a dynamic parameter changes according to the value of the parameter from the SAP system. The value you specify is displayed as part of the URL address.

48

6. If you select Static, enter a name for the value you want to add and specify the value. If you selected Dynamic, from the SAP System Parameter drop-down list box, enter a name for the value and select the parameter from the SAP system. 7. Click Preview to test the address and the changes you have made. 8. Click OK to save the changes.

4.4.4 Editing the History Region


The History region is one of the default regions in the Duet Approval Workflow template model. This region represents information about the activities already carried out by the Workflow application during runtime. You cannot edit the content of this region. You can edit the properties of the region itself.

4.4.5 Editing the Details Region


You edit the Details region just as you edit the Object Identifier region. For more information, see Editing the Object Identification Region.

5 Generating the Files for Your Approval Workflow Application


After editing and configuring the entities in the model to suit your Duet Approval Workflow application, you are ready to generate and package all the files for the application. You can write documentation for your approval workflow application using the WF_HELP.chm file, located in the folder: \resources. The template automatically generates the help file for your application and includes it in the application package. From your application, users can invoke the help file using the Get workflow help link if you include the link in the model for your application. You can replace the workflow.snk located in the \resources folder with your own snk file which will then be used in the generated applications assembly. Note: In order to be loaded, the generated assembly needs to be fully trusted by the .Net framework. For example, you can establish trust from the following location: Run > Settings > Control Panel > Administrative Tools > .NET Framework 2.0 Configuration > Runtime Security Policy > Increase Assembly Trust.

49

5.1 Generating the Application Files


You use the debugging tool in Microsoft Visual Studio to generate your Duet Workflow application. To generate the files for your approval workflow application: 1. Select the option Release in Solution Configurations, and click Release.

The Workflow Generation window is displayed with a progress bar.

2. Click Done or click Details to see detailed information of the processes. You can find the generated files and the log files of the process in the project folder you specified. In the Generated Target subfolder you will find a single file with the extension *.sca, this is the Duet approval workflow application you created and it is ready to be deployed.

50

5.1.1 Configuring the Application Package and Deployment


You can configure the application package by changing the name of the deployable file. In this way, you separate between the various application packages you create in the same project. To configure the application package: 1. From Tools in the menu bar, choose Options. The Options dialog box is displayed. 2. Expand Duet Workflow and select Packaging. There are two categories in Packaging: Deployment and Packaging.

51

You can change the following properties for each package: Property SDM host Description Specifies the name or the IP address of the Software Deployment Manager (SDM) host. You use the SDM to deploy the *.sca application file. For example, http://localhost. SDM Port Compatibility Version Specifies the SDM tool port number. The default is 50018. Specifies the version of the Duet approval workflow application. The recommended format to use is: 1000.<Duet version>.<J2EE version>.<Duet service pack>.<Patch version> For example: 1000.150.700.1.0 Display Name Prefix Conforms the first part of the application display name. The suffix will be created based on the application ID. For example, xapps/osp/<wfimpl>/client/enterpriseapp/WFAPP Jar Name Displays the name of the resources jar. For example, sap.com~xapps~osp~<wfimpl>~client~resources ~java~assembly" Displays the name of the software provider. For example: sap.com.

Provider Name

3. Click on the value you want to change for a property and make your changes.

5.1.2 Translating your Workflow Application


Workflow applications are generated by default in English. However, you can make your Workflow application available for translation into the supported languages in Duet. Requirements A compression (ZIP) program to enable you to extract and to add properties files for your Workflow application. To translate the application: 1. Using the compression program, extract the properties files from the client SCA file generated for your Workflow application. The properties files are located in: <GeneratedApplication>.sca\DEPLOYARCHIVES \xapps~osp~<wfimpl>~client~enterpriseapp.sda \sap.com~xapps~osp~<wfimp>l~client~resources~java~assembly.jar \META-INF\resources\translation\

52

2. Deliver the files to the translators. Important: You must instruct translators to save the translated files using the following format: <fileName>_<locale>.properties. For example, YouCanAlsoRegion_de.properties, YouCanAlsoRegion_fr.properties Note: Translation entries overwrite existing entries. 3. Add the properties files with the translated content to the SCA file generated for the client of your Workflow application. 4. Deploy the specific SCA file in the Duet environment.

5.1.3 Deploying Your Application


You can deploy your approval workflow application on any host running Duet 1.5 SP1. In addition, you can deploy your approval workflow application directly to a host after generating the package. Prerequisites Before you deploy your approval workflow application, you need to deploy the following files on the Duet host. The files are located in your Duet 1.5 SP1 software CD in the folder: \Workflow Runtime\
OSPDUETWORKFLOW01_0.sca

This is the Workflow Service Bundle component. It is responsible for getting approval workflow applications Web service calls and sending them to the workflow component in the SAP system. This is the workflow client side runtime component responsible for processing workflow requests from the client.

OSPWORKFLOWCOMMON01_0.sca

To deploy your approval workflow application: In the Solution Explorer pane, right-click on your project for the approval workflow application and select Deploy Duet Application. Alternatively, from the toolbar select Debug and click Deploy Duet Application.

53

6 Removing a Workflow Application


You can remove a Duet business application and delete all its content in the metadata repository for a specific business application.

To remove a Duet business application:


1. Remove the software component archive file (SCA) for the specific business application using the Software Deployment Manager (SDM). 2. Undeploy the client components of the application.

7 Uninstalling the Duet Approval Workflow Configuration Template


You can uninstall the Duet Approval Workflow Configuration template. To uninstall the template: Open Add or Remove Programs from the Control Panel, and remove the Duet Workflow Configuration Tool, and the Duet Workflow Resources Repository.

54