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

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • BoxLayout (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • 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