Skip to content

Supplier Performance Evaluation KPIs (SRM)

The purpose of this page is to provide product specific tailoring guides for workflows related to Supplier Performance Evaluation KPIs (SRM component).

Prior to editing the Workflow, you should fully avail yourself of the capabilities described under:

You should also understand how to set parameters and filters as per standard SQL functions.

This Workflow can be used to automatically calculate the KPI value per supplier in a Supplier Performance and Evaluation Rating. By modifying the existing workflow, you can introduce new KPI's or modify the calculation/definition of existing KPI's.

In this page following topics will be covered:

Getting Started

We have provided the workflow template for the following KPIs.

The above mentioned KPIs have been created in the page KPIs. Therefore, you can include these in the relevant LPI groups and setups for Supplier Performance Evaluation. If new KPIs are to be added, follow Modifying the Workflow Template.

To get the workflow up and running, you should enable the projections actions.

**Follow the below steps to enable the projection actions. **

  1. Go to page Workflows.
  2. Search for srmGetAutomatedKpiValues.
  3. In the Projection Action Information click on the edit icon.
  4. Change the Action Enabled field to true for both projection actions.
  5. In your Supplier Performance Evaluation page, two commands will be visible if the projection actions are enabled.


Two projection actions are defined for the given workflow to provide both functionalities which are:

  • Run the flow for a selected KPI.
  • Run the flow for all the automated KPIs available in the supplier performance evaluation.

Access control of the user who triggers the workflow will be applied, therefore only the data that the executing user have access to will be considered. For instance data from the sites that the user have access to.

Modifying the Workflow Template

To add or modify existing automated KPIs, follow the below steps:

  • To clone the workflow, click on the version which will show you a clone icon at the top.

  • After cloning, you will see a new version of the workflow diagram which is editable.

  • Click on the Design icon at the top, which will navigate to the workflow diagram as shown below.

  • Inside the box(which is a loop), add new tasks after the Divider and make sure to connect the end of the line to the EndEvent. You can also copy the flow for a existing KPI and edit the information of the boxes, according to the new scenario.

  • Click on the first arrow after the Divider and provide the expression to identify the KPI ID as shown below.

    Here WF-DEFECT-RATE is the KPI ID.

  • Keep adding task according to your KPI Value calculation scenario. (Please refer the Example KPIs section in this document to get a better understanding on the available workflow tasks).

  • The last task Update KPI Value would be the same except for the variable that is to be updated as the KPI value.

  • Deploy the new version of the workflow ( The deployment name should be the Process ID ).

  • Make sure the projection actions are enabled.

Trigger Workflow as a Background job

User has the possibility to run the workflow as a background job if the process is too bulky. In order to do this, follow the below steps:

  • In the Projection Action Information list, click on Edit Action.

  • The execution type should be Process Enrichment (Make sure there are no user interaction tasks present in the workflow diagram).

  • Set the timing to Asynchronous.

Note: User is capable of editing projection actions to change the execution type to User Interaction or Process Enrichment according to their preference.

  • Only for process enrichment, you can set the timing to asynchronous to execute the flow as a background job for a bulky process.

  • For User interaction, you can get an input from the User at the point of triggering the workflow to add more cusotmizations to the flow. But this might have a certain impact on the performance of the flow.

Example KPI Workflows

1. Defect Rate

A detailed explanation on the diagram below will be provided in this section :

The above diagram (starting from No. 1) is the dedicated flow defined for Defect Rate.

Note: All these steps are done within the loop which is represented as a box in the workflow diagram.

Step 1: Arrow is added after the Divider in the existing diagram, which is used to identify the correct KPI. An expression is added to this arrow as mentioned above in step 5.

Step 2: This is a Projection READ task that is used to fetch records from SupplierQualitySet entity set in SupplierQualityAnalysis projection for a particular supplier. Filters can be added to the Nested Entity Parameters section as you prefer. In the case mentioned in the workflow template, the data retrieved is only filtered by the supplier ID as shown below.

(vendor_no = '${VendorNo}')

Step 3: This is a script task. Here the overall sums of quantity arrived, quantity returned and scrapped quantity is calculated and function is applied as shown below. The code for the calculation is done in JavaScript.

​ *DefectRate = ((ReturnedQuantitySum + ScrappedQuantitySum)/QuantityArrivedSum)100; **

