By Avinav Goel Tata Consultancy Services w.r.t. Peopletools ver. 8.46 PeopleSoft Enterprise Apps. ver. 8.8

• What is a WORKFLOW Many of the day-to-day processes in business are part of larger tasks that involve several steps and several people working together. For example, when you enter an invoice, you are initiating an approval and payment process: someone else reviews and approves it, and a third person submits payment to the vendor. The term workflow refers to this larger process. With respect to ERP (Enterprise Resource Planning), a workflow involves a set of approvers (generally in a hierarchical fashion) having different options (approve/deny/send back/sanction) towards a financial transaction (purchase order/budget sheet) or an HRMS feature (leave/loan). • TARGET AUDIENCE This white paper intends to guide a PeopleSoft Application Developer quickly and simply on how to design and prepare workflows. Further, some enhancements and alternatives are also mentioned to better utilize the power of workflows. The paper would be found useful by a PeopleSoft Functional too to gain insights into the general logic and mapping of workflows.

Create an Activity in Application Designer (File > New > Activity). Link to connect the Step Event and Worklist Step Worklist Event 3. Event and Worklist in the activity and connect these through links as shown in the fig. . Create a Business Process (File > New > Business Process) and insert the created activity into it. Arrows show the relationships between the activities.Chapter 1. below. 2.Design METHOD 1.triggerbusinessevent () based STEPS TO CREATE A SIMPLE WORKFLOW 1. Insert a Step. indicating the proper chronological sequence. ? Business Process A business process is a graphical representation of the relationships between related activities.

STEP Set the name of the Step and its description .Multiple Activities can be inserted in a single Business Process 4. 4. Activity Features. i.

The return value is not optional. false otherwise. ii. BusProcess is the name of the Business Process created 2.MCA_HLO_BP. BusActivity.MCA_HLO_FIN_ACT2.Menu name of the target component which the approver will open through worklist Bar Name of the target component Item Name of the target component Set the name of the target page which the approver will open through worklist Set the mode in which approver will open the request 4. BusEvent. Returns a Boolean value: True if successful. &SUCCESS = TriggerBusinessEvent (BusProcess. EVENT Define the event and go to ‘Edit Business Rules’ and write the following workflow code there."Medical Advance Final Status"). . BusActivity is the name of the Activity 3. BusEvent is the name of the Event created in the activity Triggerbusinessevent() function should only be used in Workflow PeopleCode. where 1.

Set the name of the Business Process of this activity 3. Set the name of the Worklist and its description • Setting the Attributes in the Worklist 1. Set the name of the Activity .Set the record name from which workflow event is to be triggered 4. Set the Worklist record 2. WORKLIST This is the most important setting that determines the nature of your workflow. iii.

the system marks the row as worked. The system uses the worklist record definition to: • • • • Link each work item with the underlying workflow tracking information. so that the user can work on it. . Set Saved when the worklist is to be deleted while saving the worklist page 3.Options to delete worklist 1. Set User Specified when the worklist is to be deleted manually 2. it adds a row to the table. Determine the order of work items in the worklist. Set Programmatic when the worklist is to be deleted through coding Set Reassignable when the approver has the authority to reassign to some other approver Set the Timeout Processing Active when the worklist is to be deleted after a specified time ? Worklist Record Worklist record determines which fields of information the system stores for each work item and in what order the work items appear. Set Selected when the worklist is to be deleted as soon as it is selected 4. Display relevant information about each work item on the Worklist page. you define what a work item in a worklist looks like. so that users can select the item on which they want to work. When a business event routes a work item to a worklist. Worklist Record Definitions When you create a worklist record definition. When a user finishes with a work item. Retrieve the record that is associated with the work item. which is stored in a workflow system record (PSWORKLIST).

