Top Banner
How-to Guide Developing a Decision Making Scenario using Duet Approval Workflow Template Version 1.5 – March 2010
54
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Duet Work Flow Pattern

How-to Guide

Developing a DecisionMaking Scenario usingDuet Approval WorkflowTemplateVersion 1.5 – March 2010

Page 2: Duet Work Flow Pattern

2

© 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 expresspermission 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 othersoftware 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 orregistered 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 andimplemented 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 mentionedherein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and inseveral other countries all over the world. All other product and service names mentioned are the trademarks oftheir respective companies. Data contained in this document serves informational purposes only. National productspecifications may vary. These materials are subject to change without notice. These materials are provided bySAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation orwarranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. Theonly warranties for SAP Group products and services are those that are set forth in the express warrantystatements accompanying such products and services, if any. Nothing herein should be construed as constitutingan additional warranty.

Page 3: Duet Work Flow Pattern

3

Contents1 Introduction ................................................................................................................ 5

1.1 Target Audience ................................................................................................ 5

1.2 Duet Approval Workflow Template Overview ..................................................... 5

1.2.1 How an Approval Workflow Application Works in Duet ........................... 6

1.3 Creating Your Approval Workflow Application .................................................... 7

1.3.1 Prerequisites .......................................................................................... 7

1.3.2 Terms ..................................................................................................... 8

1.3.3 SAP Notes.............................................................................................. 8

2 Configuring the SAP System for Your Workflow Application ...................................... 9

2.1 Scheduling Core Workflow Reports for Use in Duet ......................................... 13

2.1.1 Defining an OSP Filter .......................................................................... 13

2.1.2 Scheduling Reports .............................................................................. 15

2.2 Maintaining Status Mapping ............................................................................. 16

2.3 Workflow Application Handlers......................................................................... 17

2.3.1 Customizing Custom Handlers ............................................................. 18

2.3.2 Customizing the Default Custom Handler for Use inApplication-specific Custom Handler .................................................... 21

2.3.3 Using the Default Custom Handler Together with yourApplication-specific Custom Handler .................................................... 22

2.3.4 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 ABAP Client Proxies ............................................................................. 29

2.6 Configuring Logical Ports and Remote Destinations ........................................ 30

2.6.1 Defining an RFC Destination for the Action Item and Email Proxy ........ 30

2.6.2 Assigning an RFC Destination to a Logical Port for theAction Item and Email Proxy ................................................................ 32

2.6.3 Configuring Communication Destinations for Role Management .......... 32

2.6.4 Assigning an RFC Destination to a Logical Port forRole Management ................................................................................ 33

3 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

Page 4: Duet Work Flow Pattern

4

4 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 Editing the Object Identification Region ................................................ 45

4.4.2 Editing the You Can Also Region ......................................................... 46

4.4.3 Editing the Links List Region ................................................................ 48

4.4.4 Editing the History Region .................................................................... 49

4.4.5 Editing the Details Region .................................................................... 49

5 Generating the Files for Your Approval Workflow Application .................................. 49

5.1 Generating the Application Files ...................................................................... 50

5.1.1 Configuring the Application Package and Deployment ......................... 51

5.1.2 Translating your Workflow Application .................................................. 52

5.1.3 Deploying Your Application .................................................................. 53

6 Removing a Workflow Application ........................................................................... 54

7 Uninstalling the Duet Approval Workflow Configuration Template ........................... 54

Page 5: Duet Work Flow Pattern

5

1 IntroductionThis document describes how to create an Approval Workflow application using the DuetApproval Workflow template.

In addition, it describes the Duet Approval Workflow Configuration tool with which youmodify the Duet Approval Workflow template.

Using the Duet Approval Workflow template, developers, modelers, and systemintegrators can create and package Duet Approval Workflow applications for use inMicrosoft Office Outlook.

1.1 Target AudienceDeveloping a Duet Approval Workflow application requires knowledge in technologiesfrom both Microsoft and SAP.

For this reason, the target audience of this document includes people familiar with thefollowing:

Skill Description

SAP Business Workflowdeveloper/consultant

Developing a business workflow in an SAP system.

ABAP developer Customizing the connectivity code between an SAP systemand the Duet application.

Business Processexpert/.NET Developer

Modeling the Approval Workflow application using the DuetApproval Workflow Configuration tool.

SAP systemadministrator/serviceengineer

Supporting deployment processes of SAP packages andconfiguration of systems and Duet environment.

1.2 Duet Approval Workflow Template OverviewThe Duet Approval Workflow template enables you, the developer, to create an ApprovalWorkflow application for use in Duet. You can use the template to create a number ofapproval workflow applications for use with more than one SAP system.

You can customize and use the Duet Approval Workflow template based on the SAPBusiness Workflow to create an approval workflow application containing the actions andfeatures approvers need, along with decision supporting information.

Business processes require at least one person to complete a series of tasks. Suchprocesses can benefit from approval workflow applications which automate the tasks,thereby reducing costs, removing errors, speeding processes, and tracking the status ofthe process.

An approval workflow application in Duet lets you automate tasks, which often involveautomatically sending mail messages such as making a request for a trip or for vacation.

