Package gri.tasks

Examples of gri.tasks.TaskDef


   
    public void actionPerformed(ActionEvent e) {
       
        //get/validate inputs:
        Map inputs = this.pnlTask.getValues();
        TaskDef taskDef = task.getTaskDef();
        ParameterDef [] inputDefs = taskDef.getInputsArray();
        for (int i=0; i<inputDefs.length; i++) {
            String paramName = inputDefs[i].getName();
            if (inputDefs[i].isRequired() && inputs.get(paramName) == null) {
                error("Required parameter not entered: " + paramName);
                return;
            }
        }
   
        Map outputs = null;
       
        //execute:
        try {
            outputs = task.execute(inputs);
        }
        catch(Exception ex) {
            ex.printStackTrace();
            return;
        }
       
        //display outputs:
        ParameterDef [] outputDefs = taskDef.getOutputsArray();
        for (int i=0; i<outputDefs.length; i++) {
          String name = outputDefs[i].getName();
            Object value = outputs.get(name);
            System.out.println(name + " = " + value);
        }
View Full Code Here

TOP

Related Classes of gri.tasks.TaskDef

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.