Package org.jbpm.process.core

Examples of org.jbpm.process.core.ContextContainer


  }

  public Object end(final String uri, final String localName,
      final ExtensibleXmlParser parser) throws SAXException {
    final Element element = parser.endElementBuilder();
    ContextContainer contextContainer = (ContextContainer) parser.getParent();

    final String type = element.getAttribute("type");
    emptyAttributeCheck(localName, "type", type, parser);

    final String faultName = element.getAttribute("faultName");
    emptyAttributeCheck(localName, "faultName", type, parser);
   
    final String faultVariable = element.getAttribute("faultVariable");
   
    ExceptionHandler exceptionHandler = null;
    if ("action".equals(type)) {
      exceptionHandler = new ActionExceptionHandler();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
          if (xmlNode instanceof Element) {
          Element actionXml = (Element) xmlNode;
          DroolsAction action = ActionNodeHandler.extractAction(actionXml);
          ((ActionExceptionHandler) exceptionHandler).setAction(action);
          }
    } else {
      throw new SAXParseException("Unknown exception handler type " + type, parser.getLocator());
    }
   
    if (faultVariable != null && faultVariable.length() > 0) {
      exceptionHandler.setFaultVariable(faultVariable);
    }
   
    ExceptionScope exceptionScope = (ExceptionScope)
      contextContainer.getDefaultContext(ExceptionScope.EXCEPTION_SCOPE);
    if (exceptionScope == null) {
      exceptionScope = new ExceptionScope();
          contextContainer.addContext(exceptionScope);
          contextContainer.setDefaultContext(exceptionScope);
    }
   
    exceptionScope.setExceptionHandler(faultName, exceptionHandler);

    return null;
View Full Code Here


                        final String localName,
                        final Attributes attrs,
                        final ExtensibleXmlParser parser) throws SAXException {
        parser.startElementBuilder( localName,
                                    attrs );
        ContextContainer contextContainer = (ContextContainer) parser.getParent();
        final String name = attrs.getValue("name");
        emptyAttributeCheck(localName, "name", name, parser);
       
        VariableScope variableScope = (VariableScope)
            contextContainer.getDefaultContext(VariableScope.VARIABLE_SCOPE);
        Variable variable = new Variable();
        if (variableScope != null) {
            variable.setName(name);
            List<Variable> variables = variableScope.getVariables();
            if (variables == null) {
View Full Code Here

    final String id = attrs.getValue("id");
    final String itemSubjectRef = attrs.getValue("itemSubjectRef");

    Object parent = parser.getParent();
    if (parent instanceof ContextContainer) {
        ContextContainer contextContainer = (ContextContainer) parent;
        VariableScope variableScope = (VariableScope)
                contextContainer.getDefaultContext(VariableScope.VARIABLE_SCOPE);
      List variables = variableScope.getVariables();
      Variable variable = new Variable();
      variable.setMetaData("DataObject", "true");
      variable.setName(id);
      // retrieve type from item definition
View Full Code Here

    final String id = attrs.getValue("id");
    final String itemSubjectRef = attrs.getValue("itemSubjectRef");

    Object parent = parser.getParent();
    if (parent instanceof ContextContainer) {
        ContextContainer contextContainer = (ContextContainer) parent;
        VariableScope variableScope = (VariableScope)
                contextContainer.getDefaultContext(VariableScope.VARIABLE_SCOPE);
      List variables = variableScope.getVariables();
      Variable variable = new Variable();
      variable.setName(id);
      // retrieve type from item definition
      DataType dataType = new ObjectDataType();
View Full Code Here

TOP

Related Classes of org.jbpm.process.core.ContextContainer

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.