Page 6: Duet Work Flow Pattern

6

A business process enabled as an approval workflow application in Duet is initiated by arequest. One or more approvers can approve or reject the request, reassign it tosomeone else, designate someone else in place of an approver for a period, or reserve arequest for a later response.

In addition, approvers have access to relevant information in Microsoft Office Outlook tohelp them make an informed decision.

The Duet Approval Workflow template supports all types of approver relationships, asdefined in the SAP system. The following are the common types of approverrelationships:

Types Description

Singleapprover

There is only one approver for a request. This is a simple and commonworkflow.

Parallelapprovers

There is an 'AND' relationship between several approvers.

Requires all approvers of a particular step to approve a request for theflow to be complete.

A rejection by any of the approvers stops and completes this step in theprocess.

For example, both John and Jane must approve a leave request.

Multipleapprovers

There is an 'OR' relationship between several approvers.

Requires only one of the approvers to approve or reject the request tocomplete 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 thetemplate.

One of the steps can consist of a single approver while other stepsconsist of multiple or parallel approvers.

1.2.1 How an Approval Workflow Application Works in DuetWhen 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 thetask is set to Waiting for Approval.

When the approver approves the request, its status changes to Approved and amessage with the new status is displayed in the approver’s 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, theSAP system is updated accordingly, and the requester receives a notification and statusinformation.

The request is completed when all the tasks are completed. However, if a request isrejected, 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 abouthow a transaction involving the accounts, is approved, rejected or assigned to anotherperson for them to approve.

Page 7: Duet Work Flow Pattern

7

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

1.3 Creating Your Approval Workflow ApplicationBefore you create a Duet Approval Workflow application, carefully plan the actualworkflow.

There are approval workflow applications already in use in the SAP system. Using theDuet Approval Workflow template, you can enable these existing approval workflowapplications for use in Microsoft Office Outlook.

To create a completely new approval workflow application for use in Duet, first create it inyour SAP system, and then customize and extend it using the Duet Approval Workflowtemplate.

By default, the Duet Approval Workflow template provides you with mailing features foryour approval workflow application, however, you must decide on the type of approverrelationship you want to implement. Doing so allows you to identify the variousrequirements 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 areable to create an outline of the relationship between the roles.

The following is a summary of the sequence of tasks for creating an approval workflowapplication in Duet:

1. Ensure that the approval workflow application (template) you want to create in Duetalready 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 ofyour 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 PrerequisitesAfter planning the approval workflow application, make provisions for its requirements.However, the requirements of the Duet Approval Workflow template also determine yourapplication’s requirements. For your Duet approval workflow application, make sure thatyou 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.

Page 8: Duet Work Flow Pattern

8

1.3.2 TermsTo use the Duet Approval Workflow template, you must familiarize yourself with thefollowing terms:

Term Definition

Entity A building block in the model that represents one or moreactivities.

Business Rule Specifies the business logic that describes the use of theentities.

Business Task Specifies a specific process with defined steps toaccomplish a business goal.

Inbound Process Provides the logic for making approval decisions in theDuet environment, and then in the SAP system.

Outbound Process Captures the runtime instance of a workflow triggered byan application in the SAP system. Later, it broadcasts thisinstance to Duet, enabling the user to make a decisionwithin the Duet environment.

1.3.3 SAP NotesMake sure that you read and implement the following SAP notes. You can find thesenotes at service.sap.com/notes.

Note Number Description Explanation

1028938 Workflow ReleaseInformation Note

Contains relevant information available afterthe release of Duet Approval WorkflowTemplate.

Page 9: Duet Work Flow Pattern

9

2 Configuring the SAP System for Your WorkflowApplication

The Extended Notification Framework (ENF) in SAP NetWeaver is the interaction pointbetween SAP Business Workflow and Duet Approval Workflow components.

The ENF takes the instance status of an approval workflow runtime and sends thisinformation 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 SAPsystem and broadcasts the same instance to Duet, enabling the agent of the taskto take decisions within the Duet environment.

Inbound Process:Provides the mechanism for approval decisions from the Duet environment to theSAP 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 approvalworkflow application in the SAP system.

Create logical ports and RFC destinations for existing client proxies to interfacewith 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 alreadybeen 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 Guideand click Execute.

Page 10: Duet Work Flow Pattern

10

5. From Workflow Pattern Customization choose Execute on Workflow PatternCustomization. The following parameters are displayed:

Parameter Explanation

Roles Roles must be predefined in your approval workflow application. You usethe same roles as the roles in the workflow application in the SAP system.

Double-click Roles under the Dialog Structure. The Change Viewscreen opens, and you can see the roles for workflow applications.

ApplicationIdentifier

Your workflow application must have the same identifier as the workflowapplication in the SAP system. This identifier is unique for the specificworkflow 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 isWOMA.

Double-click Applications under the Dialog Structure, to see theidentifiers for all workflow applications in the SAP system.

Page 11: Duet Work Flow Pattern

11

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-specifichandlers to be invoked in the SAP system.

Tasks You view and enter the following details of each Task in your Workflowapplication in the Tasks screen:

Sub-Workflow ID:View or enter the name for a nested workflow which is part of aWorkflow. Where there is no nested workflow in a Workflow, thenenter 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 ina Workflow.

