Search in sources :

Example 1 with WorkflowStore

use of org.onosproject.workflow.api.WorkflowStore in project onos by opennetworkinglab.

the class WorkFlowStoreCommand method rmWorkflow.

private void rmWorkflow(String id) {
    WorkflowStore workflowStore = get(WorkflowStore.class);
    workflowStore.unregister(URI.create(id));
}
Also used : WorkflowStore(org.onosproject.workflow.api.WorkflowStore)

Example 2 with WorkflowStore

use of org.onosproject.workflow.api.WorkflowStore in project onos by opennetworkinglab.

the class WorkflowStatusCommand method invoke.

private void invoke() {
    try {
        WorkflowStore workflowStore = get(WorkflowStore.class);
        WorkplaceStore workplaceStore = get(WorkplaceStore.class);
        System.out.printf("%-25s %-45s %-10s%n", "DEVICEIP", " WORKFLOW NAME", "WORKFLOW STATE");
        for (WorkflowContext context : workplaceStore.getContexts()) {
            for (Workflow workflow : workflowStore.getAll()) {
                if (context.workflowId().equals(workflow.id())) {
                    JsonDataModelTree tree = (JsonDataModelTree) context.data();
                    JsonNode mgmtIp = tree.nodeAt("/mgmtIp");
                    System.out.printf("%-25s %-45s %-10s%n", mgmtIp, context.name(), context.state().toString());
                }
            }
        }
    } catch (WorkflowException e) {
        e.printStackTrace();
    }
}
Also used : WorkflowStore(org.onosproject.workflow.api.WorkflowStore) WorkplaceStore(org.onosproject.workflow.api.WorkplaceStore) WorkflowContext(org.onosproject.workflow.api.WorkflowContext) WorkflowException(org.onosproject.workflow.api.WorkflowException) JsonDataModelTree(org.onosproject.workflow.api.JsonDataModelTree) Workflow(org.onosproject.workflow.api.Workflow) JsonNode(com.fasterxml.jackson.databind.JsonNode)

Aggregations

WorkflowStore (org.onosproject.workflow.api.WorkflowStore)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 JsonDataModelTree (org.onosproject.workflow.api.JsonDataModelTree)1 Workflow (org.onosproject.workflow.api.Workflow)1 WorkflowContext (org.onosproject.workflow.api.WorkflowContext)1 WorkflowException (org.onosproject.workflow.api.WorkflowException)1 WorkplaceStore (org.onosproject.workflow.api.WorkplaceStore)1