Additional coding tips and deprecated functionality

This topic contains some coding tips on the current implementation and deprecated functionality from past implementations of custom rules and conditions in WFM.

Getting parameters

You can now get the parameters from the context. WFM does not provide parameters directly.

For example, this is an example of how you might get the parameters with getParameter() statements in the code:


RCParameters parameters = context.getParameters()
String rateType = parameters.getParameter(PARAM_USE_RATE_TYPE)
String rateMode = parameters.getParameter(PARAM_USE_RATE_MODE , "GREATEST")
boolean isApplyHtypeToBaseRate = Boolean.valueOf(parameters.getParameter(PARAM_APPLY_HTYPE_MULTIPLE_TO_EMP_BASE_RATE

Acquiring context in your script

  • The context of the script is passed to a number of services that will return data.
  • Services are now used to acquire the full context and access to data.
  • Most of the context for your script will come from the imports in the script from available APIs that Infor has exposed.
  • Acquiring context through WBData does not exist in the current implementation of the API.
  • There is no longer direct access to WBData in the current implementation of the API. For instance, you can no longer do something like this in your code:

    wbdata.getDBconnection()

  • There is now an API to which you pass the context and it will return data.

Initializing services

This is an example of how you would initialize services in your code:


LocalizationPublService localizationService = SystemPublicServiceAccess.getLocalizationService() 
ApplyRatePublService applyRateService = TAPublicServiceAccess.getApplyRateService()

Employee work details

This piece of code is very standard in many scripts since you can do a lot with employee work details. You can use the services to get data from the system and you can then manipulate that data however you want in your script:


List<WorkDetailPubl> workDetails = employeeDataService.getWorkDetails(context)