Note: You can get the step ID from the Workflow Builder in the SAPsystem. On the left hand side of the Workflow Builder, there is a sectioncalled Navigation Area which displays all the steps of a workflow,including the step IDs.

Page 12: Duet Work Flow Pattern

12

Groupware Object Type:

Specifies the groupware object type to be created for the specifictask.

The following groupware objects are supported in the Duet ApprovalWorkflow 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 variousroles.

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 theWorkflow dialog task. Every Workflow dialog task has an Agentassigned 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 Workflowtask for a given recipient role.The default bound item types in the Duet Approval Workflowtemplate are:

urn:sap:office:mySAP:Workflow.ApproverTask

urn:sap:office:mySAP:Workflow.ApproverMail

Page 13: Duet Work Flow Pattern

13

Action The Duet Approval Workflow template comes with a set of default actionsbased on the default application ID, WOMA.

The default actions are set as active. Depending on your requirements, youcan copy these actions to your Workflow application and set them asactive. 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 DuetThe 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 FilterTo 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.

Page 14: Duet Work Flow Pattern

14

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 WorkflowTask 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.

Page 15: Duet Work Flow Pattern

15

2.1.2 Scheduling ReportsSchedule 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 ScheduleRunning of Reports section of the Duet for Microsoft and SAP: SAP ERPConfiguration Guide located in SAP Service Marketplace at:service.sap.com/instguides SAP Business Suite Applications Duet Duet1.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 reportS_OSP_WF_ITEM_SELECTION and click Continue.

Note: There are no variants for this report.

j) Click Continue (without checking the Add Additional Steps checkbox).

k) Select the Date/Time radio button and click Continue.

l) Specify the desired start and end time.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_FULLvariant.

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 theSAP system exists in the Active Directory Service.

Page 16: Duet Work Flow Pattern

16

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 : OSPFilter : OSP_DELTA

Variant 2:Scenario : OSPFilter : OSP_FULL

Note: The recommended frequencies for the two variants are:Variant 1 : Every 15 minutesVariant 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 reportRSWNSEL. 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 behandled.

2.2 Maintaining Status MappingWorkflow statuses are generic and have different meanings in different applications. Forthis reason, you must define the mapping relationship between the workflow status andthe application status.

If you use the default approval workflow in an application, you must define the mappingrelationship between the workflow status and the Duet Approval Workflow status.

Since application statuses are different, they are displayed differently and inconsistentlyin the Duet client. Therefore, mapping between the application status and the DuetApproval Workflow status is required so that the Duet life-cycle status is clearly definedand all applications using the Workflow framework can adhere to the manner ofdisplaying 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

Page 17: Duet Work Flow Pattern

17

1. From Maintain Status Mapping in the Duet Implementation Guide, choose MapObject under Dialog Structure.

The screen lists all the scenarios and their corresponding Map IDs and Map Codesas follows:

Column Description

Scenario Displays the scenario for which the correspondinginformation is shown.

Map ID Displays the Map ID for the scenario.

Map Code for given ID Displays the Map code for the scenario.

Map Code Description Displays the description text for the map code.

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 themappings that have been defined for the selected application.

4. To define another mapping, click New Entries and enter the applicable scenarioname, map ID, and map code.

5. Click Save.

2.3 Workflow Application HandlersThe custom application handler is mainly responsible for application-specific dataenrichment and application-specific logic handling. The custom application handler is apluggable component.

You can write application-specific custom handlers or use only the default customhandlers. For example, to obtain detailed information about a trip, such as the cost, thedates, and shipment, you need to develop a custom handler that can retrieve suchdetails.

In addition, you can write the complete business logic in your application-specifichandler.

Page 18: Duet Work Flow Pattern

18

2.3.1 Customizing Custom HandlersYou can customize and configure the default custom handlers to be used at runtime forinbound 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 containerelements.

If the workitem is that of a generic decision task, it calls the appropriate APIs tocomplete the decision. If the workitem is that of a dialog activity task, then it setsthe status of the workitem to complete. If it encounters an error, it constructs anerror 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 theworkitem records within the application scope. Based on the information obtainedas an input, it constructs an XPROP list and reads the details of the groupwareobject, for example, the email bounditem type, the subject, and the body, beforecalling the default EMAIL/TASK APIs to Create/Update/Unbind the email andtask.

All the actions performed in the default outbound handler are controlled by one ofthe following:

The application customization and application data provided as input.

The default workflow customization under the scope WOMA and workflowbasic data.

You can use only the default custom handlers, or use them together with the handlersthat you create.

If you need to create your own application-specific custom handler, use your ownnamespace.

For example of the name for an outbound custom handler,<custom_namespace>S_OSP_<APPL NAME>_OB_CH, where APPL NAME is theapplication’s 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 ornotification in place of content provided by default.

If you want new elements in the Duet Action Pane such as a start date, and anend 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.

Page 19: Duet Work Flow Pattern

19

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 thenchoose 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 Typedisplayed must remain unchanged.

The following table shows a list of the default interface for the inbound handler.

Parameter Name Parameter Type Associated Data Type

IV_WORKITEM_ID IMPORT SWN_APPKEY

