Package au.edu.qut.yawl.worklist.model

Examples of au.edu.qut.yawl.worklist.model.WorkItemRecord


                _sessionHandle = connect(DEFAULT_ENGINE_USERNAME, DEFAULT_ENGINE_PASSWORD);
            }
            if (!successful(_sessionHandle)) {
                _logger.error("Unsuccessful");
            } else {
                WorkItemRecord child = checkOut(workItemRecord.getID(), _sessionHandle);

                if (child != null) {
                    List children = super.getChildren(workItemRecord.getID(), _sessionHandle);
                    for (int i = 0; i < children.size(); i++) {
                        WorkItemRecord itemRecord = (WorkItemRecord) children.get(i);
                        if (WorkItemRecord.statusFired.equals(itemRecord.getStatus())) {
                            checkOut(itemRecord.getID(), _sessionHandle);
                        }
                    }
                    children = super.getChildren(workItemRecord.getID(), _sessionHandle);
                    for (int i = 0; i < children.size(); i++) {
                        WorkItemRecord itemRecord = (WorkItemRecord) children.get(i);
                        //System.out.println("WebServiceController::processEnabledAnnouncement() itemRecord = " + itemRecord);
                        super._model.addWorkItem(itemRecord);

                        //System.out.println("added: " + itemRecord.getID());

                        Element inputData = itemRecord.getWorkItemData();
                        //System.out.println(inputData);
                        Element element = (Element) inputData.getChildren().get(0);
                        String notifytime = element.getText();
                        //System.out.println("Notified of: " + notifytime);
View Full Code Here


                    "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" +
                    "\t\tAvailable Work Items\n" +
                    "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
            */
            for (int i = 0; i < availableWork.size(); i++) {
                WorkItemRecord record = (WorkItemRecord) availableWork.get(i);
                System.out.println("record.toXML() = " + record.toXML());
            }

            List activeWork = wc.getActiveWork("admin", sessionHandle);
            /*System.out.println(
                    "\n\n" +
                    "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" +
                    "\t\tActive Work Items\n" +
                    "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
            */
            for (int i = 0; i < activeWork.size(); i++) {
                WorkItemRecord record = (WorkItemRecord) activeWork.get(i);
                //System.out.println("record.toXML() = " + record.toXML());
            }


        } catch (Exception e) {
View Full Code Here

        String schema = createSchema(workItemID, sessionHandle, _worklistController);
        parameters.put("schema", schema);
               
        // retrieve list of input params to send to YAWLXForms that will display them
        // as read-only fields.
        WorkItemRecord item = _worklistController.getCachedWorkItem(workItemID);
        TaskInformation taskInfo = _worklistController.getTaskInformation(
                item.getSpecificationID(), item.getTaskID(), sessionHandle);
       
        // set instance data
        InstanceBuilder ib = new InstanceBuilder(schema, taskInfo.getDecompositionID(), item.getDataListString());
        parameters.put("instance", ib.getInstance());
       
        // set input params (if any exist)
        YParametersSchema paramsSignature = taskInfo.getParamSchema();
        parameters.put("inputparams", getInputOnlyParams(paramsSignature.getInputParams(), paramsSignature.getOutputParams()));
        parameters.put("root", taskInfo.getDecompositionID());
        parameters.put("task", URLEncoder.encode(taskInfo.getTaskID(), "UTF-8"));
        parameters.put("workItemID", item.getID());
        parameters.put("JSESSIONID", jsessionid);
       
        // send (post) data to yawlXForms thru interfaceD
        idx.sendWorkItemData(parameters, item, userID, sessionHandle);
    }
View Full Code Here

            throws IOException, JDOMException, YSchemaBuildingException, YSyntaxException {
     
      // this method is a replacement for the SchemaCreator class,
      // fixing a design error since that class was a Singleton.
      String myNewSchema = new String();
        WorkItemRecord item = worklistController.getCachedWorkItem(_workItemID);

        if (item != null) {
            //first of all get the task information which contains the parameter signatures.
            TaskInformation taskInfo = worklistController.getTaskInformation(
                    item.getSpecificationID(), item.getTaskID(), _sessionHandle);

            String specID = taskInfo.getSpecificationID();

            //next get specification data which will contain the input schema library
            //that we are going to use to build the schema that we want for this task.
View Full Code Here

    public String executePDFWorkItemPost(ServletContext context, String workItemID, String decompositionID,
      String sessionHandle, WorklistController _worklistController, String userID)
            throws YSchemaBuildingException, YSyntaxException, IOException,
            JDOMException {

        WorkItemRecord item = _worklistController.getCachedWorkItem(workItemID);
        TaskInformation taskInfo = _worklistController.getTaskInformation(
                item.getSpecificationID(), item.getTaskID(), sessionHandle);

    HashMap map = new HashMap();
 
    logger.debug("workitem is: " + item.getDataListString());
 
    StringBuffer xmlBuff = new StringBuffer();
    xmlBuff.append("<workItem>");
    xmlBuff.append("<taskID>" + item.getTaskID() + "</taskID>");
    xmlBuff.append("<caseID>" + item.getCaseID() + "</caseID>");
    xmlBuff.append("<uniqueID>" + item.getUniqueID() + "</uniqueID>");
    xmlBuff.append("<specID>" + item.getSpecificationID() + "</specID>");
    xmlBuff.append("<status>" + item.getStatus() + "</status>");
    xmlBuff.append("<data>" + item.getDataListString() + "</data>");
    xmlBuff.append("<enablementTime>" + item.getEnablementTime() + "</enablementTime>");
    xmlBuff.append("<firingTime>" + item.getFiringTime() + "</firingTime>");
    xmlBuff.append("<startTime>" + item.getStartTime() + "</startTime>");
    xmlBuff.append("<assignedTo>" + item.getWhoStartedMe() + "</assignedTo>");
    xmlBuff.append("</workItem>");
     
    map.put("decompositionID",decompositionID);
    map.put("workitem",xmlBuff.toString());
    //map.put("username",_worklistController.getUsername());
    Interface_Client.executePost("http://localhost:8080/worklist/handler",map); // TODO: remove localhost reference
    logger.debug("Calling the pdf handler");
   
    return item.getSpecificationID()+item.getTaskID()+item.getUniqueID()+".pdf";
    }
View Full Code Here

            }
            if (successful(_sessionHandle)) {
                List executingChildren = checkOutAllInstancesOfThisTask(enabledWorkItem, _sessionHandle);

                for (int i = 0; i < executingChildren.size(); i++) {
                    WorkItemRecord itemRecord = (WorkItemRecord) executingChildren.get(i);
                    Element inputData = itemRecord.getWorkItemData();
                    String wsdlLocation = inputData.getChildText(WSDL_LOCATION_PARAMNAME);
                    String portName = inputData.getChildText(WSDL_PORTNAME_PARAMNAME);
                    String operationName = inputData.getChildText(WSDL_OPERATIONNAME_PARAMNAME);

                    Element webServiceArgsData = (Element) inputData.clone();
                    webServiceArgsData.removeChild(WSDL_LOCATION_PARAMNAME);
                    webServiceArgsData.removeChild(WSDL_PORTNAME_PARAMNAME);
                    webServiceArgsData.removeChild(WSDL_OPERATIONNAME_PARAMNAME);

                    Map replyFromWebServiceBeingInvoked =
                            WSIFInvoker.invokeMethod(
                                    wsdlLocation,
                                    portName,
                                    operationName,
                                    webServiceArgsData,
                                    getAuthenticationConfig());

                    System.out.println("\n\nReply from Web service being " +
                            "invoked is :" + replyFromWebServiceBeingInvoked);

                    Element caseDataBoundForEngine = prepareReplyRootElement(enabledWorkItem, _sessionHandle);

                    for (Iterator iterator = replyFromWebServiceBeingInvoked.keySet().iterator(); iterator.hasNext();) {
                        String varName = (String) iterator.next();
                        Object replyMsg = replyFromWebServiceBeingInvoked.get(varName);
                        System.out.println("replyMsg class = " + replyMsg.getClass().getName());
                        String varVal = replyMsg.toString();

                        Element content = new Element(varName);
                        content.setText(varVal);
                        caseDataBoundForEngine.addContent(content);
                    }

                    _logger.debug("\nResult of item [" +
                            itemRecord.getID() + "] checkin is : " +
                            checkInWorkItem(
                                    itemRecord.getID(),
                                    inputData,
                                    caseDataBoundForEngine,
                                    _sessionHandle));
                }
            }
View Full Code Here

TOP

Related Classes of au.edu.qut.yawl.worklist.model.WorkItemRecord

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.