Examples of TaskInformation


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

                }
            }
            if (_paramsDefinitions.getParamsForTask(item.getTaskID()) == null) {
                YTask task = _engineClient.getTaskDefinition(item.getSpecificationID(), item.getTaskID());
                String paramsAsXML = task.getInformation();
                TaskInformation taskInfo = Marshaller.unmarshalTaskInformation(paramsAsXML);
                YParametersSchema paramsForTask = taskInfo.getParamSchema();
                _paramsDefinitions.setParamsForTask(item.getTaskID(), paramsForTask);
            }
        }
    }
View Full Code Here

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

     * @param taskInfoStr  the task information String
     * @see this.getTaskInformationStr
     * @return the TaskInformation object
     */
    public static TaskInformation parseTaskInformation(String taskInfoStr) {
        TaskInformation taskInfo = null;
        //strip off extraneous <response> tag
        int beginClipping = taskInfoStr.indexOf(">") + 1;
        int endClipping = taskInfoStr.lastIndexOf("<");
        if (beginClipping >= 0 && endClipping >= 0) {
            taskInfoStr = taskInfoStr.substring(beginClipping, endClipping);
View Full Code Here

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

    public synchronized void finish(WorkItemRecord itemRecord, String _sessionHandle) {
        try {
            //System.out.println("Checking in work Item: " + itemRecord.getID());

            TaskInformation taskinfo = getTaskInformation(itemRecord.getSpecificationID(),
                    itemRecord.getTaskID(),
                    _sessionHandle);

            checkInWorkItem(itemRecord.getID(),
                    itemRecord.getWorkItemData(),
                    new Element(taskinfo.getDecompositionID()),
                    _sessionHandle);

        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

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

        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

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

      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.
            SpecificationData specData = worklistController.getSpecificationData(specID, _sessionHandle);

            //now we get the parameters signature for the task
            YParametersSchema paramsSignature = taskInfo.getParamSchema();

            //now for each input param build an instruction
            List inputParams = paramsSignature.getInputParams();
            List instructions = Collections.synchronizedList(new ArrayList());

            // this is an XML string containing the instance data for the current task
            // this can be the instance file, and if identical elements are found in
            // the schema during instance creation, the creation of new elements in
            // the instance will be ignored.

            for (int i = 0; i < inputParams.size(); i++) {
                YParameter inputParam = (YParameter) inputParams.get(i);

                if (null != inputParam.getElementName()) {

                    String elementName = inputParam.getElementName();
                    ElementReuseInstruction instruction = new ElementReuseInstruction(elementName);
                    instructions.add(instruction);
                } else if (null != inputParam.getDataTypeName()) {

                    String elementName = inputParam.getName();
                    String typeName = inputParam.getDataTypeName();
                    boolean isPrimitiveType = "http://www.w3.org/2001/XMLSchema".equals(inputParam.getDataTypeNameSpace());
                    ElementCreationInstruction instruction = new ElementCreationInstruction(
                            elementName, typeName, isPrimitiveType);
                    instructions.add(instruction);
                }
                // currently we convert untyped parameters into creation parameters, due to a bug in YAWL
                else if (inputParam.isUntyped()) {
                    //UntypedElementInstruction instruction = new UntypedElementInstruction();
                    //instructions.add(instruction);

                    String elementName = inputParam.getName();
                    //String typeName = inputParam.getDataTypeName();
                    String typeName = "boolean";
                    boolean isPrimitiveType = "http://www.w3.org/2001/XMLSchema".equals(inputParam.getDataTypeNameSpace());
                    ElementCreationInstruction instruction = new ElementCreationInstruction(
                            elementName, typeName, isPrimitiveType);
                    instructions.add(instruction);
                }
            }
           
            //for each output param build an instruction
            List outputParams = paramsSignature.getOutputParams();

            for (int i = 0; i < outputParams.size(); i++) {

                YParameter outputParam = (YParameter) outputParams.get(i);

                if (null != outputParam.getElementName()) {

                    String elementName = outputParam.getElementName();
                    ElementReuseInstruction instruction = new ElementReuseInstruction(elementName);

                    // if an instruction with the same name already exists in the instruction list
                    // remove it and add the instruction for this parameter

                    if (instructions.contains(instruction) == true) {

                        // Matching element REUSE instruction found.
                        Instruction tempInstruction;
                        int position = instructions.indexOf(instruction);
                        tempInstruction = (Instruction) instructions.get(position);
                        if (tempInstruction.getElementName().compareTo(instruction.getElementName()) == 0) {
                            instructions.remove(position);
                        }
                    }
                    else {
                      logger.debug("No matching element REUSE instruction found: " + elementName);
                    }

                    instructions.add(instruction);
                } else if (null != outputParam.getDataTypeName()) {

                    String elementName = outputParam.getName();
                    String typeName = outputParam.getDataTypeName();
                    boolean isPrimitiveType = "http://www.w3.org/2001/XMLSchema".equals(outputParam.getDataTypeNameSpace());
                    ElementCreationInstruction instruction = new ElementCreationInstruction(
                            elementName, typeName, isPrimitiveType);

                    // if an instruction with the same name already exists in the instruction list
                    // remove it and add the instruction for this parameter
                    Instruction[] ins = (Instruction[]) instructions.toArray(new Instruction[instructions.size()]);

                    boolean match = false;
                    for (int j = 0; j < ins.length; j++) {
                        if (ins[j].getElementName().compareTo(elementName) == 0) {
                            match = true;
                            ins[j] = instruction; // replace old instruction with this one
                        }
                    }

                    if (match == true) {
                        // convert updated array back to the instructions arraylist
                        instructions.clear();
                        for (int j = 0; j < ins.length; j++) {
                            instructions.add(ins[j]);
                        }
                    }
                    else {
                        instructions.add(instruction);
                    }
                }
               
                // currently we convert untyped parameters into creation parameters, due to a bug in YAWL
                else if (outputParam.isUntyped()) {
                    //UntypedElementInstruction instruction = new UntypedElementInstruction();
                    //instructions.add(instruction);

                    String elementName = outputParam.getName();
                    //String typeName = outputParam.getDataTypeName();
                    String typeName = "boolean";
                    //boolean isPrimitiveType = "http://www.w3.org/2001/XMLSchema".equals(outputParam.getDataTypeNameSpace());
                    boolean isPrimitiveType = true;
                    ElementCreationInstruction instruction = new ElementCreationInstruction(
                            elementName, typeName, isPrimitiveType);

                    // if an instruction with the same name already exists in the instruction list
                    // remove it and add the instruction for this parameter
                    Instruction[] ins = (Instruction[]) instructions.toArray(new Instruction[instructions.size()]);
                    boolean match = false;

                    for (int j = 0; j < ins.length; j++) {
                      logger.debug(j + ".");
                        if (ins[j].getElementName().compareTo(elementName) == 0) {
                            match = true;
                            ins[j] = instruction; // replace old instruction with this one
                        }
                    }

                    if (match == true) {
                        // convert updated array back to the instructions arraylist
                        instructions.clear();
                        for (int j = 0; j < ins.length; j++) {
                            instructions.add(ins[j]);
                        }
                    }
                    else {
                        instructions.add(instruction);
                    }
                }
            }

            XMLToolsForYAWL xmlToolsForYawl = new XMLToolsForYAWL();
            String schemaLibrary = specData.getSchemaLibrary();
            xmlToolsForYawl.setPrimarySchema(schemaLibrary);
            myNewSchema = xmlToolsForYawl.createYAWLSchema(
                    (Instruction[]) instructions.toArray(new Instruction[instructions.size()]),
                    taskInfo.getDecompositionID());         
        }
       
        return(myNewSchema);
    }
View Full Code Here

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

      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());
View Full Code Here

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

                "<outputParam name=\"legs\"><type>mm:LegType</type><ordering>2</ordering><mandatory/>" +
                "</outputParam>" +
                "<outputParam name=\"customer\"><type>xs:string</type><ordering>1</ordering><mandatory/>" +
                "</outputParam>" +
                "</params></taskInfo></response>";
        TaskInformation taskinfo =
                InterfaceB_EnvironmentBasedClient.
                parseTaskInformation(thestring);
        assertTrue(taskinfo != null);
    }
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.