IV_DECISION_KEY IMPORT SWR_DECIKEY

IV_USER_ID IMPORT SYUNAME

IV_OPERATION_ID IMPORT S_OSP_DT_WI_OPERATION_ID

IV_WORKITEM_STATUS IMPORT SWW_WISTAT

IV_WRT_CONT_FLAG IMPORT S_OSP_DT_FLAG

IV_LANGUAGE IMPORT SPRAS

IT_WF_CONTAINER_TAB IMPORT SOSP_TT_WF_CONTAINER

IT_APPL_CONTAINER_TAB IMPORT SOSP_TT_APPL_CONTAINER

EV_ERROR_FLAG EXPORT S_OSP_DT_FLAG

ET_RETURN EXPORT BAPIRETTAB

The following table shows a list of the default interface for the outbound handler:

Parameter Name Parameter Type Associated Data Type

IT_WORKITEM_DETAIL IMPORT SOSP_TT_WF_RUNTIME_INFO

EV_ERROR_FLAG EXPORT S_OSP_DT_FLAG

ET_WORKITEM_DETAIL EXPORT SOSP_TT_WF_RUNTIME_INFO

ET_RETURN EXPORT BAPIRETTAB

Page 20: Duet Work Flow Pattern

20

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 Typedisplayed 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 theservice.

Default Function Groups Description

S_OSP_WF_BKT_PERFM_CRUD Maintains all the new and updated work items.Use this API to update the status, recipient ID, andmore.

S_OSP_WF_PATTERN_DEFLT_CH Contains the default Workflow services.

These APIs are used at runtime to execute bothInbound and Outbound processes.

You can use these default services in yourapplications.

This group also contains the default Inbound andOutbound Custom Handlers in Workflow.

S_OSP_WF_PAT_DEFAULT_CH_IB The default inbound custom handler that comeswith the Workflow Framework.

Use this default API in your application for theinbound decision making process.

You can use it independently or in conjunction withother application-specific custom handler APIs inthe inbound cycle.

S_OSP_WF_PAT_DEFAULT_CH_OB The Default Outbound Custom Handler deliveredby Workflow framework.

You can use the default API for the outboundprocess of creating and updating Outlook bounditems. Use it independently or in conjunction withother application-specific custom handler APIs inthe outbound cycle.

S_OSP_WF_DEFAULTCH_EMAIL_ITEM

Used in CRUD (Create, Update, Delete, andUnbind) operations on an EMAIL groupwareobject.

It is used for creating both Bound and UnboundEmails. The Subject and Body of the Email can bespecified as inputs.

Page 21: Duet Work Flow Pattern

21

S_OSP_WF_DEFAULTCH_ACTION_ITEM

Used in CRUD operations on a Task Groupwareobject.

You can use it to create both Bound and UnboundTasks. You can specify the Subject and Body for atask as inputs.

S_OSP_WF_PAT_DEFLT_BLD_ERRNOTF

Used for composing the content and body for anemail with links, attachments, and more.

S_OSP_WF_GET_WI_RUNTIME_INFO Used to provide runtime information for a workitem. For example, work item container element,work item status, work item step ID, and work itemtask ID, etc.

You can use the APIs as follows:

Customize the default outbound/inbound custom handler for use in yourapplication-specific custom handler.

Use the default outbound/inbound custom handler together with your application-specific custom handler.

2.3.2 Customizing the Default Custom Handler for Use inApplication-specific Custom Handler

You must specify the groupware information for CLIENT_GPW_INFO in theIT_WORKITEM_DETAIL table before passing the information to the default customhandler. This enables the creation of the email subject and body.

The default custom handler creates the email subject and body using the details presentin SUBJ_BODY_TAB, EMAIL_DETAILS, and TASK_DETAILS underCLIENT_GPW_INFO in the IT_WORKITEM_DETAIL table.

For the groupware bound and unbound Email/Tasks, provide the details forEMAIL_DETAILS and TASK_DETAILS under CLIENT_GPW_INFO in theIT_WORKITEM_DETAIL table.

You can add extra information to the client using name value pairs. Add the name valuepairs to the XPROP_LIST table under CLIENT_GPW_INFO in theIT_WORKITEM_DETAIL table.

Later, pass the IT_WORKITEM_DETAIL table to the default custom handler which takescare 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, thedefault XPROP is used.

To update transitions status, your application must use the following function,S_OSP_WF_BKT_PERFM_CRUD.

Page 22: Duet Work Flow Pattern

22

2.3.3 Using the Default Custom Handler Together with yourApplication-specific Custom Handler

To use your application-specific outbound handler with the default outbound handler, firstcall the application-specific handler before calling the default handler.

Then, repeat the steps described in the Customizing the Default Custom Handler for Usein Application-specific Custom Handler section.

2.3.4 Configuring the Body and Subject of your Emails andTasks

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-specificcustom 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 dynamicvariables, 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 anemail containing for an invoice approval application using the standard text program.How you create workflow approval email subject and body will depend on yourapplication requirements.

a) Enter transaction SE37.

b) Build a new function.c) Copy the code below and then paste it in the Source Code tab.

Page 23: Duet Work Flow Pattern