and so on. you must also add the APPR_INSTANCE field as a non-key field in the worklist record definition. The system uses these fields to retrieve the associated record from the database when the user selects a worklist entry and moves to the page where the work is done. you must include all of the key fields for the search record. The business event that triggers the worklist routing. The system uses these fields to link the items in the worklist with their tracking information. Worklist Display Field WORLKIST_URL Description The text that links to the page where the user can work on the item. System Field BUSPROCNAME ACTIVITYNAME EVENTNAME WORKLISTNAME INSTANCEID TRANSACTIONID Description The business process that includes the work item. Virtual Approver. The system-assigned ID for the work item. If you’re using Virtual Approver. When an event triggers multiple routings. • Worklist Display Fields The last two fields in a worklist record definition are for descriptive information that appears in the worklist. Note the following: • • Because the system uses the values from these fields to search for the associated database record. The system-assigned transaction ID for the work item. which is stored in the PeopleSoft-defined table PSWORKLIST.System Fields The first fields in a worklist record definition must always be the following system fields. Appropriate values might include the key data for the record in which the . The activity that triggers the worklist routing. All of the application fields appear in the user’s worklist. This field stores the ID assigned to the work item for Virtual Approver processing. The system sorts the work items in a worklist based on the field immediately following the TRANSACTIONID field. They must be defined as ascending key fields in the worklist record definition. requires one additional system field. a specialized type of workflow used for approval processes. then the next field. Application Fields The next set of fields in a worklist record definition are those specific to the application that creates the worklist. but a different instance ID. unless you suppress them by including the special field WORKLIST_DESCR. each work item has the same transaction ID. It sorts based on all key fields in the record definition. The worklist in which the work item is waiting. The order of the fields is important.

OPRID can be mapped directly or through a role query Map the Key values of the worklist record to the Key values of the approver’s search record . 2. Add the key fields from the search record for the page that group users use to process the worklist entries. Mapping the fields of the Worklist Record. Create a database table using the record definition that you saved in step 3. The presence of this field automatically suppresses the display of any application fields. OPRID should be mapped with the userid of the approver. although the key fields are still used to bypass the search page of the target page. On the Worklist Details page. WORKLIST_DESCR A text comment that appears in the user’s worklist. For example. Make them key fields so that they’re used to sort the work items. Save the record definition using a name that ends with _WL.Worklist Display Field Description item will be worked. Creating Worklist Record Definitions 1. the text might be the name of the employee who submitted the report. for a work item directing a manager to approve an expense report. The worklist record must include the search record key fields so the system can locate the record on which the user must work. these values appear as the Link and Comment fields. Add the required system fields to the record definition. 4. The link also appears on the main Worklist page. 3.

. Query through which OPRID can be mapped. This query can be created through Application designer or through front end. Mapping the OPRID (Operator Id or Id of person logging in).Mapping the Key fields.

