Package org.apache.oodt.cas.workflow.structs

Examples of org.apache.oodt.cas.workflow.structs.Workflow


                    "workflowmgr.getWorkflowsByEvent", argList);

            if (workflowVector != null) {
                for (Iterator i = workflowVector.iterator(); i.hasNext();) {
                    Hashtable workflowHash = (Hashtable) i.next();
                    Workflow w = XmlRpcStructFactory
                            .getWorkflowFromXmlRpc(workflowHash);
                    workflows.add(w);
                }
            }
View Full Code Here


        argList.add(workflowId);

        try {
            Hashtable workflow = (Hashtable) client.execute(
                    "workflowmgr.getWorkflowById", argList);
            Workflow w = XmlRpcStructFactory.getWorkflowFromXmlRpc(workflow);
            return w;
        } catch (XmlRpcException e) {
            e.printStackTrace();
            throw new Exception(e.getMessage());
        } catch (IOException e) {
View Full Code Here

            if (works != null) {
                workflows = new Vector(works.size());

                for (Iterator i = works.iterator(); i.hasNext();) {
                    Hashtable workflw = (Hashtable) i.next();
                    Workflow w = XmlRpcStructFactory
                            .getWorkflowFromXmlRpc(workflw);
                    workflows.add(w);
                }

                return workflows;
View Full Code Here

            try {
                workflows = client.getWorkflows();

                if (workflows != null) {
                    for (Iterator i = workflows.iterator(); i.hasNext();) {
                        Workflow w = (Workflow) i.next();
                        System.out.println("Workflow: [id=" + w.getId()
                                + ", name=" + w.getName() + ", numTasks="
                                + w.getTasks().size() + "]");
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        } else if (operation.equals("--getTaskById")) {
            String taskId = null;

            for (int i = 4; i < args.length; i++) {
                if (args[i].equals("--id")) {
                    taskId = args[++i];
                }
            }

            if (taskId == null) {
                System.err.println(getTaskByIdOperation);
                System.exit(1);
            }

            // create the client
            XmlRpcWorkflowManagerClient client = new XmlRpcWorkflowManagerClient(
                    new URL(url));

            WorkflowTask task = null;

            try {
                task = client.getTaskById(taskId);
                System.out.println("Task: [id=" + task.getTaskId() + ", name="
                        + task.getTaskName() + ", order=" + task.getOrder()
                        + ", class=" + task.getClass().getName()
                        + ", numConditions=" + task.getConditions().size()
                        + ", configuration="
                        + task.getTaskConfig().getProperties() + "]");
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }

        } else if (operation.equals("--getConditionById")) {
            String conditionId = null;

            for (int i = 4; i < args.length; i++) {
                if (args[i].equals("--id")) {
                    conditionId = args[++i];
                }
            }

            if (conditionId == null) {
                System.err.println(getConditionByIdOperation);
                System.exit(1);
            }

            // create the client
            XmlRpcWorkflowManagerClient client = new XmlRpcWorkflowManagerClient(
                    new URL(url));

            WorkflowCondition condition = null;

            try {
                condition = client.getConditionById(conditionId);
                System.out.println("Condition: [id="
                        + condition.getConditionId() + ", name="
                        + condition.getConditionName() + ", order="
                        + condition.getOrder() + ", class="
                        + condition.getClass().getName() + "]");
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        } else if (operation.equals("--getWorkflowById")) {
            String workflowId = null;

            for (int i = 4; i < args.length; i++) {
                if (args[i].equals("--id")) {
                    workflowId = args[++i];
                }
            }

            if (workflowId == null) {
                System.err.println(getWorkflowByIdOperation);
                System.exit(1);
            }

            // create the client
            XmlRpcWorkflowManagerClient client = new XmlRpcWorkflowManagerClient(
                    new URL(url));

            Workflow workflow = null;

            try {
                workflow = client.getWorkflowById(workflowId);
                System.out.println("Workflow: [id=" + workflow.getId()
                        + ", name=" + workflow.getName() + ", numTasks="
                        + workflow.getTasks().size() + "]");
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        } else if (operation.equals("--getRegisteredEvents")) {
            XmlRpcWorkflowManagerClient client = new XmlRpcWorkflowManagerClient(
                    new URL(url));

            List events = null;

            try {
                events = client.getRegisteredEvents();

                if (events != null) {
                    for (Iterator i = events.iterator(); i.hasNext();) {
                        String event = (String) i.next();
                        System.out.println("Event: [name=" + event + "]");
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        } else if (operation.equals("--getWorkflowsByEvent")) {
            XmlRpcWorkflowManagerClient client = new XmlRpcWorkflowManagerClient(
                    new URL(url));

            List workflows = null;

            String eventName = null;

            for (int i = 4; i < args.length; i++) {
                if (args[i].equals("--eventName")) {
                    eventName = args[++i];
                }
            }

            if (eventName == null) {
                System.err.println(getWorkflowsByEventOperation);
                System.exit(1);
            }

            try {
                workflows = client.getWorkflowsByEvent(eventName);

                if (workflows != null) {
                    for (Iterator i = workflows.iterator(); i.hasNext();) {
                        Workflow w = (Workflow) i.next();
                        System.out.println("Workflow: [id=" + w.getId()
                                + ", name=" + w.getName() + ", numTasks="
                                + w.getTasks().size() + "]");
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
View Full Code Here

        try {
            workflows = repo.getWorkflowsForEvent(eventName);

            if (workflows != null) {
                for (Iterator i = workflows.iterator(); i.hasNext();) {
                    Workflow w = (Workflow) i.next();
                    Hashtable workflow = XmlRpcStructFactory
                            .getXmlRpcWorkflow(w);
                    workflowList.add(workflow);
                }
            }
View Full Code Here

                            + eventName + ": Message: " + e.getMessage());
        }

        if (workflows != null) {
            for (Iterator i = workflows.iterator(); i.hasNext();) {
                Workflow w = (Workflow) i.next();
                LOG.log(Level.INFO, "WorkflowManager: Workflow " + w.getName()
                        + " retrieved for event " + eventName);

                Metadata m = new Metadata();
                m.addMetadata(metadata);

                try {
                    engine.startWorkflow(w, m);
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new EngineException(
                            "Engine exception when starting workflow: "
                                    + w.getName() + ": Message: "
                                    + e.getMessage());
                }
            }
            return true;
        } else
View Full Code Here

            try {
                for (Iterator i = workflowInsts.iterator(); i.hasNext();) {
                    WorkflowInstance wInst = (WorkflowInstance) i.next();
                    // pick up the description of the workflow
                    Workflow wDesc = repo.getWorkflowById(wInst.getWorkflow()
                            .getId());
                    // TODO: hack for now, fix this, we shouldn't have to cast
                    // here, bad
                    // design
                    wInst.setWorkflow(wDesc);
View Full Code Here

            try {
                for (Iterator i = workflowInsts.iterator(); i.hasNext();) {
                    WorkflowInstance wInst = (WorkflowInstance) i.next();
                    // pick up the description of the workflow
                    Workflow wDesc = repo.getWorkflowById(wInst.getWorkflow()
                            .getId());
                    // TODO: hack for now, fix this, we shouldn't have to cast
                    // here, bad
                    // design
                    wInst.setWorkflow(wDesc);
View Full Code Here

            LOG.log(Level.INFO, "Getting workflows: retrieved: "
                    + workflowList.size() + " workflows");

            try {
                for (Iterator i = workflowList.iterator(); i.hasNext();) {
                    Workflow w = (Workflow) i.next();
                    Hashtable workflow = XmlRpcStructFactory
                            .getXmlRpcWorkflow(w);
                    workflows.add(workflow);
                }
View Full Code Here

    }

    public Hashtable getWorkflowById(String workflowId)
            throws RepositoryException {
        try {
            Workflow workflow = repo.getWorkflowById(workflowId);
            return XmlRpcStructFactory.getXmlRpcWorkflow(workflow);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RepositoryException(
                    "Exception getting workflow by id from the repository: Message: "
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.workflow.structs.Workflow

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.