Examples of YWorkItem


Examples of au.edu.qut.yawl.engine.YWorkItem

            _userList.checkConnection(sessionHandle);
        } catch (YAuthenticationException e) {
            return OPEN_FAILURE + e.getMessage() + CLOSE_FAILURE;
        }
        StringBuffer options = new StringBuffer();
        YWorkItem workItem = _engine.getWorkItem(workItemID);
        if (workItem != null) {
            if (workItem.getStatus().equals(YWorkItem.statusExecuting)) {
                options.append("<option operation=\"suspend\">" +
                        "<documentation>Suspend the currently active workItem</documentation>" +
                        "<style>post</style>" +
                        "<url>").append(thisURL).append("?action=suspend</url></option>");
                options.append("<option operation=\"complete\">" +
                        "<documentation>Notify the engine that the work item is complete</documentation>" +
                        "<style>post</style>" + "<url>").append(thisURL).append("?action=complete</url>" +
                        "<bodyContent>Any return data needed for this work item.</bodyContent>" +
                        "</option>");
            }
            try {
                _engine.checkElegibilityToAddInstances(workItemID);
                options.append("<option operation=\"addNewInstance\">" +
                        "<documentation>Add a new Instance similar to this work item</documentation>" +
                        "<style>post</style>" + "<url>").
                        append(thisURL).
                        append("?action=createInstance</url>" +
                                "<bodyContent>The data for the new instance.</bodyContent>" +
                                "</option>");
            } catch (YAWLException e) {
                //just don't provide that option.
                if (e instanceof YPersistenceException) {
                    enginePersistenceFailure = true;
                }
            }
            if (workItem.getStatus().equals(YWorkItem.statusEnabled)
                    || workItem.getStatus().equals(YWorkItem.statusFired)) {
                options.append("<option operation=\"start\">" +
                        "<documentation>Starts a work item</documentation>" +
                        "<style>post</style>" + "<url>").
                        append(thisURL).
                        append("?action=startOne&amp;user=[userID]</url>" +
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem

    private String describeWorkItems(Set workItems) {
        StringBuffer result = new StringBuffer();
        Iterator iter = workItems.iterator();
        while (iter.hasNext()) {
            YWorkItem workitem = (YWorkItem) iter.next();

            result.append(workitem.toXML());
        }
        return result.toString();
    }
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem

            _userList.checkConnection(sessionHandle);
        } catch (YAuthenticationException e) {
            return OPEN_FAILURE + e.getMessage() + CLOSE_FAILURE;
        }
        String result = "";
        YWorkItem item = _engine.getWorkItem(workItemID);
        if (item != null) {
            item.setStatus(YWorkItem.statusEnabled);
            result = startWorkItem(workItemID, sessionHandle);
        }
        return result ;
    }
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem

    public String cancelWorkItem(String workItemID, String fail, String sessionHandle)
                                                                 throws RemoteException {
        try {
            _userList.checkConnection(sessionHandle);
            YWorkItem item = _engine.getWorkItem(workItemID);
            _engine.cancelWorkItem(item, fail.equalsIgnoreCase("true")) ;
            return SUCCESS ;
        }
        catch (YAuthenticationException e) {
            return OPEN_FAILURE + e.getMessage() + CLOSE_FAILURE;
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem

                    Interface_Client.executePost(urlOfYawlService, paramsMap);
                } else if (InterfaceB_EngineBasedClient.CANCELALLWORKITEMS_CMD.equals(_command)) {
                    Iterator iter = _workItem.getChildren().iterator();
                    InterfaceB_EngineBasedClient.cancelWorkItem(_yawlService, _workItem);
                    while (iter.hasNext()) {
                        YWorkItem item = (YWorkItem) iter.next();
                        InterfaceB_EngineBasedClient.cancelWorkItem(_yawlService, item);
                    }
                } else if (InterfaceB_EngineBasedClient.CANCELWORKITEM_CMD.equals(_command)) {
                    //cancel the parent
                    String urlOfYawlService = _yawlService.getURI();
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem

            String mergedOutputData = Marshaller.getMergedOutputData(
                    inputData.getRootElement(),
                    outputData.getRootElement());

            YEngine eng = YEngine.getInstance();
            YWorkItem item = eng.getWorkItem(caseIDStr + ":" + taskID);
            YTask task = eng.getTaskDefinition(
                    item.getSpecificationID(),
                    item.getTaskID());
            Map outputParamsMP = task.getDecompositionPrototype().getOutputParameters();
            List outputParamsLst = new ArrayList(outputParamsMP.values());
            String filteredOutputData;
            if (task._net.getSpecification().usesSimpleRootData()) {
                filteredOutputData = mergedOutputData;
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem

    // MUTATORS ############################################################################
    public void applyForWorkItem(String caseID, String taskID) throws YSchemaBuildingException, YPersistenceException {
        Set workItems = _engineClient.getAvailableWorkItems();
        for (Iterator iterator = workItems.iterator(); iterator.hasNext();) {
            YWorkItem item = (YWorkItem) iterator.next();
            if (item.getCaseID().toString().equals(caseID) &&
                    item.getTaskID().equals(taskID)) {
                try {
                    _engineClient.startWorkItem(item, _username);

                } catch (YStateException e) {
                    logger.error("State Exception", e);
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem


    public void createNewInstance(String caseID, String taskID, String newInstanceData) throws YPersistenceException {
        Set workItems = _engineClient.getAllWorkItems();
        for (Iterator iterator = workItems.iterator(); iterator.hasNext();) {
            YWorkItem item = (YWorkItem) iterator.next();
            if (item.getCaseID().toString().equals(caseID) &&
                    item.getTaskID().equals(taskID)) {
                try {
                    _engineClient.createNewInstance(item, newInstanceData);
                } catch (YStateException e) {
                    e.printStackTrace();
                }
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem


    public boolean allowsDynamicInstanceCreation(String caseID, String taskID) {
        Set workItems = _engineClient.getAllWorkItems();
        for (Iterator iterator = workItems.iterator(); iterator.hasNext();) {
            YWorkItem item = (YWorkItem) iterator.next();
            if (item.getCaseID().toString().equals(caseID) &&
                    item.getTaskID().equals(taskID)) {
                try {
                    _engineClient.checkElegibilityToAddInstances(item.getIDString());
                    return true;
                } catch (YStateException e) {
                    return false;
                }
            }
View Full Code Here

Examples of au.edu.qut.yawl.engine.YWorkItem


    public void attemptToFinishActiveJob(String caseID, String taskID) {
        Set workItems = _engineClient.getAllWorkItems();
        for (Iterator iterator = workItems.iterator(); iterator.hasNext();) {
            YWorkItem item = (YWorkItem) iterator.next();
            if (item.getCaseID().toString().equals(caseID) &&
                    item.getTaskID().equals(taskID)) {
                try {
                    String outputData = _myActiveTasks.getOutputData(caseID, taskID);
                    _engineClient.completeWorkItem(item, outputData, false);
                } catch (YDataStateException e) {
                    String errors = e.getMessage();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.