23

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 TYPE thead, "#EC NEEDED lv_changed TYPE string, "#EC NEEDED lv_invoice_text TYPE string, lv_invoice_text1 TYPE string, lv_invoice_text2 TYPE string, lv_invoice_text3 TYPE string, ls_new_header TYPE thead, "#EC NEEDED ls_invoice_detail TYPE zinvoice_details, ls_read_line TYPE tline, lt_read_line TYPE tline OCCURS 0,

value TYPE string.

CALL FUNCTION 'READ_TEXT'EXPORTINGid = 'ST'language = 'E'name =

object = 'TEXT'IMPORTINGheader = ls_header

TABLESlines = lt_read_line.

*----Dynamic variable for the invoice----*

PERFORM: text_setvalue USING '&vendorname&' is_invoice_table-vendor_name , text_setvalue USING '&invoicedate&' is_invoice_table-invoice_date , text_setvalue USING '&invoicenumber&' is_invoice_table-invoice_number."...

CALL FUNCTION 'TEXT_SYMBOL_REPLACE'EXPORTING

endline = 99999header = ls_header

init = ' ' option_dialog = ' '

program = ' ' replace_program = 'X' replace_standard = ' ' replace_system = ' ' replace_text = 'X' startline = 1

IMPORTING changed = lv_changed

Page 24: Duet Work Flow Pattern

24

newheader = ls_new_headerTABLESlines = lt_read_line.

LOOP AT lt_read_line INTO ls_read_line.CONCATENATE lv_invoice_text1 ls_read_line-

tdline 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'EXPORTINGid = 'ST'language = 'E'name =

object = 'TEXT'IMPORTINGheader = ls_header

TABLESlines = lt_read_line.

PERFORM: text_setvalue USING '&glaccount&' ls_invoice_detail-gl_account, text_setvalue USING '&costcenter&' ls_invoice_detail-cost_center , text_setvalue USING '&lamount&' ls_invoice_detail-amount , text_setvalue USING '&remark&' ls_invoice_detail-comments .

CALL FUNCTION 'TEXT_SYMBOL_REPLACE'EXPORTING

endline = 99999header = 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

TABLESlines = lt_read_line.

LOOP AT lt_read_line INTO ls_read_line.

Page 25: Duet Work Flow Pattern

25

CONCATENATE lv_invoice_text2 ls_read_line-tdline 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_namevalue = P_VALUE

value_length = 0 replace_symbols = ' '.

ENDFORM. " TEXT_SETVALUE

d) In the first CALL FUNCTION 'READ_TEXT' section, enter the value of importparameter “Name” with the name of the standard text program you created for thesubject line, for example “Z_subjectline_text”.

e) In the second CALL FUNCTION 'READ_TEXT' section, enter the value of importparameter “Name” with the name of the standard text program you created for thebody.

f) In the PERFORM: text_setvalue section, set the value for the dynamicvariables you entered in the program text.

4. Save the function.

Page 26: Duet Work Flow Pattern

26

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 TYPE string, lv_subject_body TYPE string,

*---------------Local tables lt_invoice_table TYPE zinvoice_table OCCURS 100, lt_invoice_detail TYPE zinvoice_details OCCURS 100, lt_invoice_xprops TYPE sosp_tt_xprop, lt_client_gpw_info TYPE sosp_tt_client_gpw_info, lt_subj_body_tab TYPE sosp_tt_subj_body_tab,

*--------------Local Structures ls_invoice_xprops TYPE sosp_s_xprop, ls_workitem_detail TYPE sosp_s_wf_runtime_info, ls_client_gpw_info TYPE sosp_s_client_gpw_info, ls_invoice_table TYPE zinvoice_table, ls_invoice_detail TYPE zinvoice_details, ls_subj_body_tab TYPE sosp_s_subj_body_tab.

CONSTANTS: gc_subject_info TYPE string VALUE 'Please approve invoice of vendor'.

*----Just for Check---*

SELECT * FROM zinvoice_details INTO TABLE lt_invoice_detail WHERE invoice_number = '556700023'.

LOOP AT it_workitem_detail INTO ls_workitem_detail.

LOOP AT lt_invoice_table INTO ls_invoice_table.

CALL FUNCTION 'Z_TEST_INVOICE_CH_TEXT' “here u put the fm nameof the text body/subject

EXPORTING is_invoice_table = ls_invoice_table it_invoice_detail = lt_invoice_detail

IMPORTING ev_invoice_body = lv_invoice_body.

Page 27: Duet Work Flow Pattern

27

*-----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_table-

vendor_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_infoWHERE 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_details-xprop_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.

Page 28: Duet Work Flow Pattern

28

*Fill the body text information ls_subj_body_tab-body-text_body = lv_invoice_body.

*Fill the subject text informationAPPEND ls_subj_body_tab TO lt_subj_body_tab.

ls_client_gpw_info-email_details-subj_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_details-xprop_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-subject-value = 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 containingall the details of the dynamic variables you want to display.

e) In the Just for Check section, under CALL FUNCTION, enter the name of thefunction you created in step 3.

7. Save the function.

8. Activate the function.

Page 29: Duet Work Flow Pattern

29

