Package org.ofbiz.workflow

Examples of org.ofbiz.workflow.WfAssignment


     * @param start True to attempt to start the activity.
     * @return GenericResultWaiter of the start job.
     * @throws WfException
     */
    public void delegateAndAccept(String workEffortId, String fromPartyId, String fromRoleTypeId, Timestamp fromFromDate, String toPartyId, String toRoleTypeId, Timestamp toFromDate, boolean start) throws WfException {                                
        WfAssignment assign = delegate(workEffortId, fromPartyId, fromRoleTypeId, fromFromDate, toPartyId, toRoleTypeId, toFromDate);                     
        assign.accept();
        Debug.logVerbose("Delegated assignment.", module);
       
        if (start) {
            Debug.logVerbose("Starting activity.", module);
            if (!activityRunning(assign.activity())) {
                start(assign.activity().runtimeKey());
            } else {           
                Debug.logWarning("Activity already running; not starting.", module);
            }
        } else {
            Debug.logVerbose("Not starting assignment.", module);
View Full Code Here


     * @param fromDate The assignment's from date.
     * @return GenericResultWaiter for the complete job.
     * @throws WfException
     */
    public void complete(String workEffortId, String partyId, String roleTypeId, Timestamp fromDate, Map result) throws WfException {                   
        WfAssignment assign = WfFactory.getWfAssignment(delegator, workEffortId, partyId, roleTypeId, fromDate);
        if (result != null && result.size() > 0)
            assign.setResult(result);
        assign.complete();       
    }
View Full Code Here

            if (!activity.state().equals("open.not_running.not_started")) {
                // activity already running all assignments must be delegated in order to accept
                Iterator ai = activity.getIteratorAssignment();

                while (ai.hasNext() && allDelegated) {
                    WfAssignment a = (WfAssignment) ai.next();
                    if (!a.equals(this) && !a.status().equals("CAL_DELEGATED")) {
                        allDelegated = false;
                    }
                }
                // we cannot accept if the activity is running, with active assignments
                if (!allDelegated) {
                    throw new WfException("Cannot accept; Activity already running with active assignments");
                }
            } else {
                // activity not running, auto change all assignments to delegated status
                Debug.logVerbose("[WfAssignment.accept] : setting other assignments to delegated status.", module);
                Iterator ai = activity.getIteratorAssignment();

                while (ai.hasNext()) {
                    WfAssignment a = (WfAssignment) ai.next();
                    if (!this.isEqual(a)) a.delegate();                   
                }
            }
        }
        // set this assignment as accepted
        changeStatus("CAL_ACCEPTED");
View Full Code Here

TOP

Related Classes of org.ofbiz.workflow.WfAssignment

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.