Creating Rules in Process Composer and using them in Process

Similar documents
Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

POWL: Infoset Generation with Web Dynpro ABAP

Dialog Windows in WebDynpro ABAP Applications

Using Radio Buttons in Web Template

Table Row Popup in Web Dynpro Component

Easy Lookup in Process Integration 7.1

BAPI Execution in offline Adobe Form

Add /Remove Links on ESS Home Page in Business Package 1.5

Web Dynpro: Coloring Table Conditionally

Fetching User Details from the Portal and Displaying it in Web Dynpro with Authentication in the Portal

Linking Documents with Web Templates

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP

Federated Portal for Composite Environment 7.1

MDM Syndicator: Custom Items Tab

MDM Import Manager - Taxonomy Data (Attribute Text Values) Part 3

Freely Programmed Help- Web Dynpro

Replacement Path: Explained with an Illustrated Example

Graphical Mapping Technique in SAP NetWeaver Process Integration

Web Dynpro ABAP: Changing ALV Contents and Saving in Database

Dynamically Enable / Disable Fields in Table Maintenance Generator

SDN Community Contribution

Step by Step Guide How to Use BI Queries in Visual Composer

Material Listing and Exclusion

Internationalization in WebDynpro ABAP Applications

Step By Step: the Process of Selective Deletion from a DSO

Upload Image file from system in Web dynpro view

Displaying SAP Transaction as Internet Application in Portal

Material Master Archiving in Simple Method

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP

Developing Crystal Reports on SAP BW

How to Create Business Graphics in Web Dynpro for ABAP

E-Sourcing System Copy [System refresh from Production to existing Development]

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Standalone BW System Refresh

Custom Password Reset Tool in SAP Enterprise Portal Using Web Dynpro for Java

Adding Files as Attachments to SAP Interactive Forms in the Java Environment

Solution to the Challenges in Pivoting

SDN Community Contribution

Web Dynpro ABAP: Dynamic Table

Creation of Alert Data Service VC model for the BI query exception using Information Broadcasting

ios Ad Hoc Provisioning Quick Guide

Recreating BIA Indexes to Address the Growth of Fact Index Table

How to Integrate SAP xmii Services with Web Dynpro Java

How to Create and Schedule Publications from Crystal Reports

Web Dynpro Interactive Forms Data Transfer and Scripting

ABAP HR: Standard Info Type Enhancement

How to Create Tables in MaxDB using SQL Studio

Step By Step Procedure to Implement Soap to JDBC Scenario

Step by Step Guide on How to Use Cell Definition in BEx Query

DB Connect with Delta Mechanism

How to Integrate Web Dynpro ABAP in Portal and Capture Portal Logon User Name

Totals in Adobe forms

Step by Step Procedure for DSO Creation

How to Download Multiple Files in ZIP using WebDynpro Java

Working with Tabstrip in Webdynpro for ABAP

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

Load Info Cube in SCM 5.0 (BI 7.0)

SUP: Personalization Keys and Synchronize Parameter

Table Properties and Table Popin

How to use Boolean Operations in the Formula as Subsidiary for IF Condition

SAP BI BO Unit/Currency Logic for Unknown Units Case Study

ecatt Part 6 System Data Container

Setting up Connection between BW and R/3 for Data Load

Using Nested Exception Aggregation in BEx Reports- Scenario

Federated Portal Network Remote Role Assignment Step-by- Step Configuration

How to Display Traffic Lights for Exceptions in BI Web Reports

Implying Security on Business Object XI 3.1 Universe having SAP BW as Source

Deploying BusinessObjects Explorer on Top of a SAP BI Query

Printer Landscape Made Easy!!

Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008)

How to Configure User Status in mysap SRM

Step-By-Step guide to Virtual InfoCube Implementation

Reading Enhanced DataSource fields for the Remote Cube

Common Queries/Errors while working with Adobe Print PDF Forms

Creating Multiple Methods/Operations and Exposing BAPI as a Webservice

