Class RemoteBusinessRuleTaskHandler

  • All Implemented Interfaces:
    org.kie.api.runtime.process.WorkItemHandler, org.kie.internal.runtime.Cacheable

    public class RemoteBusinessRuleTaskHandler
    extends Object
    implements org.kie.internal.runtime.Cacheable, org.kie.api.runtime.process.WorkItemHandler
    Work item handler to support remote execution of rules via KIE Server.
    Supports both DRL and DMN that needs to be specified via Language data intput - defaults to DRL. Following is a list of supported data inputs:
    • Language - DRL or DMN (optional and defaults to DRL)
    • ContainerId - container id (or alias) to be targeted on remote KIE Server - mandatory
    Following are data inputs specific to DRL:
    • KieSessionName - name of the kie session to be used on remote KIE Server - optional
    Following are data inputs specific to DMN:
    • Namespace - DMN namespace to be used - mandatory
    • Model - DMN model to be used - mandatory
    • Decision - DMN decision name to be used - optional
    All other data inputs will be used as facts inserted into decision service.
    Results returned will be then put back into the data outputs.

    DRL handling is based on same names for data input and output as that is then used as correlation.
    DMN handling receives all data from DMNResult.
    • Constructor Detail

      • RemoteBusinessRuleTaskHandler

        public RemoteBusinessRuleTaskHandler​(String serverUrl,
                                             String userName,
                                             String password,
                                             ClassLoader classLoader)
    • Method Detail

      • executeWorkItem

        public void executeWorkItem​(org.kie.api.runtime.process.WorkItem workItem,
                                    org.kie.api.runtime.process.WorkItemManager workItemManager)
        Specified by:
        executeWorkItem in interface org.kie.api.runtime.process.WorkItemHandler
      • abortWorkItem

        public void abortWorkItem​(org.kie.api.runtime.process.WorkItem workItem,
                                  org.kie.api.runtime.process.WorkItemManager workItemManager)
        Specified by:
        abortWorkItem in interface org.kie.api.runtime.process.WorkItemHandler
      • close

        public void close()
        Specified by:
        close in interface org.kie.internal.runtime.Cacheable