Skip to content

Finalize the Purchase Request Process

Key Lesson: In this step, you learn how to connect the Purchase Request Process routes, start the Process from the Purchase Request Create screen, and allow authenticated users to start it at runtime.

Connect the PurchaseRequestProcessing Process so submitted Purchase Requests can move through approval, revision, procurement, and completion.

Create the routes that match the values returned by the User Task output handlers.

  1. Use the Process Editor connector to create each connection listed in the table.
  2. Select each route, then set its Name in the Properties panel to the corresponding route name.
Route nameFromTo
submitStart EventApprove PR
rejectApprove PRRevise PR
resubmitRevise PRApprove PR
approveApprove PRRequest Quotation from Vendors
sendRequestRequest Quotation from VendorsEnd Event
  1. Save your changes before continuing.

2. Start the Process from PurchaseRequestCreate

Section titled “2. Start the Process from PurchaseRequestCreate”

Connect the Submit Request button to PurchaseRequestProcessing and pass screen.request to the Process request input.

  1. Open the PurchaseRequestCreate screen.
  2. Select the Submit Request button.
  3. Configure the click action as follows:
ButtonTabPropertyValue
Submit RequestEvents → ClickAction type → Ad-hoc action
await This.$Process.PurchaseRequestProcessing.start({
  request: screen.request
})

Sys.Screen.navigateToScreen(
  This.$Screens.Home,
  {}
)
  1. Save and close the editor.

3. Allow authenticated users to start the Process

Section titled “3. Allow authenticated users to start the Process”

Update PurchasingAppAC so authenticated users can start PurchaseRequestProcessing from the Submit Request button.

  1. Go to Design → Object Types → Access Control and open PurchasingAppAC.
  2. Select the Process tab.
  3. Under Covered business objects, select PurchaseRequestProcessing.

Note

If more than one Process appears under Covered business objects, select PurchaseRequestProcessing before configuring the start restriction.

  1. In the generated start restriction, add the following code:
RestrictionCode
start
if (Sys.User.currentUser) {
  accessController.allowClient()
}
  1. Save and close the editor.

Understand how named routes connect task output to the next Process step.

Review Process configuration, runtime instances, tokens, and User Tasks.