Package jbprocess.bpel.xpath

Examples of jbprocess.bpel.xpath.XpathOperatorMapping


   
    scan(operator.getRightHandOperand());
    ASTNodeData rightOperandNodeData = nodeDataStack.peek();
   
    XpathBinaryOpExpression xpathBinOperation = xpathFactory.createBinaryOperation();
    XpathOperatorMapping xpathBinOpMap = xpathFactory.createBinOpMapping();
    XpathExprBinOpType xpathBinOp = xpathBinOpMap.getBinOp(operator.getKind());
   
    if (xpathBinOp != null){
      try {
        xpathBinOperation.setOperator(xpathBinOp);
        if (leftOperandNodeData.xpathExpr != null && rightOperandNodeData.xpathExpr != null){       
View Full Code Here


   
    //scan(invocation.getArguments());
   
    if (execNodeData.isEqualsExecRef && invocation.getArguments().size() == 1){     
      XpathBinaryOpExpression xpathBinOperation = xpathFactory.createBinaryOperation();
      XpathOperatorMapping xpathBinOpMap = xpathFactory.createBinOpMapping();
      XpathExprBinOpType xpathBinOp = xpathBinOpMap.getBinOp(BinaryOperatorKind.EQ);
      scan(invocation.getArguments().get(0));
      ASTNodeData arg = nodeDataStack.peek();
      try {
        if (targetNodeData.xpathExpr != null && arg.xpathExpr != null){
          xpathBinOperation.setOperator(xpathBinOp);
View Full Code Here

   
    scan(operator.getOperand());
    ASTNodeData operandNodeData = nodeDataStack.peek();
   
    BinaryOperatorKind binOp;
    XpathOperatorMapping xpathBinOpMap = xpathFactory.createBinOpMapping();
    XpathNumberExpression xpathNumberOne = xpathFactory.createNumber();
    xpathNumberOne.setNumber(1);
    XpathBinaryOpExpression xpathBinOperation = xpathFactory.createBinaryOperation();
    //XpathTypeMapping xpathTypeMap = xpathFactory.createTypeMapping();
    //XpathExprType varXpathType = xpathTypeMap.getXpathExprType(operator.getType().getQualifiedName());
   
    switch(operator.getKind()){
    case NEG: break;
    case NOT:
      if (operandNodeData.xpathExpr != null){
        XpathNotExpression xpathNotExpr = xpathFactory.createNotExpression();
        xpathNotExpr.setExpr(operandNodeData.xpathExpr);
        unaryOperatorContext.xpathExpr = xpathNotExpr;
        unaryOperatorContext.variable = operandNodeData.variable;
      }
      break;
     
    case POS: break;   
   
    case POSTDEC:
    case POSTINC:
      if (operator.getKind().equals(UnaryOperatorKind.PREDEC))
        binOp = BinaryOperatorKind.MINUS;
      else
        binOp = BinaryOperatorKind.PLUS;
      if (operandNodeData.variable != null && operandNodeData.xpathExpr != null){
      // create temp variable
        Variable tmpVar = createTempVariable(unaryOperatorContext.scopeStack,typeNodeData.xsdType);
       
      // assign real variable value to temp variable
        From from = BPELFactory.eINSTANCE.createFrom();
        from.setVariable(operandNodeData.variable);
        Query fromQuery = BPELFactory.eINSTANCE.createQuery();
        fromQuery.setQueryLanguage(XPATH_NAMESPACE);
        fromQuery.setValue(operandNodeData.xpathExpr.evaluate());
        from.setQuery(fromQuery);
       
        To to = BPELFactory.eINSTANCE.createTo();
        to.setVariable(tmpVar);
       
        Copy copy = BPELFactory.eINSTANCE.createCopy();
        copy.setTo(to);
        copy.setFrom(from);
        Assign assign = BPELFactory.eINSTANCE.createAssign();
        assign.getCopy().add(copy);
       
      // add assignment activty to curr scope
        operandNodeData.scopeStack.peek().addActivity(assign);
     
      // increment real variable
        try {
          xpathBinOperation.setLeftSide(operandNodeData.xpathExpr);
          xpathBinOperation.setOperator(xpathBinOpMap.getBinOp(binOp));
          xpathBinOperation.setRightSide(xpathNumberOne);
         
          from = BPELFactory.eINSTANCE.createFrom();
          from.setVariable(operandNodeData.variable);
          fromQuery = BPELFactory.eINSTANCE.createQuery();
          fromQuery.setQueryLanguage(XPATH_NAMESPACE);
          fromQuery.setValue(xpathBinOperation.evaluate());
          from.setQuery(fromQuery);
         
          to = BPELFactory.eINSTANCE.createTo();
          to.setVariable(operandNodeData.variable);
         
          copy = BPELFactory.eINSTANCE.createCopy();
          copy.setTo(to);
          copy.setFrom(from);
          assign = BPELFactory.eINSTANCE.createAssign();
          assign.getCopy().add(copy);
     
      // add increment activity to curr scope
          operandNodeData.scopeStack.peek().addActivity(assign);
     
      // set variable reference = temp variable
          operandNodeData.variable = tmpVar;
          XpathVariableRefExpression xpathVarRef = xpathFactory.createVariableReference();
          xpathVarRef.setVariableName(tmpVar.getName());
          xpathVarRef.setType(typeNodeData.xsdTypeQName);
          operandNodeData.xpathExpr = xpathVarRef;
         
        } catch (Exception e) {}
     
      }
      break;
     
    case PREDEC:
    case PREINC:
      if (operator.getKind().equals(UnaryOperatorKind.PREDEC))
        binOp = BinaryOperatorKind.MINUS;
      else
        binOp = BinaryOperatorKind.PLUS;
      if (operandNodeData.variable != null && operandNodeData.xpathExpr != null){
      // increment variable
        try {
          xpathBinOperation.setLeftSide(operandNodeData.xpathExpr);
          xpathBinOperation.setOperator(xpathBinOpMap.getBinOp(binOp));
          xpathBinOperation.setRightSide(xpathNumberOne);
         
          From from = BPELFactory.eINSTANCE.createFrom();
          from.setVariable(operandNodeData.variable);
          Query fromQuery = BPELFactory.eINSTANCE.createQuery();
View Full Code Here

TOP

Related Classes of jbprocess.bpel.xpath.XpathOperatorMapping

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.