DPU Contexts and the ContextUtils Class
DPU Contexts and the ContextUtils Class
This section explains how to use DPU contexts and classes while developing DPUs. Contexts provide access to additional resources, services as well as means for communicating with the user. Every DPU has two types of contexts: the DPU execution context and the configuration dialogue context. In both cases, the context is accessible under the ctx property. This property is provided by either the AbstractDPU
or the AbstractDialog
class. The intention is to keep user contexts small so that you can easily find commonly used functions, such as localization, or checking whether the DPU was not cancelled, or access more advanced context. The user contexts accessible via ctx property are UserExecContext
and UserDialogContext
, respectively. Context accessible via ctx property is typically operated with the ContextUtils
class. This class is focused mostly on communication with the user in the form of exceptions and messages (event)s. ContextUtils
also automatically applies localization as common functions for dialogue and execution context. To get access to the working directory of the DPU, you can use: ctx.getExecMasterContext().getDpuContext().getWorkingDir()
; You can use the working directory to store temporary files needed during execution of the DPU instance.