Understanding Business Project Process Definition
This section discusses:
Definition of workflow actions that run processes.
Definition of processes that dynamically instantiate sub-business projects.
PeopleCode for setting task status.
When a task can be performed with an Application Engine process, you use a workflow action to schedule the process. For example, the delivered order fulfillment business project includes a task with a workflow action that schedules a process. The process triggers the EIP that publishes order information to the order fulfillment system.
Follow these guidelines when creating an Application Engine process to be used with a business project:
Make sure that the state record includes the RC_BP_AE_SBR subrecord.
The fields in this record store information about the business project that is instantiated.
Make sure that the state record includes the RUN_CNTL_ID field and uses it to store the run control ID.
This process does not use any other field names (for example, RUNCNTLID).
The first step in the program should be a call to the POPULATE section in the RC_BPAET_LIB library.
This section populates the RC_BP_AE_SBR subrecord.
When the program completes a task, it can call the Trigger_Transition function to update the task status.
Fields in the RC_BP_AE_SBR Subrecord
The following fields provide the Application Engine process with information about the business project from which the process is invoked:
ACTIVITY_INSTANCE
BUS_PROC_INSTANCE
COMPONENT_ID
MAIN_ACTIVITY_ID
MAIN_ACTIVITY_INST
MARKET
NESTED_BP_IND
PARENT_ACTIVITY_ID
PARENT_ACTVTY_INST
PARENT_BP_INSTNCE
PROCESSNAME
PROCESSTYPE
RC_ACTIVITY_ID
RC_BUS_PROCESS_ID
RC_MAIN_BP_INSTNCE
RC_OUTCOME
RC_TASK_ID
RC_TASK_STATUS
SEQ_NUM
To dynamically instantiate a sub-business project at runtime, you need to:
Create a task at the point in the phase when the sub-business project is instantiated.
Set up the task to trigger an Application Engine process.
In the process, create logic to determine which sub-business project to instantiate.
In the process, call the Nested_Business_Project_Start function to instantiate the sub-business project.
Nested_Business_Project_Start Function
The Nested_Business_Project_Start function (in DERIVED_RC_BP2.RC_BUS_PROCESS_ID.FIELDFORMULA) instantiates the specified sub-business project. Use the following syntax:
&dyn_sbp_inst = nested_business_process_start(&D_nbp_id, &nbp_effdt, &D_nbp_instance, &main_bp_instance, &nbp_activity_id, &nbp_activity_instance, &component_id, &task_seq_number, &run_parallel);
The function returns the instance ID of the instantiated sub-business project.
The following table describes the function parameters:
Parameter |
Description |
---|---|
&D_nbp_id |
The ID of the sub-business project to be instantiated. |
&nbp_effdt |
The effective date of the sub-business project to be instantiated. |
&D_nbp_instance |
The ID of the business project instance under which the sub-business project is instantiated. This can be either a main business project or a sub-business project. |
&main_bp_instance |
The ID of the main business project instance under which the sub-business project is instantiated. If the sub-business project is not under another sub-business project, this is the same as &D_nbp_instance. |
&nbp_activity_id |
The ID of the phase under which the sub-business project is instantiated. |
&nbp_activity_instance |
The ID of the phase instance under which the sub-business project is instantiated. |
&task_seq_number |
The sequence number of the task that triggers the workflow action that calls the Nested_Business_Project_Start function. |
&run_parallel |
Set to Y (yes) if the sub-business project runs in parallel with the task whose sequence number is &task_seq_number. Set to N (no) if the sub-business project runs after the task whose sequence number is &task_seq_number. |
Note: The values for the parameters that refer to the business project instance, phase instance, activity instance, and task sequence number are available in the state record of the Application Engine process.
PeopleSoft delivers an example of the Nested_Business_Project_Start function in the RBT_STARTSBP process.
Use the Trigger_Transition function (in FUNCLIB_RC_BP3.TRIGGER_TRANSITION.FIELDFORMULA) to set the status and outcome of a task or sub-business project that functions as a task. Depending on the business project definition, setting the outcome of a task or sub-business project may trigger a phase transition.
You can call this function from a process (such as an Application Engine process), from PeopleCode (for example, on the page where a user completes a task), or from an EIP.
Use the following syntax for the Trigger_Transition function:
Trigger_Transition(&Business_Proc_Instance, &Bp_Id, &Activity_Id, &Activity_Instance, &Task_Id, &Task_Seqnum, &Sub_Bp_Id, &Status, &Outcome, &Process_Type, &Process_Name)
The following table describes the function parameters:
Parameter |
Description |
---|---|
&Business_Proc_Instance |
The ID of the business project instance associated with the current task or sub-business project. |
&Bp_Id |
The ID of the business project associated with the current task or sub-business project. |
&Activity_id |
The ID of the phase associated with the current task or sub-business project. |
&Activity_Instance |
The ID of the phase instance associated with the current task or sub-business project. |
&Task_Id |
The ID of the current task whose status and outcome are set. Use this only when setting status for a true task, not for a sub-business project. If you use this parameter, set the &Sub_Bp_Id parameter to spaces. |
&Task_Seqnum |
The sequence number of the current task or sub-business project. |
&Sub_Bp_Id |
The ID of the current sub-business project—the one whose status and outcome are to be set. Use this only when setting status for a sub-business project. If you use this parameter, set the &Task_Id parameter to spaces. |
&Status |
The status to assign to the current task or sub-business project. |
&Outcome |
The outcome to assign to the current task or sub-business project. |
&Process_Type |
The type of process that is setting the status and outcome, for example, Application Engine. This parameter is useful for auditing and troubleshooting. |
&Process_Name |
The name of the process that sets the status and outcome. This parameter is useful for auditing and troubleshooting. |
PeopleSoft delivers an example of the Trigger_Transition function in the BPMINITEST process.