The route control type specifies the prompt tables to which this profile applies.g. Adding Route Control Types i. e. To provide access to two values. Business unit) In the Edit Table drop-down list. click the Add button. To provide access to a single value. select the lowest value in the From Value field and the highest value in the To Value field. select the prompt table against which you want to validate values.APPROVAL RULE SET WORKFLOWS (ARS) 1. if a Route Control Profile shall contain many values. You can assign values for more than one route control type to the same route control profile. BUS_UNIT_TBL_FS table has been used for the Business Unit Route Control Type and the values (all business units) would be used for Route Control Profile. Create a Route Control Type such as Business Unit or Administrative Area. E. (Optional) Assign values for another route control type.. list the first and the last value as stored in the edit table (sequentially). Select a new route control type. to route purchase requisitions to different buyers based on which vendor can supply the requested item. iii. Go to PeopleTools> Workflow> Routings & Roles> Route Control Profiles Select a route control type from the Route Control Type drop-down list.g. Alternatively. you specify with whom each buyer works. ii. If you want to make a profile having more than one values of that Route Control Type then add multiple rows of ‘From’ and ‘To’ Prompts. i. Specify the range of values from the type’s edit table that users with this profile can process. . ii. Save this page and repeat the process for each route control type. The values of the key field of this record would be used for Route Control Profile. select the same value in both fields. Make the Route Control Profile and Assign the From and To values to it. BUS(RC101) has Route Control Type Business Unit and the Route Control Profile values are From : RC101 and To : RC101. To provide access to a continuous range of values. Here you need to specify the edit table. save the Page. Assign its authorized values. Go to PeopleTools> Workflow> Routings & Roles> Route Control Type (eg. Later. you create a Vendor route control type. 2.METHOD 2. Create a route control profile as follows. ? Route control types These identify the situational factors on which you want to base routing decisions. Once you give the Required Edit Table Name.g. iii. With your cursor in the Route Control Type field. E. add a new row to the Authorized Values field.

Enter descriptive information about the approval rule set. Navigation: PeopleTools > Security > User Profiles > User Profiles Attaching route control Profile(s) to a Userid means that this User is allowed to approve the transactions related to this route control profile(s) only. displaying the General tab. Enter the name of the business process that is associated with this rule set. The Approval Rule Properties dialog box appears. Virtual Approver triggers this event when final approval occurs. Unless you specifically want to make the approval rule set effective at a particular time. a security feature in workflows. In the On Authorized group box. To create an approval rule set. Specify the currency unit for the transaction. For example. . Basically. 9. Select the Use tab. enter an activity name (associated with the business process that you’ve specified) and event nameto specify which event should be triggered when the transaction is fully approved. Open the Approval Rule Properties dialog box by selecting File. Attach Route Control Profile to the Userid used in the Approval Process.Finally. Selecting this option does not mean that transactions are automatically approved. 4. 7. 8. 5. The components of the map are individual approval steps: one for each level of approval. 3. Save the rule set and assign an effective date. such as 01/01/1900. Select Allow Self Approval if users are permitted to approve transactions that they’ve entered. self-approval is still subject to the person’s approval limits. Specify currency units for the approval rules. Specify whether users can approve their own transactions. Properties. Rule steps are the individual approval steps. this business process is one of the input parameters. When you add PeopleCode to call Virtual Approver from the transaction page. it is logical to trigger an event that notifies a buyer that the approved requisition is ready to be fulfilled. Application Designer Procedure: ? Aapproval Rule Set An approval rule set is a workflow map representing the criteria for determining which approvals are required for a transaction. File>New>Approval Rule Set 2. 1. Specify the event to trigger when all required approvals have occurred. PeopleSoft recommends a standard effective date. Go to 3rd tab of the Userid Component and there attach the Route Control Profile corresponding to the Required Role (through Route Control Hyperlink). Approval rule sets incorporate one rule step for each level of approval that might be required. Use the Icon Descr (icon description) field to specify a description that appears next to the rule set’s name in dialog boxes that list approval rule sets. after a purchase requisition is approved. 6.

If users who submit items for approval have some level of authorization. Displays a message asking the user whether to add the transaction to the workflow. The role that you select is the role of the user who approves items at this step and path. Workflow Only Message Only Both If a transaction needs further approval. the message comes from the PeopleSoft . Virtual Approver bypasses that user anyway. As long as that user has no authorization authority. for example. Specify whether the system can bypass this approval step if additional approval is required. you may include a step for that user so that your graphical map more clearly documents the entire process.When the person who submits something for approval has no self-approval authority. but the transaction doesn’t enter the workflow. and then the first rule step must represent that approval level. select all of the roles that are qualified to process the transaction at this step. users can self-approve amounts up to USD 100. However. you do not need to include a step for that person. The user sees a message indicating that the transaction needs further approval. this forwards it on to the next step without informing the user. If you select Message Only or Both.

the system sends two worklist entries when a new request comes in: one to the department manager and one to the office manager. enter the criteria in the Quantity Rule group box. but only one path. the user can approve the transaction. If the value is in the range to which the route control profile gives the user access. There are two methods of obtaining row level criteria: using a route control or a SQL object. An example of a process with multiple paths is one in which requests must be approved by the department manager and an office manager before going to a vice president. • • • . 1. the range of transactions that the user can authorize is determined by the user’s route control profile. The purchase request example following this procedure has several steps. In the Appr Step (approval step) and Appr Path boxes. When both of the managers approve the request. The associated record and field specify the record and field containing the quantity in the original transaction. If approval criteria are based on a (non-monetary) quantity. enter the criteria in the Amount Rule group box. The system compares the value from the specified record and field to the user’s route control profile. the system forwards it to a vice president. The user can authorize transactions in which the (nonmonetary) quantity is between the values in the Min and Max fields. Use the Message Catalog setting to specify the set and number of the message that the user sees.Message Catalog. RULES tab Specify which transactions the specified role users have the authority to approve. specify which step you’re defining. enter the criteria in the Row Level Rule group box. The user can authorize transactions whose monetary amount is between the values in the Min and Max fields. The associated record and field specify the record and field containing the amount in the original transaction. Here is sequence of steps and paths in this case: Step 1 1 2 A B A Path Route to Role MANAGER (DEPTARTMENT) MANAGER (OFFICE) VICE PRESIDENT In this example. You can specify which transactions a user can authorize in the following three ways: • • If approval requirements are based on a monetary amount. If the approval criteria are based on the approver’s user data. Approval processes can have multiple steps (in sequence) and multiple paths (in parallel). If you select Route Control.

Select the business event to trigger when this approver approves the transaction.EVENT tab Select the Events tab to specify which business events are triggered. . Specify which events to trigger if the user denies or recycles the transaction. depending on the action of the approver at this step.

the mapping of the listed 4 fields is done as follows: Rolename appr_fields_wrk.Rte_cntl_type1 Rte_from_value_1 appr_fields_wrk. the OPRID field is linked through RoleName>One Route Control Query.NOTE: Generally in the worklist ‘field mapping’ of the above listed activity. .fld1 Rte_to_value_1 appr_fields_wrk. we may map it to a constant if we want the workflow to be triggered to one particular approver always (through triggerbusinessevent ()).rolename Rte_cntl_type_1 appr_fields_wrk.fld1 Alternately. Here in ‘specify query bind variables’.

The valid status values are A (Approve). APPR_FIELDS_WRK. &EMAILID. Get_RoleUser(&USERID. Enter the following code exactly as it’s shown. or R (Recycle).APP_ROW_NUMBER = <current_row_number>. . NOTE: the following code should be written on an event of a non-key field of the record like APPR_FIELDS_WRK. The business process and approval rule set you want Virtual_Approver to use. These special work pages load several important Workflow PeopleCode functions into memory.APPR_INSTANCE = <RECORD>. declare function Virtual_Approver PeopleCode APPR_VA0_WRK. Declare the external workflow functions Get_RoleUser and Virtual_Approver. and P (Pending). The approval action that the current user gave to the current work item.BUSPROCNAME = BUSPROCESS. D (Denied). APPR_FIELDS_WRK. Use the Virtual_Approver function. APPR_FIELDS_WRK. these should be made hidden. Set these values: • • • The name of the role user attempting to approve the transaction. 2. 3. you must add both SaveEdit PeopleCode and Workflow PeopleCode to the record definition that is associated with that page. /* Get the role user name for the current user */ &USERID = %UserId. if you’re using route controls.ROLEUSER FieldChange. Set values in the APPR_FIELDS_WRK work record to give the Virtual_Approver function the data it needs to check the approval rules.APPR_ACTION = <approval_action>.<BusProcessName>. Adding Virtual Approver PeopleCode After you add the Virtual Approver work pages to the component with the page where the triggering event occurs. APPR_INSTANCE & APPROVAL_STATUS in your main record and APPR_ACTION & APPROVAL_STATUS on your page SaveEdit PeopleCode This is the general structure of the SaveEdit PeopleCode program: 1. WF_FUNCTIONS_01 enables the system to determine which route control types are relevant for the event that you’re triggering. /*OPTIONAL*/ APPR_FIELDS_WRK. replacing the values in angled brackets with the values that are appropriate for your application.ROLEUSER = &ROLEUSER. APPR_FIELDS_WRK. 4. D (Deny).Adding Workflow Work Pages: Every component that uses Virtual Approver PeopleCode must include the pages WF_FUNCTIONS_01 and APPR_WRK_01. &ROLEUSER). NOTE: include the three fields APPR_ACTION.APPR_INSTANCE. NOTE: while including the 2 extra pages in the component. /* Set values in the work record for Virtual_Approver */ APPR_FIELDS_WRK. For example. Set the approval status record field to the value that Virtual_Approver returns: A (Approved).APPR_RULE_SET = <approval_rule_set>. &EMPLID. &FORMID.FUNCLIB_01 FieldFormula.APPR_ACTION /* Declare the Virtual Approver workflow functions */ declare function Get_RoleUser PeopleCode APPR_VA0_WRK.

APPR_FIELDS_WRK. Setting this field is not necessary at level 0. The scroll_info is a number. this direct approach doesn’t work if the user must specify approval actions for each row in a scroll. You must have the user set the action in another field.APPR_ACTION on the page and let the user set it directly. If you’re calling the router from level 0./* Call the Virtual Approver */ Virtual_Approver().FUNCLIB_02 FieldFormula. if None(APPR_INSTANCE) then APPR_INSTANCE = APPR_FIELDS_WRK. It can also be one of the string constants: P. Usually. endif. use the CurrentRowNumber() function. Note. approval_action is the name of the record field in which the user sets the approval status. D.APPR_VR_ROW = <scroll_info>. The variables in this code are: BusProcessName Approval_rule_set Approval_action The name of the business process whose approval rules to use. However. /* Set the application record’s approval status field to the value */ /* Virtual_Approver returns */ <status_record_field> = APPR_FIELDS_WRK.APPR_STATUS. If you’re calling from a level 1 to level 3 scroll. such as Purchase Request Approval Status. . if the user specifies a single approval action for the entire page—it’s preferable to include the field APPR_FIELDS_WRK. If the user specifies the approval action at level 0 on the page—that is.APPR_INSTANCE. The name of the approval rule set that you want Virtual_Approver to use to determine whether an item needs further approval. scroll_info is 0. Workflow PeopleCode declare function Virtual_Router PeopleCode APPR_VA0_WRK. or R. The approval action to provide Virtual_Approver as input. then transfer the value to the APPR_ACTION field before the Virtual_Approver call. Current_row_number The current row number in the scroll. Status_record_field The record field that holds the approval status of the transaction. if you’re calling it from a scroll. Virtual_Router(). scroll_info is the row number of the current row in the scroll.

Alternatives & Enhancements 1.rolename=:2". Worklist item getting transferred but approval page not opening up component's search record OPRID not getting updated. The Route Control Queries (mentioned in ARS based workflows) can be studied or tested from front end (Reporting Tools> Query> Query Manager). If I want to have 2 different pages in my activity. SMTP server needs to be configured.t. “BUSINESS UNIT” . This will be a flexible design for future in case the no. 3. virtual router doesn’t check the ARS rules and request is approved fully as soon as saved. we may keep 4 roles or steps in the ARS and assign 2 roles to 1 of the approvers. routing of our workflow or approver options. we fetch OPRID values one-by-one from a separate set-up page where we maintain a list of approvers. .rte_to_value<=:1and B. 2. SQLExec("select B.RTE_CNTL_PROFILE and A. 4. "APPROVAL RULE SET". For any approver. of approvers goes up to 4 say for a different business unit or route control profile. otherwise we cannot use email/message option in activity directly in the worklist item. Please make sure to include this work field on your page if you want it to appear in the ‘map field’ box above. &ROLEUSER). when we have requirements which are highly non-uniform in nature w. In ARS based workflows. Further.rte_from_value >=:1 and A.Check the SQL view query of the search record. 8. &ROLENAME. TROUBLESHOOTING SOME COMMON WORKFLOW PROBLEMS 1. However. 3. 5. 4. We can also map OPRID to a work field OPRID to which we can assign a value on the workflow event just before we call TriggerBusinessEvent () function. any particular &ROLEUSER can also be fetched with the help of these 2 queries under a set of conditions: SQLExec("select ROLENAME from ps_appr_rule_detl where appr_rule_set = :1 AND APPR_STEP =:2". if our requirement is a 3-level workflow (i. ps_rte_cntl_ruser B where A.Chapter 2. In ARS based workflows. Further.RTE_CNTL_PROFILE = B.roleuser from ps_rte_cntl_ln A. other for deny 6. &ROLENAME). 9. 7. if you tick 'self approval’. 2. Check the ‘Worklist User’ checkbox in the Workflow tab of the userid in Peopletools>security>user profiles before proceeding ahead. it means you can approve your request but subjected to amount and quantity rules. at least one field on the page should change its value (including approval action) for trigger of workflow to next level. I can achieve that using 2 different stepssay 1 for approve. if you untick 'approval active'.r. Typically. we use the triggerbusinessevent () workflow and customize it through peoplecode.e. How to monitor my workflows(status/level of approval) from front end PeopleTools> Workflow> Monitor Worklist> Update Worklist Entries. ARS based workflows ultimately operate on triggerbusinessevent () only internally. 3 approvers). &APPR_STEP. Check the relevant role & route control profile of the user in case of approval rule set based workflows.

End of document -- .44 PeopleBook: Workflow Technology -.REFERENCES PeopleTools 8.

Sign up to vote on this title
UsefulNot useful