Creating, Configuring and Testing a Web Service Based on a Function Module

How to Work with F4 Input Help Effectively in BEX

How to Create View on Different Tables and Load Data through Generic Datasource based on that View

Step by Step Method for File Archival in BW

Data Extraction & DS Enhancement in SAP BI Step by Step

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure

Purpose of Goods Receipt Message indicator in Purchase Orders

Validity Table in SAP BW/BI

Limitation in BAPI Scheduling Agreement (SA) Create or Change

Step by Step Guide for PI Server Start and Stop Procedure

SDN Community Contribution

Creation of Key Figures with Higher Decimal Place Precision

Extraction of Hierarchy into Flat File from R/3 and Loading in BW System

Currency Translation in SAP BI Step by step Guide

How to Develop a Simple Crud Application Using Ejb3 and Web Dynpro

How to Default Variant Created for Report Developed In Report Painter/Writer

WDA Tutorial II: Using Select Options in a WDA Application

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts.

Data Flow During Different Update Mode in LO Cockpit

A Step-by-Step Guide on IDoc-ALE between Two SAP Servers

Information Broadcasting Part 3 Scheduling the First Report

Data Mining: Scoring (Linear Regression)

Financial Statement Version into PDF Reader

Transcription:

Creating Rules in Process Composer and using them in Process Applies to: SAP NetWeaver Composition Environment 7.1 EHP-1 Version. For more information, visit the Composition homepage. Summary This article deals with creating user defined rules set from process composer itself and then using them in the process. This also briefs up on creating decision table in rules set. The article expects the user to have undergone the tutorial End-To-End process implementation sample. Author: Srinivasan Subbiah Company: HCL Technologies Created on: 05 January 2009 Author Bio Srinivasan Subbiah is an Application Developer working in HCL Technologies Limited on SAP NetWeaver Technology (CAF, Web Dynpro for JAVA, Guided Procedures and BPM). 2008 SAP AG 1

Table of Contents Introduction...3 Editing the Web Dynpro Component...4 Creating the RuleSet...6 Creating a Decision Table...7 Editing the Process...13 Testing the Application...16 Related Content...17 Disclaimer and Liability Notice...18 2008 SAP AG 2

Introduction After following the End-To-End process implementation, we will have a process with two human activities. First human activity will get the name and age. Second human activity will display them. We would have assigned User_A for first activity and User_B for the second one. In this article, we will have one more variable namely agestatus along with name and age in C_DisplayMyNameAge webdynpro component. Depending on the name and age, the agestatus variable will be set and will be displayed in the Display Name Age human activity. This will be achieved using the rule set, we will create in the process composer. The rule set will be consumed by a mapping activity. This mapping activity will be placed between the two previously created human activities. The process diagram after following End-to-End process implementation article will look like the following figure. 2008 SAP AG 3

Editing the Web Dynpro Component We have to add a string variable to the interface controller, component controller of C_DisplayMyNameAge and have to edit the view for showing it. Add the variable in the component controller and copy it to the interface controller as described in the specified article. Go to the view s context and create a variable and map it to that of component controller. View Controller: Go to view s layout. Add a new text view element to the root element and bind it to the agestatus attribute in the view s context. 2008 SAP AG 4

Save the application and deploy it. Go to Development Infrastructure perspective and select the process component dc_my_name_age. Right click on it and select Sync Used DCs. 2008 SAP AG 5

Creating the RuleSet Go to Process Composer perspective. Navigate to dc_my_name_age Process Modelling Rules and Functions. Right Click and select New RuleSet. In the New RuleSet pop-up, enter the CheckNameAndAge for Name field. Leave the Return Type to be String. In Parameters, add two string variables namely name, agestatus and an integer variable, age. We will use the variables name and age in the condition. The result will be saved in the variable agestatus. It should be noted that the data type of both agestatus and Return Type are same. 2008 SAP AG 6

