use of org.onosproject.workflow.api.WorkplaceStore in project onos by opennetworkinglab.
the class WorkplaceStoreCommand method printAllWorkplace.
/**
* Prints all workplaces.
*/
private void printAllWorkplace() {
WorkplaceStore workplaceStore = get(WorkplaceStore.class);
for (Workplace workplace : workplaceStore.getWorkplaces()) {
print(getWorkplaceString(workplace));
printWorkplaceContexts(workplaceStore, workplace.name());
}
}
use of org.onosproject.workflow.api.WorkplaceStore 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();
}
}
use of org.onosproject.workflow.api.WorkplaceStore in project onos by opennetworkinglab.
the class WorkFlowCommand method eval.
/**
* Evaluates workflow context.
* @param workflowContextName workflow context name
*/
private void eval(String workflowContextName) {
WorkplaceStore storService = get(WorkplaceStore.class);
WorkflowExecutionService execService = get(WorkflowExecutionService.class);
WorkflowContext context = storService.getContext(workflowContextName);
if (context == null) {
error("failed to find workflow context {}", workflowContextName);
return;
}
execService.eval(workflowContextName);
}
use of org.onosproject.workflow.api.WorkplaceStore in project onos by opennetworkinglab.
the class WorkplaceStoreCommand method printWorkplace.
/**
* Prints workplace.
* @param name workplace name
*/
private void printWorkplace(String name) {
WorkplaceStore workplaceStore = get(WorkplaceStore.class);
Workplace workplace = workplaceStore.getWorkplace(name);
if (Objects.isNull(workplace)) {
print("Not existing workplace " + name);
return;
}
print(getWorkplaceString(workplace));
printWorkplaceContexts(workplaceStore, workplace.name());
}
Aggregations