use of org.onosproject.workflow.api.DefaultWorkplace in project onos by opennetworkinglab.
the class WorkflowManager method createWorkplace.
@Override
public void createWorkplace(WorkplaceDescription wpDesc) throws WorkflowException {
log.info("createWorkplace: {}", wpDesc);
JsonNode root;
if (wpDesc.data().isPresent()) {
root = wpDesc.data().get();
} else {
root = JsonNodeFactory.instance.objectNode();
}
DefaultWorkplace workplace = new DefaultWorkplace(wpDesc.name(), new JsonDataModelTree(root));
workplaceStore.registerWorkplace(wpDesc.name(), workplace);
}
use of org.onosproject.workflow.api.DefaultWorkplace in project onos by opennetworkinglab.
the class WorkFlowEngine method activate.
@Activate
public void activate() {
appId = coreService.registerApplication(APPID);
workplaceStore.setDelegate(workplaceStoreDelegate);
localNodeId = clusterService.getLocalNode().id();
leadershipService.runForLeadership(appId.name());
workflowBatchExecutor = newSingleThreadExecutor(groupedThreads("onos/workflow", "workflow-batch", log));
workflowExecutor = newFixedThreadPool(DEFAULT_WORKFLOW_THREADS, groupedThreads("onos/workflow-exec", "worker-%d", log));
handlerTaskBatchExecutor = newSingleThreadExecutor(groupedThreads("onos/workflow", "handlertask-batch", log));
handlerTaskExecutor = newFixedThreadPool(DEFAULT_EVENTTASK_THREADS, groupedThreads("onos/handlertask-exec", "worker-%d", log));
eventMapTriggerExecutor = newSingleThreadScheduledExecutor(groupedThreads("onos/workflow-engine", "eventmap-trigger-executor"));
(new WorkplaceWorkflow(this, workflowStore)).registerWorkflows();
JsonDataModelTree data = new JsonDataModelTree(JsonNodeFactory.instance.objectNode());
workplaceStore.registerWorkplace(Workplace.SYSTEM_WORKPLACE, new DefaultWorkplace(Workplace.SYSTEM_WORKPLACE, data));
log.info("Started");
}
Aggregations