2.4 Workflow Default RFC and Application CustomHandler RFC

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

2.5 Creating Client Proxy Objects for Groupware ObjectsThe Duet Item Handler Web service interacts with the groupware objects in Java. Inorder to access this functionality from the ABAP environment, you must createcorresponding client proxies in the ABAP environment so that the application can useCRUD operations (Create, Update, Delete, and Unbind) in the groupware objects.

2.5.1 ABAP Client ProxiesYou must create corresponding client proxies in ABAP to enable the Duet Item Handlerto interact with the groupware objects. The following are proxies are available:

Proxy Class Description

CO_OSPWEMAIL_VI_DOCUMENT Use this client proxy to perform create,update, and delete (CRUD) operations onthe EMAIL groupware object. Use thefollowing methods:

DELETE_EMAIL

MAINTAIN_EMAIL

CO_OSPWACTION_ITEM_VI_DOCUMENT Use this client proxy to perform create,update, and delete (CRUD) operations onthe 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 onthe CALENDAR groupware object. Use thefollowing methods:

DELETE_CALENDAR_EVENT

MAINTAIN_CALENDAR_EVENT

Page 30: Duet Work Flow Pattern

30

2.6 Configuring Logical Ports and Remote DestinationsWhen you generate client proxies in ABAP for Web services, first define a remotedestination 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 EmailProxy

You must define and configure an RFC destination to enable connectivity between thespecific 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 Value to enter

RFC Destination CONNECT TO J2EE.Note that the destination name is case sensitive.

Connection Type G (HTTP Connection to Ext. Server)

Description 1 RFC destination from ERP to Duet.

4. Select the Technical Settings tab, and enter the following:

Field Values

Target Host 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. Enter the port number of the Item Handler Web service host.For example: 50000.

Path Prefix 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

Page 31: Duet Work Flow Pattern

31

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 DirectoryService (ADS).

7. Save the RFC destination service.

Page 32: Duet Work Flow Pattern

32

2.6.2 Assigning an RFC Destination to a Logical Port for theAction Item and Email Proxy

You must assign an RFC destination to the logical port. This process exposes proxyclasses 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_DOCUM4. 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 port7. 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 RoleManagement

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 Value to enter

RFC Destination CONNECT TO ROLE.Note that the destination name is case sensitive.

Connection Type G (HTTP Connection to Ext. Server)

Description 1 RFC destination from ERP to Duet.

Page 33: Duet Work Flow Pattern

33

4. Select the Technical settings tab, and enter the following:

Field Values

Target Host 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. Enter the port number of the Item Handler Web service host.For example: 50000.

Path Prefix 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 RoleManagement

You must assign an RFC destination to the logical port. This process exposes proxyclasses 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 Accesswindow.

3. Enter the /OSP/CO_RMWRAPPER_VI_DOCUMENT Proxy class.

4. Enter a logical port name. This can be any alphanumeric string, without spaces. Forexample, 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.

Page 34: Duet Work Flow Pattern

34

3 Installing the Duet Approval WorkflowConfiguration Tool

In order to install the Duet Approval Workflow Configuration tool, you must first copy theWorkflow Configuration tool zip file from the Duet 1.5 SP1 CD (located at…\Client\Tools\Workflow Configuration tool) to your machine, then extractit 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 runningWindows Server 2003.

RequirementsBefore 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 localmachine.

You defined a new system variable using the name: ant_home. This variableshould 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 Outlook2003 and Microsoft Office Outlook 2007, then you must install Microsoft OfficeOutlook 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\OBAServer\Metadata Service.

If you are using the Group Policy template, open the template and configurethe Duet Metadata Service URL to Local Host.

If you are not using the Group Policy template, go to C:\ProgramFiles\Microsoft Information Bridge\1.8\Framework and openthe Microsoft.OBA.SystemTray.exe.config file. Then, change the URLproperties of the Duet Metadata Service to Local Host.

3.1 Overview of the Duet Approval WorkflowConfiguration Tool

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

Page 35: Duet Work Flow Pattern

35

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 Workflowtemplate.

Generate and package all the files for the modeled application.

In addition, it enables business experts, analysts, and programmers to define tasks andtask flows, and to add controls to create a model for a Workflow application. A Workflowapplication 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 project’s folder. Themodel in the default Workflow Template is displayed.

From Microsoft Visual Studio, you modify the default Duet Approval Workflowtemplate using the following:

Menu bar Contains the menu entries to use for all modeling tasks.

Some menu entries are not available.

Toolbars Presents relevant toolbars for modeling.

SolutionExplorer

Displays all the files for the model and the project.

Page 36: Duet Work Flow Pattern

36

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 theproperties of the entities of that constitute it.

In addition, you can view the text files and the various XML filescreated for the model.

The model area displays the main objects for the Duet ApprovalWorkflow application: model data source, link to approval objects,and approval objects with their action panes.

PropertiesConfigurationRegion

Contains the configuration data for the selected entity in the model.It is available only when you select or drag an entity into theappropriate receptacle entity.

Edit ContentPop-Up

Opens as a window in which you edit and configure the content forthe selected and active entity.

Zoom In andOut

