Package org.ofbiz.workflow

Examples of org.ofbiz.workflow.WfProcess


    /**
     * @see org.ofbiz.workflow.WfRequester#receiveEvent(org.ofbiz.workflow.WfEventAudit)
     */
    public synchronized void receiveEvent(WfEventAudit event) throws WfException, InvalidPerformer {
        // Should the source of the audit come from the process? if so use this.
        WfProcess process = null;

        try {
            process = (WfProcess) event.source();
        } catch (SourceNotAvailable sna) {
            throw new InvalidPerformer("Could not get the performer", sna);
        } catch (ClassCastException cce) {
            throw new InvalidPerformer("Not a valid process object", cce);
        }
        if (process == null)
            throw new InvalidPerformer("No performer specified");
        if (!performers.containsKey(process))
            throw new InvalidPerformer("Performer not assigned to this requester");

        GenericRequester req = null;

        if (performers.containsKey(process))
            req = performers.get(process);
        if (req != null)
            req.receiveResult(process.result());
    }
View Full Code Here


     * Abort a process
     * @param workEffortId The workeffort entity key for the process to abort
     * @throws WfException
     */
    public void abortProcess(String workEffortId) throws WfException {
        WfProcess process = WfFactory.getWfProcess(delegator, workEffortId);
        process.abort();
    }
View Full Code Here

    /**
     * @see org.ofbiz.workflow.WfRequester#receiveEvent(org.ofbiz.workflow.WfEventAudit)
     */
    public synchronized void receiveEvent(WfEventAudit event) throws WfException, InvalidPerformer {
        // Should the source of the audit come from the process? if so use this.
        WfProcess process = null;

        try {
            process = (WfProcess) event.source();
        } catch (SourceNotAvailable sna) {
            throw new InvalidPerformer("Could not get the performer", sna);
        } catch (ClassCastException cce) {
            throw new InvalidPerformer("Not a valid process object", cce);
        }
        if (process == null)
            throw new InvalidPerformer("No performer specified");
        if (!performers.containsKey(process))
            throw new InvalidPerformer("Performer not assigned to this requester");

        GenericRequester req = null;

        if (performers.containsKey(process))
            req = (GenericRequester) performers.get(process);
        if (req != null)
            req.receiveResult(process.result());
    }
View Full Code Here

     * Abort a process
     * @param workEffortId The workeffort entity key for the process to abort
     * @throws WfException
     */
    public void abortProcess(String workEffortId) throws WfException {
        WfProcess process = WfFactory.getWfProcess(delegator, workEffortId);
        process.abort();
    }
View Full Code Here

        if (requester == null)
            throw new RequesterRequired();

        // test if the requestor is OK: how?
        WfProcess process = WfFactory.getWfProcess(processDef, this);

        try {
            process.setRequester(requester);
        } catch (CannotChangeRequester ccr) {
            throw new WfException(ccr.getMessage(), ccr);
        }
        processList.add(process);
        Debug.logVerbose("[WfProcessMgr.createProcess] : Process created.", module);
View Full Code Here

            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
            result.put(ModelService.ERROR_MESSAGE, "You do not have permission to access this workflow");
            return result;
        }
        try {
            WfProcess process = WfFactory.getWfProcess(delegator, workEffortId);
            process.abort();
        } catch (WfException we) {
            we.printStackTrace();
            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
            result.put(ModelService.ERROR_MESSAGE, we.getMessage());
        }
View Full Code Here

     * Abort a process
     * @param workEffortId The workeffort entity key for the process to abort
     * @throws WfException
     */
    public void abortProcess(String workEffortId) throws WfException {
        WfProcess process = WfFactory.getWfProcess(delegator, workEffortId);
        process.abort();
    }
View Full Code Here

        if (requester == null)
            throw new RequesterRequired();

        // test if the requestor is OK: how?
        WfProcess process = WfFactory.getWfProcess(processDef, this);

        try {
            process.setRequester(requester);
        } catch (CannotChangeRequester ccr) {
            throw new WfException(ccr.getMessage(), ccr);
        }
        processList.add(process);
        Debug.logVerbose("[WfProcessMgr.createProcess] : Process created.", module);
View Full Code Here

    /**
     * @see org.ofbiz.workflow.WfRequester#receiveEvent(org.ofbiz.workflow.WfEventAudit)
     */
    public synchronized void receiveEvent(WfEventAudit event) throws WfException, InvalidPerformer {
        // Should the source of the audit come from the process? if so use this.
        WfProcess process = null;

        try {
            process = (WfProcess) event.source();
        } catch (SourceNotAvailable sna) {
            throw new InvalidPerformer("Could not get the performer", sna);
        } catch (ClassCastException cce) {
            throw new InvalidPerformer("Not a valid process object", cce);
        }
        if (process == null)
            throw new InvalidPerformer("No performer specified");
        if (!performers.containsKey(process))
            throw new InvalidPerformer("Performer not assigned to this requester");

        GenericRequester req = null;

        if (performers.containsKey(process))
            req = (GenericRequester) performers.get(process);
        if (req != null)
            req.receiveResult(process.result());
    }
View Full Code Here

            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
            result.put(ModelService.ERROR_MESSAGE, "You do not have permission to access this workflow");
            return result;
        }
        try {
            WfProcess process = WfFactory.getWfProcess(delegator, workEffortId);
            process.abort();
        } catch (WfException we) {
            we.printStackTrace();
            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
            result.put(ModelService.ERROR_MESSAGE, we.getMessage());
        }
View Full Code Here

TOP

Related Classes of org.ofbiz.workflow.WfProcess

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.