Package de.danet.an.workflow.api

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


    private void appendObservers(SOAPMessage respMsg, Process proc,
            SOAPBodyElement propsNode) throws RemoteException, SOAPException {
        Collection observers;
        try {
            ObserverRegistry obs = getObserverRegistry();
            ProcessDefinition procdef = proc.processDefinition();
            observers = obs.getObservers(procdef.packageId(),
                    procdef.processId(), proc.key());
        } catch (SQLException e) {
            FaultUtils.setFault(respMsg, e);
            return;
        }
       
View Full Code Here


            SOAPBodyElement propsNode)
        throws RemoteException, SOAPException, ResultNotAvailableException {
        SOAPElement resultData
            = propsNode.addChildElement("ResultData", Consts.ASAP_PREFIX);
       
        ProcessDefinition procdef = proc.processDefinition();
        ProcessDataInfo resultSignature = procdef.resultSignature();

        resultData.addNamespaceDeclaration
            (Consts.RS_PREFIX, getResourceReference().getNamespace());
       
        ProcessData result;
View Full Code Here

            proc.setDescription(description);
        }
       
        SOAPElement data = findChildNode(action, "Data");
        if (data != null) {
            ProcessDefinition procdef = proc.processDefinition();
            ProcessData procData;
            try {
                procData = getProcessData(procdef, data);
                proc.setProcessContext(procData);
            } catch (ParseException e) {
View Full Code Here

            FaultUtils.setFault(respMsg, ASAPException.ASAP_ELEMENT_MISSING,
                    "Missing observer key!");
            return;
        }

        ProcessDefinition procdef = proc.processDefinition();
        try {
            ObserverRegistry obs = getObserverRegistry();
            obs.subscribe
                (observer, procdef.packageId(),
                 procdef.processId(), proc.key(),
                 getResourceReference().getBaseUrl());
        } catch (SQLException e) {
            FaultUtils.setFault(respMsg, e);
           
            return;
View Full Code Here

                    "Missing observer key!");
           
            return;
        }

        ProcessDefinition procdef = proc.processDefinition();
        try {
            ObserverRegistry obs = getObserverRegistry();
            obs.unsubscribe(observer, procdef.packageId(), procdef.processId(),
                    proc.key());
        } catch (SQLException e) {
            FaultUtils.setFault(respMsg, e);
           
            return;
View Full Code Here

        if (baseUrl == null || process == null) {
            throw new IllegalArgumentException();
        }
        this.baseUrl = baseUrl;
        this.resource = AbstractResponseGenerator.RESOURCE_INSTANCE;
        ProcessDefinition procDef = process.processDefinition();
        this.packageId = procDef.packageId();
        this.processId = procDef.processId();
        this.processKey = process.key();
    }
View Full Code Here

            throw new IllegalArgumentException();
        }
        this.baseUrl = baseUrl;
        this.resource = AbstractResponseGenerator.RESOURCE_ACTIVITY;
        Process process = (Process)activity.container();
        ProcessDefinition procDef = process.processDefinition();
        this.packageId = procDef.packageId();
        this.processId = procDef.processId();
        this.processKey = process.key();
        this.activityKey = activity.key();
    }
