congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ProcessContext.setProcessInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
setProcessInstance
method
in
org.drools.core.spi.ProcessContext

Best Java code snippets using org.drools.core.spi.ProcessContext.setProcessInstance (Showing top 3 results out of 315)

origin: kiegroup/jbpm

public void handleException(ExceptionHandler handler, String exception, Object params) {
  
  if (handler instanceof ActionExceptionHandler) {
    ActionExceptionHandler exceptionHandler = (ActionExceptionHandler) handler;
    Action action = (Action) exceptionHandler.getAction().getMetaData("Action");
    try {
      ProcessInstance processInstance = getProcessInstance();
      ProcessContext processContext = new ProcessContext(processInstance.getKnowledgeRuntime());
      ContextInstanceContainer contextInstanceContainer = getContextInstanceContainer();
      if (contextInstanceContainer instanceof NodeInstance) {
        processContext.setNodeInstance((NodeInstance) contextInstanceContainer);
      } else {
        processContext.setProcessInstance(processInstance);
      }
      String faultVariable = exceptionHandler.getFaultVariable();
      if (faultVariable != null) {
        processContext.setVariable(faultVariable, params);
      }
      action.execute(processContext);
    } catch (Exception e) {
      throw new RuntimeException("unable to execute Action", e);
    }
  } else {
    throw new IllegalArgumentException("Unknown exception handler " + handler);
  }
}
origin: org.jbpm/jbpm-flow

public void handleException(ExceptionHandler handler, String exception, Object params) {
  
  if (handler instanceof ActionExceptionHandler) {
    ActionExceptionHandler exceptionHandler = (ActionExceptionHandler) handler;
    Action action = (Action) exceptionHandler.getAction().getMetaData("Action");
    try {
      ProcessInstance processInstance = getProcessInstance();
      ProcessContext processContext = new ProcessContext(processInstance.getKnowledgeRuntime());
      ContextInstanceContainer contextInstanceContainer = getContextInstanceContainer();
      if (contextInstanceContainer instanceof NodeInstance) {
        processContext.setNodeInstance((NodeInstance) contextInstanceContainer);
      } else {
        processContext.setProcessInstance(processInstance);
      }
      String faultVariable = exceptionHandler.getFaultVariable();
      if (faultVariable != null) {
        processContext.setVariable(faultVariable, params);
      }
      action.execute(processContext);
    } catch (Exception e) {
      throw new RuntimeException("unable to execute Action", e);
    }
  } else {
    throw new IllegalArgumentException("Unknown exception handler " + handler);
  }
}
origin: org.jbpm.contrib/java-workitem

WorkflowProcessInstance processInstance = (WorkflowProcessInstance)
localksession.getProcessInstance(workItem.getProcessInstanceId());
kcontext.setProcessInstance(processInstance);
WorkItemNodeInstance nodeInstance = findNodeInstance(workItem.getId(),
                           processInstance);
org.drools.core.spiProcessContextsetProcessInstance

Popular methods of ProcessContext

  • <init>
  • setNodeInstance
  • getCaseAssignment
  • getCaseData
  • setVariable

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JTable (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now