Package org.drools.spi

Examples of org.drools.spi.ProcessContext


   
    if (handler instanceof ActionExceptionHandler) {
      Action action = (Action) ((ActionExceptionHandler) handler).getAction().getMetaData("Action");
      try {
          KnowledgeHelper knowledgeHelper = createKnowledgeHelper();
          ProcessContext context = new ProcessContext();
          ProcessInstance processInstance = getProcessInstance();
          ContextInstanceContainer contextInstanceContainer = getContextInstanceContainer();
          if (contextInstanceContainer instanceof NodeInstance) {
            context.setNodeInstance((NodeInstance) contextInstanceContainer);
          } else {
            context.setProcessInstance(processInstance);
          }
          String faultVariable = handler.getFaultVariable();
          if (faultVariable != null) {
            context.setVariable(faultVariable, params);
          }
            action.execute(knowledgeHelper, ((ProcessInstance) processInstance).getWorkingMemory(), context);
      } catch (Exception e) {
          throw new RuntimeException("unable to execute Action", e);
      }
View Full Code Here


    public boolean evaluate(SplitInstance instance,
                            Connection connection,
                            Constraint constraint) {
        Object value;
        try {
            ProcessContext context = new ProcessContext();
            context.setNodeInstance( instance );
            value = this.evaluator.evaluate( ((ProcessInstance) instance.getProcessInstance()).getWorkingMemory(),
                                             context );
        } catch ( Exception e ) {
            throw new RuntimeException( "unable to execute ReturnValueEvaluator",
                                        e );
View Full Code Here

    return knowledgeHelper;
  }
 
  protected void executeAction(DroolsAction droolsAction, KnowledgeHelper knowledgeHelper) {
    Action action = (Action) droolsAction.getMetaData("Action");
    ProcessContext context = new ProcessContext();
    context.setNodeInstance(this);
    try {
      action.execute(knowledgeHelper, ((ProcessInstance) getProcessInstance()).getWorkingMemory(), context);
    } catch (Exception exception) {
      String exceptionName = exception.getClass().getName();
      ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance)
View Full Code Here

                "An ActionNode only accepts default incoming connections!");
        }
    Action action = (Action) getActionNode().getAction().getMetaData("Action");
    try {
        KnowledgeHelper knowledgeHelper = createKnowledgeHelper();
        ProcessContext context = new ProcessContext();
        context.setNodeInstance(this);
          action.execute(knowledgeHelper, ((ProcessInstance) getProcessInstance()).getWorkingMemory(), context);       
    } catch (Exception e) {
        throw new RuntimeException("unable to execute Action", e);
    }
      triggerCompleted();
View Full Code Here

    public boolean evaluate(SplitInstance instance,
                            Connection connection,
                            Constraint constraint) {
        Object value;
        try {
            ProcessContext context = new ProcessContext();
            context.setNodeInstance( instance );
            value = this.evaluator.evaluate( ((ProcessInstance) instance.getProcessInstance()).getWorkingMemory(),
                                             context );
        } catch ( Exception e ) {
            throw new RuntimeException( "unable to execute ReturnValueEvaluator",
                                        e );
View Full Code Here

    return knowledgeHelper;
  }
 
  protected void executeAction(DroolsAction droolsAction, KnowledgeHelper knowledgeHelper) {
    Action action = (Action) droolsAction.getMetaData("Action");
    ProcessContext context = new ProcessContext();
    context.setNodeInstance(this);
    try {
      action.execute(knowledgeHelper, ((ProcessInstance) getProcessInstance()).getWorkingMemory(), context);
    } catch (Exception exception) {
      exception.printStackTrace();
      String exceptionName = exception.getClass().getName();
View Full Code Here

   
    if (handler instanceof ActionExceptionHandler) {
      Action action = (Action) ((ActionExceptionHandler) handler).getAction().getMetaData("Action");
      try {
          KnowledgeHelper knowledgeHelper = createKnowledgeHelper();
          ProcessContext context = new ProcessContext();
          ProcessInstance processInstance = getProcessInstance();
          ContextInstanceContainer contextInstanceContainer = getContextInstanceContainer();
          if (contextInstanceContainer instanceof NodeInstance) {
            context.setNodeInstance((NodeInstance) contextInstanceContainer);
          } else {
            context.setProcessInstance(processInstance);
          }
          String faultVariable = handler.getFaultVariable();
          if (faultVariable != null) {
            context.setVariable(faultVariable, params);
          }
            action.execute(knowledgeHelper, ((ProcessInstance) processInstance).getWorkingMemory(), context);
      } catch (Exception e) {
          throw new RuntimeException("unable to execute Action", e);
      }
View Full Code Here

    return knowledgeHelper;
  }
 
  protected void executeAction(DroolsAction droolsAction, KnowledgeHelper knowledgeHelper) {
    Action action = (Action) droolsAction.getMetaData("Action");
    ProcessContext context = new ProcessContext();
    context.setNodeInstance(this);
    try {
      action.execute(knowledgeHelper, ((ProcessInstance) getProcessInstance()).getWorkingMemory(), context);
    } catch (Exception exception) {
      exception.printStackTrace();
      String exceptionName = exception.getClass().getName();
View Full Code Here

    public boolean evaluate(SplitInstance instance,
                            Connection connection,
                            Constraint constraint) {
        Object value;
        try {
            ProcessContext context = new ProcessContext();
            context.setNodeInstance( instance );
            value = this.evaluator.evaluate( ((ProcessInstance) instance.getProcessInstance()).getWorkingMemory(),
                                             context );
        } catch ( Exception e ) {
            throw new RuntimeException( "unable to execute ReturnValueEvaluator",
                                        e );
View Full Code Here

TOP

Related Classes of org.drools.spi.ProcessContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.