Package de.danet.an.workflow.api

Examples of de.danet.an.workflow.api.DefaultProcessData


     */
    private ProcessData getProcessData(ProcessDefinition procdef,
            SOAPElement contextData) throws RemoteException, SOAPException,
            ParseException {
        ProcessDataInfo info = procdef.contextSignature();
        ProcessData procData = new DefaultProcessData();

        for (Iterator pdi = contextData.getChildElements(); pdi.hasNext();) {
            SOAPElement current = (SOAPElement) pdi.next();
            String pdname = current.getLocalName();
            Object type = info.get(pdname);
            if (type == null) {
                throw new SOAPException("process does not contain a variable "
                        + "with name " + pdname);
            }
            String pdvalue = XMLUtil.getFirstLevelTextContent(current);

            Object value;

            if (type.equals(String.class)) {
                value = pdvalue;
            } else if (type.equals(Long.class)) {
                value = new Long(pdvalue);
            } else if (type.equals(Double.class)) {
                value = new Double(XMLUtil.parseXsdDouble(pdvalue));
            } else if (type.equals(Boolean.class)) {
                value = new Boolean(XMLUtil.parseXsdBoolean(pdvalue));
            } else if (type.equals(Date.class)) {
                value = XMLUtil.parseXsdDateTime(pdvalue);
            } else if (type.equals(org.w3c.dom.Element.class)) {
                // TODO: Check other values for schema types.
                value = current.getFirstChild();
            } else {
                // cannot resolve the type. leave it as a string and pray.
                value = pdvalue;
            }

            procData.put(pdname, value);
        }

        return procData;
    }
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.api.DefaultProcessData

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.