Package de.danet.an.workflow.api

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


        SOAPBodyElement instancesNode = createAsapResponseNode(respMsg,
                Consts.LIST_INSTANCES_RESPONSE);

        Collection procs = procMgr.processes();
        for (Iterator i = procs.iterator(); i.hasNext();) {
            Process proc = (Process) i.next();
            SOAPElement instance = instancesNode.addChildElement("Instance",
                    Consts.ASAP_PREFIX);
            SOAPElement instanceKey = instance.addChildElement("InstanceKey",
                    Consts.ASAP_PREFIX);
            ResourceReference procResRef = new ResourceReference(
                    getResourceReference().getBaseUrl(), proc);
            instanceKey.addTextNode(procResRef.getResourceKey());
            SOAPElement name = instance.addChildElement("Name",
                    Consts.ASAP_PREFIX);
            String val = proc.name();
            maybeAddTextNode(name, val);
            SOAPElement subject = instance.addChildElement("Subject",
                    Consts.ASAP_PREFIX);
            val = proc.description();
            maybeAddTextNode(subject, val);
            SOAPElement priority = instance.addChildElement("Priority",
                    Consts.ASAP_PREFIX);
            val = Integer.toString(proc.priority());
            priority.addTextNode(val);
        }
    }
View Full Code Here


        if (logger.isDebugEnabled()) {
            logger.debug("creating new process instance (" + name + ", "
                    + subject + ", " + startImmediately + ")");
        }
        Process proc;
        try {
            proc = (Process) procMgr.createProcess(new DefaultRequester(
                    getWorkflowService()));
            if (name != null) {
                proc.setName(name);
            }
            if (subject != null) {
                proc.setDescription(subject);
            }

            if (contextData != null) {
                ProcessDefinition procdef = proc.processDefinition();
                ProcessData procData = getProcessData(procdef, contextData);
                proc.setProcessContext(procData);
            }

            if (startImmediately) {
                proc.start();
                // proc.setDebugEnabled(debug);
            }
        } catch (NotEnabledException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_OPERATION_FAILED, e
                    .getMessage());
            return;
        } catch (InvalidRequesterException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_OPERATION_FAILED, e
                    .getMessage());
            return;
        } catch (RequesterRequiredException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_OPERATION_FAILED, e
                    .getMessage());
            return;
        } catch (CannotStartException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_OPERATION_FAILED, e
                    .getMessage());
            return;
        } catch (AlreadyRunningException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_OPERATION_FAILED, e
                    .getMessage());
            return;
        } catch (InvalidDataException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_OPERATION_FAILED, e
                    .getMessage());
            return;
        } catch (UpdateNotAllowedException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_OPERATION_FAILED, e
                    .getMessage());
            return;
        } catch (ParseException e) {
            FaultUtils.setFault(respMsg, ASAPException.ASAP_PARSING_ERROR, e
                    .getMessage());
            return;
        }

        String observer = getChildsTextContent(action, "ObserverKey");
        if (observer != null) {
            try {
                ProcessDefinition procdef = proc.processDefinition();
                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

TOP

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

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.