CheckNameAndAge tab will open automatically. In the Result field, from the drop down, select agestatus. Here we are setting agestatus as the return variable. The value in agestatus will be returned to the process after executing the rule. Creating a Decision Table We will create a decision table. This decision table will check the name and age and accordingly will set the agestatus variable. For simplicity, we will check if the name is John and the age is less than 20, set agestatus as Teenage Boy, else if age is greater than 20, set agestatus as Young Man. If the name is Julie and age is less than 19, set agestatus as Teenage Girl, else if age is greater than 20 set agestatus as Young Lady. Go to Decision Tables, and click on New. Give a name in the Decision Table Name field and click on Next. 2008 SAP AG 7

Here for us the conditions we need to check are name and age. So from Available Conditions add name and age to the Selected Conditions. Click Next. 2008 SAP AG 8

Next we have to select the action. When a condition is satisfied this action will be executed. For us, this action should assign a string to the agestatus as this will be returned back. So from Available Actions add agestatus={string} to Selected Actions. 2008 SAP AG 9

Select Finish. The decision table will be opened automatically. Now we have to enter the condition and action values. Right click on Default Value under name and select Add Condition Values. Enter the condition value for name. In our case, it will be John. 2008 SAP AG 10

Click ok. Delete the default value by right clicking it. Similarly add the values for age and agestatus and values for Julie also. The final decision table will look like this. For setting the agestatus, we can fill a static string by just clicking on the cell and entering the value. Alternatively, we can also manipulate the values using Set Dynamic Value property which we will get by right clicking on the cell. We have to create a rule. This rule will be called in the process and it will have to execute the decision table. Select the Overview tab. Go to the Rules section. Create a new rule by clicking on New button. Enter the name of the rule as CheckNameAndAgeRule. The rule will open. Click on the add(+) button under If. Select Operation.isSuccessful() and double click on name in the options as shown below. Then similarly select the value true and enter * there. 2008 SAP AG 11

Similarly select the add symbol under Then and select Evaluate Decision Table CheckNameAndAgeDecisionTable. Finally the rule will look like this. Thus we have created a rule which will be executed for any name entered. 2008 SAP AG 12

Editing the Process Now we will edit the process. We will add a mapping activity and a String Data Object for accommodating the agestatus in the process context. First we will create a Data Object. Select the Display Name Age human activity and from quick buttons select Artifacts. Enter a name for it. Select String data type for the data object from Data Type tab. Now we will create a Mapping activity. Delete the connection between the two human activities. Select Fill Name Age and create a mapping activity. Give a name to the mapping activity say RuleInvoker. Form a sequence connection from RuleInvoker mapping activity to the Display Name Age human activity. 2008 SAP AG 13

The process diagram will look like this. Select the RuleInvoker mapping activity and select Mapping tab. Drag FillMyNameAgeContext Name and FillMyNameAgeContext Age from left hand side to the AgeStatus in the right hand side. Double click on the red marked icon for editing the function. Remove the existing function. Select the rule set we created from Rules And Context demo.sap.com/dc_name_age CheckNameAndAge. From the Context, drag and drop the name and age. The final expression will be like the following. 2008 SAP AG 14

Make sure to fill an empty string for agestatus. Click OK. Select Display Name Age and do input mapping. Save the application, build and deploy it. 2008 SAP AG 15

Testing the Application Start the process from NetWeaver administrator. Using the User_A s account, log onto the portal. In his work items we can find FillMyNameAge activity. Open it and fill the details. Using User_B s account, log on to portal. Open the activity, DisplayMyNameAge. There we can see the output. It can be seen that since name is John and age is 27, we are getting the statement Young Man. Similarly you can also test the other options also. 2008 SAP AG 16

Related Content End-To-End process implementation How to use Decision Tables in Rules Composer Building a Composite Application from scratch-part 3 For more information, visit the Composition homepage 2008 SAP AG 17

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 2008 SAP AG 18