Press <Ctrl> and the plus (+) key of the keyboard to enlarge anddisplay 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 WorkflowApplication

With the Duet Approval Workflow template, you create approval workflow applications foruse in Duet. The approval workflow applications that you create extend the functionalityof existing approval workflow applications in the SAP system.

For this reason, you need to collect specific information about the approval workflowapplication in the SAP system, and later provide the information collected in the DuetApproval Workflow template when you model your approval workflow application for usein 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 ProceduresOnce the application has been installed, you can start working in one of the followingmodes:

Release Mode Debug Mode

Page 37: Duet Work Flow Pattern

37

3.3.1 Release ModeThe Release Mode will generate and package the application into an SCA file. This SCAfile 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 beencreated.

3.3.2 Debug ModeThe Debug mode will enable you to work locally, disconnected from any SAP system orJ2EE server. Select this mode if you want to be able to check the client side withouthaving 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 InformationBridge\1.8\Framework), create another folder called External Resources.

2. Copy the following assemblies from the Template Repository/Binary folder (<Add-in installation folder>\Template Repository\BINARY) into the IBFframework 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-ininstallation folder>\Template Repository\EXTERNAL) into theExternal Resources folder.

3.4 Creating a New Duet Approval WorkflowConfiguration 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 ApprovalWorkflow templates cannot be used in the same project.

4 Customizing the Duet Approval WorkflowTemplate

You can modify the Duet Approval Workflow template and save it as a new template, ormodify 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.

Page 38: Duet Work Flow Pattern

38

In order to customize the Duet Approval Workflow template, you must be defined as aDuet 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 ModelWhen you open the Duet Approval Workflow template, it displays the default modelcontaining 3 main entities:

Workflow Application Represents the entire application. Container for all the otherelements here described.

When selected, you can define the following in the Propertiespane:

Application ID (ID must not exceed 6 characters) Application Name Application User Role

Page 39: Duet Work Flow Pattern

39

Model Data Source Represents the SAP system you want to configure for yourworkflow application. It contains a list of parameters based onthe default workflow application identified as WOMA, in theSAP system.

This entity is connected directly to the Workflow Item: Mail andTask, denoting a relationship between the two entities.

Note: You cannot delete the Model Data Source entity,but you can edit its contents.

Workflow Item: Mailand Task

Represents the default mailing features and the activities toautomate for the workflow application.

Note: You cannot delete the Workflow Item: Mail andTask entity. In addition, it cannot include other entitiesexcept the Action and the Duet Action Pane regions.

Action Entity: The Actions entity contains the toolbardefinition. You can edit the toolbar definition by adding orremoving toolbar items.Duet Action Pane Entity: The Duet Action Pane entityrepresents the Duet Action Pane that will be invoked for theworkflow application in Microsoft Office Outlook.

Note that the Duet Action Pane is the only entity to which youcan add regions.

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

Page 40: Duet Work Flow Pattern

40

The Toolbox pane in Microsoft Visual Studio contains the regions available for use in theDuet 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 Propertiespane displays the properties of the selected region in the model.

4.2 Editing the Model Data Source EntityThe Model Data Source entity in the default model of the template contains a list ofparameters based on a Workflow application identified as WOMA.You can edit these parameters from the Edit SAP System Content dialog box, whichcontains the Parameters List and the Parameter Details areas.

The Parameters List is a list of predefined data collected based on the default workflowapplication in the SAP System. The list shows the Default Label and the ParameterName 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 aparameter directly to the Model Data Source entity. You can change the parameter nameor delete it together with its information.

Note: You cannot delete the predefined parameters.

Page 41: Duet Work Flow Pattern

41

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 newone.

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. Theparameter name cannot be more than fifty characters.

Note: Changing the default label after the label had been used in the differententities, 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 itappears 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 isthe default value for the parameter.

6. Click Map Values to Labels. In the window displayed, enter the value for the sourceand the target. Click Add and OK to map a value to a label.

Page 42: Duet Work Flow Pattern

42

7. Use this option to define a mapping relationship between numeric codes in the SAPsystem 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. Thisinformation will help others using the template to quickly identify the parameter in theSAP system.

10. From the Synchronization drop-down list box, select the desired behavior forsynchronization. This defines the source of the data to use when updating the value.The synchronization options are:

Override Outlook Valuesfrom SAP System

Uses data from the XML from the SAP system.This data is not related to the value of theparameter in Microsoft Office Outlook.

Override SAP SystemValues from Outlook

Uses the data from Microsoft Office Outlook andnot from the XML from the SAP System.

Use this option where the value depends on theuser’s actions.

SAP Systemrepresentation

Use only the data from the XML from the SAPsystem.

UI representation Use only the data from Microsoft Office Outlook.

Page 43: Duet Work Flow Pattern

43

4.3 Editing the Workflow Item: Mail and Task EntityThe Actions region holds all the actions available in the default model. These actionscan be edited from the Edit Action dialog box, which contains a list of the availableactions 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 ordelete 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 Workflowapplication in Microsoft Office Outlook.

4. Click OK.

Page 44: Duet Work Flow Pattern

44

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 actionare available in the application at runtime. This activity should also exist in the SAPsystem.