var i;
var QuantityArrivedSum=0;
var ReturnedQuantitySum=0;
var ScrappedQuantitySum=0;
// If Supplier Quality table has no value this will be updated as the KPI Value.
var DefectRate='No Result';

// A loop to get the total of all the sums needed for equation.
// SupplierQualitySet_Set is the collection variable returned from Step 2.
if (SupplierQualitySet_Set.length) { 

    for (i=0; i < SupplierQualitySet_Set.length; i++){
        QuantityArrivedSum = QuantityArrivedSum + SupplierQualitySet_Set[i].QtyArrived;

        ReturnedQuantitySum= ReturnedQuantitySum+ SupplierQualitySet_Set[i].QtyReturnCredit +         

        ScrappedQuantitySum= ScrappedQuantitySum+ SupplierQualitySet_Set[i].QtyScrappedCredit +             

    // Calculating Defect Rate
    DefectRate = 100*((ReturnedQuantitySum + ScrappedQuantitySum)/QuantityArrivedSum); 

// Setting up an execution variable to save the Defect Rate value.
execution.setVariable("DefectRate", DefectRate);

Step 5: This is a projection UPDATE task, which will update the calculated Defect Rate value into the KPI Value. The parameter configuration is shown below.

KpiList is used as a prefix, as the entire KPI flow is inside a loop, where the loop variable is KpiList. Therefore make sure the prefix is there as shown below, to insert the correct values to fetch the record.

2. On-Time Delivery

The below figure illustrates the dedicated flow for Delivery Perfection

Step 1: Similar to the first example this arrow contains the expression to identify the record with the correct KPI ID.

Step 2: Projection read tasks is added to fetch all the records from DeliveryStatistics entity set in PurchaseDeliveryStatisticsAnalysis projection subjected to the below filters.

(vendor_no = '${VendorNo}'  
 AND promised_delivery_date >= TO_DATE('${FromDate}', 'YYYY/MM/DD')  
 AND promised_delivery_date <= TO_DATE('${ToDate}', 'YYYY/MM/DD'))

Above code snippet is added in the Define a filter box which you can find in the properties of Step 2 task.

The provided example, filters out the records according to the below conditions:

  1. For the specific supplier in the Supplier Performance Evaluation. (Mandatory)

  2. The promised delivery date being in between the Evaluation Period mentioned in the Supplier Performance Evaluation.

(Please note that the last condition was only added as an example and if you want to add other conditions, those can also be added here. If you for instance want data from a specific site to be considered, you can add a condition like: AND contract = ‘, where you replace the with the ID of the site.)

Step 3: This is the script task that consists of the below code to perform the Delivery Perfection calculation.

var i;
var OntimeQty=0;
var TotalQty=0;
var gracePeriod=1; // tolerance period for late or early deliveries (days).
var millisecToDay = 1000 * 3600 * 24; //covert milliseconds to days
var OntimeDelivery='No Result'; //Add any string to show as the KPI Value when there are no records fetched from step 2. 

if (DeliveryStatistics_Set.length) {
    for (i=0; i < DeliveryStatistics_Set.length; i++){   
        TotalQty= TotalQty + DeliveryStatistics_Set[i].QtyArrived; 

        // fetched date is in the format of dd/mm/yyyy but javascript considers date in mm/dd/yyyy format
        // below code switched mm with dd
        var RealDeliveryDateTemp= DeliveryStatistics_Set[i].RealDeliveryDate.replace(/(\d+[/])(\d+[/])/, '$2$1');
        var PromisedDeliveryDateTemp = DeliveryStatistics_Set[i].PromisedDeliveryDate.replace(/(\d+[/])(\d+[/])/, '$2$1');

        // saving the date string as a date object
        var RealDeliveryDate = new Date(RealDeliveryDateTemp);
        var PromisedDeliveryDate = new Date(PromisedDeliveryDateTemp);

        // condition to check ontime deliveries
        if ((Math.abs(RealDeliveryDate - PromisedDeliveryDate)/millisecToDay) <= gracePeriod) {
            OntimeQty= OntimeQty+ DeliveryStatistics_Set[i].QtyArrived;
   // Calculation for Delivery Perfection
   OntimeDelivery= 100*(OntimeQty/TotalQty); 
execution.setVariable("OntimeDelivery", OntimeDelivery);

Step 4: It is same as the last step in the Defect-Rate example. Only the parameter that is updated as the KPI Value has changed to OntimeDelivery.