View Full Code Here

        ProcessDefinitionDirectory pdd
            = getWorkflowService().processDefinitionDirectory();
       
        Collection procdefs = pdd.processDefinitions();
        for (Iterator i = procdefs.iterator(); i.hasNext ();) {
            ProcessDefinition pd = (ProcessDefinition)i.next ();
            try {
                if (!pdd.isEnabled(pd.packageId(), pd.processId())) {
                    continue;
                }
            } catch (InvalidKeyException e) {
                continue;
            }
            SOAPElement defInfo = defsNode.addChildElement
                ("DefinitionInfo", Consts.WFXML_PREFIX);
            SOAPElement defKey
                = defInfo.addChildElement("DefinitionKey", Consts.WFXML_PREFIX);
            ResourceReference procDefRes = new ResourceReference
                (getResourceReference().getBaseUrl(), pd);
            defKey.addTextNode(procDefRes.getResourceKey());
            SOAPElement name = defInfo.addChildElement("Name",
                    Consts.WFXML_PREFIX);
            String val = pd.processName();
            maybeAddTextNode(name, val);
            SOAPElement descr = defInfo.addChildElement("Description",
                    Consts.WFXML_PREFIX);
            val = pd.processHeader().description();
            maybeAddTextNode(descr, val);
            SOAPElement version = defInfo.addChildElement("Version",
                    Consts.WFXML_PREFIX);
            val = pd.processHeader().version();
            maybeAddTextNode(version, val);
            SOAPElement status = defInfo.addChildElement("Status",
                    Consts.WFXML_PREFIX);
            val = pd.processHeader().publicationStatus();
            maybeAddTextNode(status, val);
        }
    }
View Full Code Here

      while (msg.hasNext()) {
    System.out.println(((PrioritizedMessage)msg.next()).unmappedMessage());
      }
  }
  // Test all attributes of process definition
  ProcessDefinition procdef = defDir.lookupProcessDefinition("SystemTest_full",
                     "full");
  boolean gotException = false;
  try {
      procdef.applicationById("Dummy");
  } catch (InvalidIdException exc) {
      gotException = true;
  }
  assertTrue(gotException);
  Application appl = procdef.applicationById("dummy");
  assertTrue(appl.description().equals("Dummy application for testing"
               + " purposes only."));
  assertTrue(appl.id().equals("dummy"));
  assertTrue(procdef.applications().size() == 1);
  assertTrue(((Application)procdef.applications().iterator().next())
       .id().equals("dummy"));
  gotException = false;
  try {
      procdef.participantById("CurrentUser");
  } catch (InvalidIdException exc) {
      gotException = true;
  }
  assertTrue(gotException)
  Participant part = procdef.participantById("currentUser");
  assertTrue(part.getId().equals("currentUser"));
  assertTrue(part.getName().equals("Aktueller Benutzer"));
  assertTrue(part.getParticipantType()
       .equals(Participant.ParticipantType.HUMAN));
  assertTrue(procdef.participants().size() == 1);
  assertTrue(((Participant)procdef.participants().iterator().next())
       .getId().equals("currentUser"));
  assertTrue(procdef.removeClosedProcess());
        assertTrue(procdef.cleanupMode() == ProcessDefinition.REMOVE_AUTOMATIC);
  assertTrue(procdef.packageId().equals("SystemTest_full"));
  assertTrue(procdef.processId().equals("full"));
  assertTrue(procdef.packageName().equals("System Test (procdef)"));
  assertTrue(procdef.processName().equals("PROCESS_COMPLETE_ATTRIBUTES"));
  assertTrue(procdef.mgrName().equals("SystemTest_full/full"));
  ProcessDefinition.ProcessHeaderData hdr = procdef.processHeader();
  assertTrue(hdr.created().equals("Tue Jan 14 14:58:01 CEST 2003"));
  assertTrue(hdr.description().equals("Description for test of all"
              + " accessible attributes"));
  assertTrue(hdr.priority().equals("5"));
  assertTrue(hdr.limit().equals("3 days"));
View Full Code Here

     * @return the parameter map
     */
    public Map parameterMap
  (ExtProcessLocal process, ActivityLocal act, ProcessDefinitionDirectoryLocal pdd) {
  try {
      ProcessDefinition pd
    = pdd.lookupProcessDefinition(packageId(), processId());
      FormalParameter[] fps = pd.formalParameters();
      return parameterMap (process, act, fps);
  } catch (InvalidKeyException e) {
      // cannot happen since procdef is initially verified
      logger.error (e.getMessage(), e);
      throw new IllegalStateException (e.getMessage());
View Full Code Here

TOP

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

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.