Package org.apache.ode.bpel.pmapi

Examples of org.apache.ode.bpel.pmapi.InvalidRequestException


        final TVariableRef sref = vinf.addNewSelf();
        dbexec(new BpelDatabase.Callable<Object>() {
            public Object run(BpelDAOConnection session) throws Exception {
                ScopeDAO scope = session.getScope(new Long(scopeId));
                if (scope == null) {
                    throw new InvalidRequestException("ScopeNotFound:" + scopeId);
                }

                sref.setSiid(scopeId);
                sref.setIid(scope.getProcessInstance().getInstanceId().toString());
                sref.setName(varName);

                XmlDataDAO var = scope.getVariable(varName);
                if (var == null) {
                    throw new InvalidRequestException("VarNotFound:" + varName);
                }

                Node nval = var.get();
                if (nval != null) {
                    TVariableInfo.Value val = vinf.addNewValue();
View Full Code Here


    }

    private ProcessInfoDocument genProcessInfoDocument(final QName procid, final ProcessInfoCustomizer custom)
            throws ManagementException {
        if (procid == null) {
            throw new InvalidRequestException("Valid QName as process id expected.");
        }
        ProcessInfoDocument ret = ProcessInfoDocument.Factory.newInstance();
        final TProcessInfo pi = ret.addNewProcessInfo();
        try {
            ProcessConf pconf = _store.getProcessConfiguration(procid);
View Full Code Here

     *            instance identifier
     * @return generated document
     */
    private InstanceInfoDocument genInstanceInfoDocument(final Long iid) {
        if (iid == null)
            throw new InvalidRequestException("Must specifiy instance id.");

        InstanceInfoDocument ret = InstanceInfoDocument.Factory.newInstance();
        final TInstanceInfo ii = ret.addNewInstanceInfo();

        ii.setIid(iid.toString());
View Full Code Here

     * @param includeActivityInfo
     * @return generated document
     */
    private ScopeInfoDocument genScopeInfoDocument(final String siid, final boolean includeActivityInfo) {
        if (siid == null)
            throw new InvalidRequestException("Must specifiy scope instance id.");

        final Long siidl;
        try {
            siidl = new Long(siid);
        } catch (NumberFormatException nfe) {
            throw new InvalidRequestException("Invalid scope instance id.");
        }

        ScopeInfoDocument ret = ScopeInfoDocument.Factory.newInstance();
        final TScopeInfo ii = ret.addNewScopeInfo();

        ii.setSiid(siid);
        dbexec(new BpelDatabase.Callable<Object>() {
            public Object run(BpelDAOConnection conn) throws Exception {
                try {
                ScopeDAO instance = conn.getScope(siidl);
                if (instance == null)
                    throw new InvalidRequestException("Scope not found: " + siidl);
                // TODO: deal with "ERROR" state information.
                fillScopeInfo(ii, instance, includeActivityInfo);
                } catch (Exception e) {
                    e.printStackTrace();
                }
View Full Code Here

    // Some additional validation on status value
    if (statusFilter != null) {
      try {
        StatusKeys.valueOf(statusFilter.toUpperCase());
      } catch (IllegalArgumentException e) {
        throw new InvalidRequestException(
            "The status you're using in your filter isn't valid, "
                + "only the activated and retired status are valid. "
                + e.toString());
      }
    }

    // Some additional validation on date format value
    if (deployedDateFilter != null) {
      for (String ddf : deployedDateFilter) {
        try {
          ISO8601DateParser.parse(getDateWithoutOp(ddf));
        } catch (ParseException e) {
          throw new InvalidRequestException(
              "Couldn't parse one of the filter date, please make "
                  + "sure it follows the ISO-8601 date or date/time standard (yyyyMMddhhmmss). "
                  + e.toString());
        }
      }
    }

    if (orderKeys != null && orderKeys.length() > 0) {
      orders = new ArrayList<String>(3);
      for (StringTokenizer orderKeysTok = new StringTokenizer(orderKeys, " "); orderKeysTok
          .hasMoreTokens();) {
        String orderKey = orderKeysTok.nextToken();
        try {
          String justKey = orderKey;
          if (justKey.startsWith("-") || justKey.startsWith("+"))
            justKey = orderKey.substring(1, justKey.length());
          OrderKeys.valueOf(justKey.toUpperCase());
          orders.add(orderKey);
        } catch (IllegalArgumentException e) {
          throw new InvalidRequestException(
              "One of the ordering keys isn't valid, processes can only "
                  + "be sorted by name, namespace, version, status and deployed date."
                  + e.toString());
        }
      }
View Full Code Here

        if (statusFilter != null) {
            for (String status : statusFilter) {
                try {
                    StatusKeys.valueOf(status.toUpperCase());
                } catch (IllegalArgumentException e) {
                    throw new InvalidRequestException(
                            "The status you're using in your filter isn't valid, "
                                    + "only the active, suspended, error, completed, terminated and faulted status are "
                                    + "valid. " + e.toString());
                }
            }
        }
        // Some additional validation on date format value
        if (startedDateFilter != null) {
            for (String ddf : startedDateFilter) {
                try {
                    ISO8601DateParser.parse(getDateWithoutOp(ddf));
                } catch (ParseException e) {
                    throw new InvalidRequestException(
                            "Couldn't parse one of the filter date, please make "
                                    + "sure it follows the ISO-8601 date or date/time standard (yyyyMMddhhmmss). "
                                    + e.toString());
                }
            }
        }
        if (lastActiveDateFilter != null) {
            for (String ddf : lastActiveDateFilter) {
                try {
                    ISO8601DateParser.parse(getDateWithoutOp(ddf));
                } catch (ParseException e) {
                    throw new InvalidRequestException(
                            "Couldn't parse one of the filter date, please make "
                                    + "sure it follows the ISO-8601 date or date/time standard (yyyyMMddhhmmss). "
                                    + e.toString());
                }
            }
        }

        if (orderKeys != null && orderKeys.length() > 0) {
            orders = new ArrayList<String>(3);
            for (StringTokenizer orderKeysTok = new StringTokenizer(orderKeys, " "); orderKeysTok
                    .hasMoreTokens();) {
                String orderKey = orderKeysTok.nextToken();
                try {
                    String justKey = orderKey;
                    if (justKey.startsWith("-") || justKey.startsWith("+"))
                        justKey = orderKey.substring(1, justKey.length());
                    OrderKeys.valueOf(justKey.replaceAll("-", "_").toUpperCase());
                    orders.add(orderKey);
                } catch (IllegalArgumentException e) {
                    throw new InvalidRequestException(
                            "One of the ordering keys isn't valid, processes can only "
                                    + "be sorted by pid, name, namespace, version, status, started and last-active "
                                    + "date." + e.toString());

                }
View Full Code Here

        if (statusFilter != null) {
            for (String status : statusFilter) {
                try {
                    StatusKeys.valueOf(status.toUpperCase());
                } catch (IllegalArgumentException e) {
                    throw new InvalidRequestException(
                            "The status you're using in your filter isn't valid, "
                                    + "only the active, suspended, error, completed, terminated and faulted status are "
                                    + "valid. " + e.toString());
                }
            }
        }
        // Some additional validation on date format value
        if (startedDateFilter != null) {
            for (String ddf : startedDateFilter) {
                try {
                    ISO8601DateParser.parse(getDateWithoutOp(ddf));
                } catch (ParseException e) {
                    throw new InvalidRequestException(
                            "Couldn't parse one of the filter date, please make "
                                    + "sure it follows the ISO-8601 date or date/time standard (yyyyMMddhhmmss). "
                                    + e.toString());
                }
            }
        }
        if (lastActiveDateFilter != null) {
            for (String ddf : lastActiveDateFilter) {
                try {
                    ISO8601DateParser.parse(getDateWithoutOp(ddf));
                } catch (ParseException e) {
                    throw new InvalidRequestException(
                            "Couldn't parse one of the filter date, please make "
                                    + "sure it follows the ISO-8601 date or date/time standard (yyyyMMddhhmmss). "
                                    + e.toString());
                }
            }
        }

        if (orderKeys != null && orderKeys.length() > 0) {
            orders = new ArrayList<String>(3);
            for (StringTokenizer orderKeysTok = new StringTokenizer(orderKeys, " "); orderKeysTok
                    .hasMoreTokens();) {
                String orderKey = orderKeysTok.nextToken();
                try {
                    String justKey = orderKey;
                    if (justKey.startsWith("-") || justKey.startsWith("+"))
                        justKey = orderKey.substring(1, justKey.length());
                    OrderKeys.valueOf(justKey.replaceAll("-", "_").toUpperCase());
                    orders.add(orderKey);
                } catch (IllegalArgumentException e) {
                    throw new InvalidRequestException(
                            "One of the ordering keys isn't valid, processes can only "
                                    + "be sorted by pid, name, namespace, version, status, started and last-active "
                                    + "date." + e.toString());

                }
View Full Code Here

        final TVariableRef sref = vinf.addNewSelf();
        dbexec(new BpelDatabase.Callable<Object>() {
            public Object run(BpelDAOConnection session) throws Exception {
                ScopeDAO scope = session.getScope(new Long(scopeId));
                if (scope == null) {
                    throw new InvalidRequestException("ScopeNotFound:" + scopeId);
                }

                sref.setSiid(scopeId);
                sref.setIid(scope.getProcessInstance().getInstanceId().toString());
                sref.setName(varName);

                XmlDataDAO var = scope.getVariable(varName);
                if (var == null) {
                    throw new InvalidRequestException("VarNotFound:" + varName);
                }

                Node nval = var.get();
                if (nval != null) {
                    TVariableInfo.Value val = vinf.addNewValue();
View Full Code Here

        final TVariableRef sref = vinf.addNewSelf();
        dbexec(new BpelDatabase.Callable<Object>() {
            public Object run(BpelDAOConnection session) throws Exception {
                ScopeDAO scope = session.getScope(new Long(scopeId));
                if (scope == null) {
                    throw new InvalidRequestException("ScopeNotFound:" + scopeId);
                }

                sref.setSiid(scopeId);
                sref.setIid(scope.getProcessInstance().getInstanceId().toString());
                sref.setName(varName);

                XmlDataDAO var = scope.getVariable(varName);
                if (var == null) {
                    throw new InvalidRequestException("VarNotFound:" + varName);
                }
               
                {
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    value.save(out, new XmlOptions().setSaveOuter());
View Full Code Here

    }

    private ProcessInfoDocument genProcessInfoDocument(BpelDAOConnection conn, QName procid, ProcessInfoCustomizer custom)
            throws ManagementException {
        if (procid == null) {
            throw new InvalidRequestException("Valid QName as process id expected.");
        }
        ProcessInfoDocument ret = ProcessInfoDocument.Factory.newInstance();
        TProcessInfo pi = ret.addNewProcessInfo();
        try {
            ProcessConf pconf = _store.getProcessConfiguration(procid);
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.pmapi.InvalidRequestException

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.