Developing Client-Specific Workflow
This topic provides the additional steps that must be performed for implementing workflow. This specific workflow is an enhancement to the generic workflow that is provided by default by the Group Build application. Workflow must be fully implemented by the client application developer. This topic discusses the main differences between the Group Build workflow and the standard way of implementing workflow.
Although the business process diagram looks like the Group Build generic workflow business process, you have to develop a business process for each client application to enhance the information that is provided by the Group Build generic workflow. The reasons for this are:
-
The worklist routing to enhance user information should branch the user directly to the calling-client application page.
-
The business event is triggered from the client application page.
The worklist record table has to contain key fields for accessing the client application page, so map those fields to the appropriate client application page fields (the workflow is triggered from the calling page).
The Message Agent is responsible for entering data on the client application page for triggering the specific workflow. The Database Agent executes a query that retrieves the values that are passed as Message Agent input fields. Therefore, the Database Agent query should retrieve the necessary key values, plus the condition for triggering the workflow.
You have to define a new client-specific table record (MySpecificWorkflowTable). This record stores all client application key fields, the group ID (GB_GROUP_ID) field, and the version (VERSIONGBQDM) field. Populate the MySpecificWorkflowTable after you call Group Build (to get the version number).
Summary
As a client application developer, you have to:
-
Define a new table (MySpecificWorkflowTable) for storing the page key, group ID, and version number fields.
-
Define a new worklist table record.
-
Define a derived/work field that is responsible for triggering the workflow.
-
Add this field to the client application page as a hidden field.
-
Provide PeopleCode for storing page key values before calling Group Build.
-
Define a Database Agent query for retrieving the key field values: group ID, version number, and user ID.
-
Design the business process (activities, steps, business event, worklist routing, email routing, Database Agent, and Message Agent) and define the necessary attributes and field mappings.
-
Define a new process for the modified Database Agent (MyDBAGProcess) in PeopleSoft Process Scheduler.
-
Define a new job (MySpecificJobName) that serializes PeopleSoft Application Engine, calling the section GB_EXEC in Application Engine GB_API and the modified Database Agent process (MyDBAGProcess).
-
Pass the new job name to Group Build as a parameter through a new API function, GB_SET_JOB_WF(MySpecificJobName), which passes the new job name to be scheduled, enables the specific workflow, and disables the generic workflow. The call to this function must be done before the call to GB_EXEC.
-
Add PeopleCode to save the necessary information in MySpecificWorkflowTable (see the following procedure).
To add PeopleCode to save the information in MySpecificWorkflowTable:
-
Design MySpecificWorkflowTable so that all the key fields that are necessary for accessing your client application page will be recorded.
-
Add two key fields, GB_GROUP_ID and VERSIONGBQDM, to your record.
-
Add a workflow flag, WF_FLAG.
-
-
Design MySpecificWorkflowDerived/Work.
-
Add two fields: GB_TRIGGER_WF (responsible for triggering the workflow) and OPRID (important for routings).
-
Make the fields invisible.
-
-
Define a worklist record, MyWorklistRecord, for routing to the calling client application page.
BUSPROCNAME, ACTIVITYNAME, EVENTNAME, WORKLISTNAME, INSTANCEID, and TRANSACTIONID are standard, required fields for a worklist record.
Add all of your page's key fields, plus the GB_GROUP_ID and VERSIONGBQDM fields.
-
Define the Database Agent (DBAG) query.
The DBAG query is responsible for calling the client application key field values: group ID, group version number, and user ID.
-
In PeopleSoft Tree Manager, add MySpecificWorkflowTable to the HR ACCESS GROUP, as follows:
-
Go to PeopleSoft Query.
-
Join MySpecificWorkflowTable and GB_GENERICWF on group ID and version number to return specific key values: group ID, group version number, workflow triggering flag, and user ID.
-
Include in your criteria prompts on group ID and version number.
-
Save your query as a public database agent query named "_DBAG__MySpecificWorkflowQuery".
-
-
Design the MySpecificBusinessProcess.
-
In PeopleSoft Application Designer, define a business process.
MySpecificBusinessProcess has two activities:
MySpecificWorkflowModule
MySpecificWorkflowModuleResult
Each activity has only one step branching to the client application page:
-
In the MySpecificWorkflowModule activity, add a business event, a worklist routing, an email routing, a database agent, and links.
-
Define each item and its required attributes.
The business event is triggered from the MySpecificWorkflowDerived/Work record.
-
Add workflow PeopleCode, using the button Edit Business Rules and write the code as displayed, providing the condition for calling the TriggerBusinessEvent function. Write the correct parameters: business process, activity, and business event to trigger.
-
On the Worklist Attributes page, select the record defined in step 4 as the worklist record. Specify the Business Process, its activity that works the worklist (MySpecificWorkflowModuleResult).
-
On the Field Map page, specify the mapping between the worklist record fields and your client application page keys.
-
For the OPRID field, select the role name Roleuser by Oprid Qry, binding the OPRID query variable to the MySpecificWorkflowDerived/Work.OPRID field.
-
For the email routing, define the field map between your email fields (SUBJECT, NOTETEXT, TO, CC, and BCC) and your application fields.
-
Define the Database Agent items:
Define the target component on the Message Attributes page and provide the path to your client application component.
In the Query Name field, enter the database agent query defined in Step 5.
Define the mapping between the query selection fields (second column) and your client application page fields (last column).
-
-
Go to PeopleSoft Process Scheduler and define MySpecificWorkflowDBAGProcess
-
Add a new process of type Database Agent on the Process Definitions page.
-
On the Process Definition Options page, override the parameters list in Append mode, specifying the following as parameters:
E100 -T -L /A MySpecificWorkflowModule /MD MyDatabaseAgentName
kbind1=:DERIVED_HR_GB.GB_GROUP_ID2 -kbind2=:DERIVED_HR_GB.VERSIONGBQDM
/A stands for Activity Name
/MD stands for Message Definition
-kbind1 and −kbind2 are bind variables from the API work page.
-
-
In PeopleSoft Process Scheduler, define MySpecificWorkflowJob.
Add a new job serializing the Group Build Application Engine process (the one that calls GB_API.GB_EXEC) and MySpecificWorkflowDBAG database agent process.
-
Add calls to Group Build API on your client application.
On the FieldChange PeopleCode event of your Group Build calling button, use Group Build API as described at Step 7 in the first topics of this documentation. Don't forget to call the GB_SET_JOB_WF function to activate your specific workflow and disable the generic workflow.
-
Add PeopleCode to store the necessary information in MySpecificWorkflowTable.