Package de.danet.an.workflow.api

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


      if (logger.isDebugEnabled()) {
    logger.debug ("Timer application " + applId
            + " has already expired, completing");
      }
  }
  ProcessData res = new DefaultProcessData ();
  res.put (fps[1].id(), "EXPIRED");
  try {
      activity.setResult (res);
      activity.complete ();
  } catch (CannotCompleteException e) {
      logger.error
View Full Code Here


      act = toolAgentContext().lookupActivity(auk);
  } catch (InvalidKeyException e) {
      logger.warn (auk + " is unknown, cannot cancel wait tool.");
      return;
  }
  ProcessData res = new DefaultProcessData ();
  String resParam = (String)((Object[])info.state())[1];
  res.put (resParam, "CANCELED");
  try {
      act.setResult (res);
      act.complete ();
      if (logger.isDebugEnabled ()) {
    logger.debug ("Timer application " + applId + " canceled, "
View Full Code Here

    /**
     * Save modified data.
     */
    public void saveData () throws RemoteException {
        ProcessData pd = new DefaultProcessData();
        for (Iterator i = dataFields.iterator(); i.hasNext();) {
            DataFieldWrapper df = (DataFieldWrapper)i.next();
            if (df.isModified()) {
                if (df.isString() || df.isLong() || df.isDouble()
                    || df.isBoolean() || df.isDate() || df.isXml()) {
                    pd.put(df.getName(), df.getValue());
                }
            }
        }
        try {
            process().setProcessContext(pd);
View Full Code Here

  msg.setContent(mimeMulti);
  msg.saveChanges();
  // send the message
  Transport.send(msg);
  // build return value
  ProcessData resData = new DefaultProcessData();
  if (status != null) {
      resData.put (status, "OK");
  }
  return resData;
    }
View Full Code Here

            if (logger.isDebugEnabled ()) {
                logger.debug ("Setting result for " + auk);
            }
            try {
                if (resParam != null) {
                    ProcessData res = new DefaultProcessData ();
                    res.put (resParam, "EXPIRED");
                    act.setResult (res);
                }
                act.complete ();
                if (logger.isDebugEnabled ()) {
                    logger.debug ("Result set for " + auk + " and completed");
View Full Code Here

   
    /**
     * Return the result map.
     */
    public ProcessData resultData () {
        ProcessData res = new DefaultProcessData ();
        for (Node child = instance.getFirstChild(); child != null;
             child = child.getNextSibling()) {
            if (!(child instanceof Element)
                || !((Element)child).getNodeName().equals("ActualParameter")) {
                continue;
            }
            Element param = (Element)child;
            String name = param.getAttribute("name");
            FormalParameter fp = null;
            for (int i = 0; i < formalParameters.length; i++) {
                if (formalParameters[i].id().equals(name)) {
                    fp = formalParameters[i];
                    break;
                }
            }
            if (fp == null || fp.mode().equals(FormalParameter.Mode.IN)) {
                continue;
            }
            if (XPDLUtil.isXMLType(fp.type())) {
                SAXEventBufferImpl saxVal = new SAXEventBufferImpl();
                try {
                    Transformer t
                        = SAXTransformerFactory.newInstance().newTransformer();
                    t.transform(new DOMSource(param),
                                new SAXResult(new ChildrenOnlyFiler(saxVal)));
                } catch (TransformerConfigurationException e) {
                    logger.error(e.getMessage(), e);
                } catch (TransformerFactoryConfigurationError e) {
                    logger.error(e.getMessage(), e);
                } catch (TransformerException e) {
                    logger.error(e.getMessage(), e);
                }
                res.put(fp.id(), saxVal);
            } else {
                StringBuffer content = new StringBuffer();
                for (Node pChild = param.getFirstChild(); pChild != null;
                     pChild = pChild.getNextSibling()) {
                    if (pChild.getNodeType() == Node.TEXT_NODE
                        || pChild.getNodeType() == Node.CDATA_SECTION_NODE) {
                        content.append(pChild.getNodeValue());
                    }
                }
                if (fp.type().equals(String.class)) {
                    res.put(fp.id(), content.toString());
                } else if (fp.type().equals(Boolean.class)) {
                    res.put(fp.id(), (new Boolean(content.toString())));
                } else if (fp.type().equals(Long.class)) {
                    res.put(fp.id(), Long.valueOf(content.toString()));
                } else if (fp.type().equals(Double.class)) {
                    res.put(fp.id(), Double.valueOf(content.toString()));
                } else if (fp.type().equals(Date.class)) {
                    // Convert date to datetime
                    if (content.indexOf("T") < 0) {
                        content.append("T00:00:00");
                    }
                    try {
                        res.put (fp.id(),
                                 XMLUtil.parseXsdDateTime(content.toString()));
                    } catch (ParseException e) {
                        logger.error ("Cannot parse XSD datetime: "
                                      + content.toString());
                    }
View Full Code Here

        if (resVal instanceof ExceptionResult) {
      ((ExtActivity)act).abandon((ExceptionResult)resVal);
        } else {
            if (act instanceof ActivityProxy) {
                Activity aun = ((ActivityProxy)act).unwrap();
                aun.setResult(new DefaultProcessData ((Map)resVal));
                aun.complete ();
            }
        }
    }
      }
View Full Code Here

            procDefDir = workflowService.processDefinitionDirectory();
            procDir = workflowService.processDirectory();
            ProcessMgr pmgr = procDefDir.processMgr ("jstests", "testJavaArg2");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            ProcessData data = new DefaultProcessData ();
            List l = new ArrayList();
            data.put("Argument", l);
            l.add ("Text:");
            process.setProcessContext(data);
            process.start();
            assertTrue (stateReached (process, "closed.completed"));
            l = (List)process.processContext().get("Result");
View Full Code Here

   
  // specialized attributes
  if (oldData == null || (oldData instanceof DefaultProcessData)) {
      this.oldData = oldData;
  } else {
      this.oldData = new DefaultProcessData (oldData);
  }
  if (newData == null || (newData instanceof DefaultProcessData)) {
      this.newData = newData;
  } else {
      this.newData = new DefaultProcessData (newData);
  }
    }
View Full Code Here

        resId = formPars[i].id();
        continue;
    }
      }

      ProcessData data = new DefaultProcessData();
      Vector w  = (Vector)
    (XmlRpcCall.rpc
     (serverUrl, "scm.getDependencyCopiedFrom", new Object[]
         { issueId,dependTypeName
         } ));
      if (w.size() > 0) {
    for(int i = 0; i<w.size();i++){
        data.put(resId,w.elementAt(i));
    }
      } else {
    data.put(resId, null)
      }
      result.set (data);
  } finally {
      if (logger.isDebugEnabled()) {
    logger.debug ("Finished invocation of " + activity.uniqueKey());
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.