org.jbpm.process.workitem.bpmn2

## Class AbstractRuleTaskHandler

- java.lang.Object
- - org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler
  - - org.jbpm.process.workitem.bpmn2.AbstractRuleTaskHandler

- All Implemented Interfaces:
    org.kie.api.runtime.process.WorkItemHandler, org.kie.internal.runtime.Cacheable
  Direct Known Subclasses:
    BusinessRuleTaskHandler, DecisionTaskHandler

      public abstract class AbstractRuleTaskHandler
      extends AbstractLogOrThrowWorkItemHandler
      implements org.kie.internal.runtime.Cacheable

  Additional BusinessRuleTask support that allows to decouple rules from processes - as default BusinessRuleTask uses exact same working memory (kie session) as process which essentially means same kbase. To allow better separation and maintainability BusinessRuleTaskHandler is provided that supports:
  - DRL stateful
  - DRL stateless
  - DMN
  Type of runtime is selected by Language data input and if not given defaults to DRL stateless.

  Session type can be given by KieSessionType data input and session name can be given as KieSessionName property -these apply to DRL only.

  DMN support following data inputs:

  - Namespace - DMN namespace to be used - mandatory
  - Model - DMN model to be used - mandatory
  - Decision - DMN decision name to be used - optional

  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.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `DMN_LANG`
    `protected static String` | `DRL_LANG`
    `protected static String` | `STATEFULL_TYPE`
    `protected static String` | `STATELESS_TYPE`

    - ### Fields inherited from class org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler

      `handlingProcessId, handlingStrategy, logThrownException`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractRuleTaskHandler(String groupId, String artifactId, String version)`
    `AbstractRuleTaskHandler(String groupId, String artifactId, String version, long scannerInterval)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `abortWorkItem(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)`
    `void` | `close()`
    `void` | `executeWorkItem(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)`
    `org.kie.api.runtime.KieContainer` | `getKieContainer()`
    `abstract String` | `getRuleLanguage()`
    `protected void` | `handleDMN(Map<String,Object> parameters, Map<String,Object> results)`
    `protected void` | `handleStatefull(org.kie.api.runtime.process.WorkItem workItem, String kieSessionName, Map<String,Object> parameters, Map<String,Object> results)`
    `protected void` | `handleStateless(org.kie.api.runtime.process.WorkItem workItem, String kieSessionName, Map<String,Object> parameters, Map<String,Object> results)`

    - ### Methods inherited from class org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler

      `findNodeInstance, handleException, handleException, setLogThrownException`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### STATELESS_TYPE

          protected static final String STATELESS_TYPE

      See Also:
        Constant Field Values

    - #### STATEFULL_TYPE

          protected static final String STATEFULL_TYPE

      See Also:
        Constant Field Values

    - #### DRL_LANG

          protected static final String DRL_LANG

      See Also:
        Constant Field Values

    - #### DMN_LANG

          protected static final String DMN_LANG

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractRuleTaskHandler

          public AbstractRuleTaskHandler(String groupId,
                                         String artifactId,
                                         String version)

    - #### AbstractRuleTaskHandler

          public AbstractRuleTaskHandler(String groupId,
                                         String artifactId,
                                         String version,
                                         long scannerInterval)

  - ### Method Detail

    - #### getRuleLanguage

          public abstract String getRuleLanguage()

    - #### executeWorkItem

          public void executeWorkItem(org.kie.api.runtime.process.WorkItem workItem,
                                      org.kie.api.runtime.process.WorkItemManager manager)

      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 manager)

      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`

    - #### handleStatefull

          protected void handleStatefull(org.kie.api.runtime.process.WorkItem workItem,
                                         String kieSessionName,
                                         Map<String,Object> parameters,
                                         Map<String,Object> results)

    - #### handleStateless

          protected void handleStateless(org.kie.api.runtime.process.WorkItem workItem,
                                         String kieSessionName,
                                         Map<String,Object> parameters,
                                         Map<String,Object> results)

    - #### handleDMN

          protected void handleDMN(Map<String,Object> parameters,
                                   Map<String,Object> results)

    - #### getKieContainer

          public org.kie.api.runtime.KieContainer getKieContainer()

Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.