When an action is not enabled, it is not available in the application, and it does notappear 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 EntityThe Action Pane entity in the model represents the Duet Action Pane as it appears inMicrosoft Office Outlook. The pane contains the Duet-specific functionality that enablesthe 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, andcannot 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 automatedtasks, in the Duet Action Pane. It can be configured.

In addition to the default regions, the Duet Action Pane can contain any of the regionsavailable in the Toolbox, including the following:

Link List Region:

Specifies the capabilities of other applications that can be used together with thecurrent 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 beconfigured.

Page 45: Duet Work Flow Pattern

45

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 toit, and edit their properties.

4.4.1 Editing the Object Identification RegionYou can edit the Object Identification (OID) region by adding parameters related to thetask for the Workflow application, and changing the order of labels and the label-valuepairs.

The parameters appear as a list of predefined labels. Each label is mapped to aparameter 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 newone.

Page 46: Duet Work Flow Pattern

46

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 DataSource 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 RegionYou can edit the You Can Also region by adding links related to the task, such as OpenDuet Application Help, for the Workflow application.

The Edit Links List dialog box contains a list of predefined labels. Each label is mappedto a URL address.

Page 47: Duet Work Flow Pattern

47

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 parameterfrom 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 thevalue.If you selected Dynamic, from the SAP System Parameter drop-down list box, entera 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.

Page 48: Duet Work Flow Pattern

48

4.4.3 Editing the Links List RegionYou can edit the Links List region by adding links to Web sites, and other activitiesrelated 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 mappedto 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 parameterfrom the SAP system.

The value you specify is displayed as part of the URL address.

Page 49: Duet Work Flow Pattern

49

6. If you select Static, enter a name for the value you want to add and specify thevalue.If you selected Dynamic, from the SAP System Parameter drop-down list box, entera 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 RegionThe History region is one of the default regions in the Duet Approval Workflow templatemodel. This region represents information about the activities already carried out by theWorkflow 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 RegionYou edit the Details region just as you edit the Object Identifier region. For moreinformation, see Editing the Object Identification Region.

5 Generating the Files for Your ApprovalWorkflow Application

After editing and configuring the entities in the model to suit your Duet ApprovalWorkflow application, you are ready to generate and package all the files for theapplication.

You can write documentation for your approval workflow application using theWF_HELP.chm file, located in the folder: \resources. The template automaticallygenerates 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 ifyou include the link in the model for your application.

You can replace the workflow.snk located in the \resources folder with your own snk filewhich will then be used in the generated application’s assembly.

Note: In order to be loaded, the generated assembly needs to be fully trusted bythe .Net framework. For example, you can establish trust from the followinglocation: Run > Settings > Control Panel > Administrative Tools> .NET Framework 2.0 Configuration > Runtime Security Policy> Increase Assembly Trust.

Page 50: Duet Work Flow Pattern

50

5.1 Generating the Application FilesYou use the debugging tool in Microsoft Visual Studio to generate your Duet Workflowapplication.

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 youspecified. 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 bedeployed.

Page 51: Duet Work Flow Pattern

51

5.1.1 Configuring the Application Package and DeploymentYou 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 thesame 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 inPackaging: Deployment and Packaging.

Page 52: Duet Work Flow Pattern

52

You can change the following properties for each package:

Property Description

SDM host Specifies the name or the IP address of the SoftwareDeployment Manager (SDM) host. You use the SDM todeploy the *.sca application file.

For example, http://localhost.

SDM Port Specifies the SDM tool port number. The default is 50018.

Compatibility Version Specifies the version of the Duet approval workflowapplication.

The recommended format to use is: 1000.<Duetversion>.<J2EE version>.<Duet service pack>.<Patchversion>

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"

Provider Name Displays the name of the software provider. For example:sap.com.

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

5.1.2 Translating your Workflow ApplicationWorkflow applications are generated by default in English. However, you can make yourWorkflow 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 foryour 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\

Page 53: Duet Work Flow Pattern

53

2. Deliver the files to the translators.

Important: You must instruct translators to save the translated files using thefollowing 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 theclient of your Workflow application.

4. Deploy the specific SCA file in the Duet environment.

5.1.3 Deploying Your ApplicationYou 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 aftergenerating the package.

PrerequisitesBefore you deploy your approval workflow application, you need to deploy the followingfiles on the Duet host. The files are located in your Duet 1.5 SP1 software CD in thefolder: \Workflow Runtime\

OSPDUETWORKFLOW01_0.sca This is the Workflow Service Bundle component. Itis responsible for getting approval workflowapplications Web service calls and sending themto the workflow component in the SAP system.

OSPWORKFLOWCOMMON01_0.sca This is the workflow client side runtime componentresponsible for processing workflow requests fromthe client.

To deploy your approval workflow application:

In the Solution Explorer pane, right-click on your project for the approvalworkflow application and select Deploy Duet Application.

Alternatively, from the toolbar select Debug and click Deploy Duet Application.

Page 54: Duet Work Flow Pattern

54

6 Removing a Workflow ApplicationYou can remove a Duet business application and delete all its content in the metadatarepository 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 WorkflowConfiguration 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 DuetWorkflow Configuration Tool, and the Duet Workflow Resources Repository.