Custom Cost callout interface

Some organizations may want to override employees' scheduled hours and costs with their own logic on the LFSO Schedule screen. The Custom Cost callout provides an interface to integrate custom code with LFSO cost calculations and the schedule user interface (UI).

Customers implementing this callout can create custom logic for employee costs. They can display up to 12 custom cost fields with their own calculation logic. The calculation logic can be implemented to behave differently when the schedule is displayed in the Daily, Weekly, or Monthly tabs.

System administrators can use Config mode to localize the field labels and configure the format of the displayed values. For example, the FieldUI for each field can be configured as CurrencyUI, NumberUI, or StringUI.

The Custom Cost callout interface has been extended to allow a more flexible way for clients to customize schedule costs in the UI (for example, customize per employee hours). This callout extension lets you plug in your own scheduleCustom.js JavaScript code to customize the schedule display on costs. The core version of scheduleCustom.js is a sample script that can be configured to work with the sample calculator (SampleEmployeeCostCalculator.java) that is provided.

Implementation details

To implement custom business logic for calculating schedule hours and costs in the UI and override the core behavior in WFM:

  1. Write a new schedule cost calculator, as demonstrated in SampleCustomEmployeeCostCalculator.java, which implements a new interface method:

    public CustomEmployeeCosts getCustomEmployeeCosts(List<Long> empIdList, Long storeSkdgrpId, Date startDate, Date endDate);

    The provided sample calculator shows how to wire and use existing services to load data and perform calculations. You can wire more services or DAOs as needed.

  2. Replace scheduleCustom.js with your implementation of two key function methods:
    • chunkLoadCustomEmployeeCostsHandler()
    • updateCustomEmployeeCosts()

    The sample scheduleCustom.js provides a demo of getting and showing employee hours from custom results that are returned from the sample calculator. The demo also shows how to update aggregated department and schedule hours/costs on the schedule page.

  3. Enable the custom cost calculation by setting the SCHEDULE_COST_CUSTOM_CALCULATOR_CLASS registry parameter to the name of your Java implementation of your custom calculator.

To try the demo/sample, set the above registry to com.workbrain2.lfso.svc.schedule.cost.callout.impl.SampleCustomEmployeeCostCalculator.

For information on the registry parameter, see Infor Workforce Management Registry Parameter Reference Guide.

Performance considerations

By default, the 12 custom fields are loaded individually during schedule edits or other user actions that affect the displayed costs. The SCHEDULE_COST_CUSTOM_CALCULATOR_LOAD_ALL_FIELDS registry parameter can be set to true for the system to load all 12 custom fields in a single call. This can improve performance in the LFSO Schedule screen.

To use this feature, the callout class must implement the getCustomScheduleCostAll() method. The sample callout implementation listed above includes a demonstration of how to use this method.