Search in sources :

Example 1 with DefaultWorkplaceDescription

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

the class WorkplaceStoreCommand method rmWorkplace.

/**
 * Removes workplace.
 * @param name workplace name to remove
 */
private void rmWorkplace(String name) {
    WorkflowService service = get(WorkflowService.class);
    try {
        DefaultWorkplaceDescription wpDesc = DefaultWorkplaceDescription.builder().name(name).build();
        service.removeWorkplace(wpDesc);
    } catch (WorkflowException e) {
        error(e.getMessage() + ", trace: " + Arrays.asList(e.getStackTrace()));
    }
}
Also used : DefaultWorkplaceDescription(org.onosproject.workflow.api.DefaultWorkplaceDescription) WorkflowService(org.onosproject.workflow.api.WorkflowService) WorkflowException(org.onosproject.workflow.api.WorkflowException)

Example 2 with DefaultWorkplaceDescription

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

the class WorkplaceStoreCommand method addEmptyWorkplace.

/**
 * Adds empty workplace.
 * @param name workplace name
 */
private void addEmptyWorkplace(String name) {
    WorkflowService service = get(WorkflowService.class);
    try {
        DefaultWorkplaceDescription wpDesc = DefaultWorkplaceDescription.builder().name(name).build();
        service.createWorkplace(wpDesc);
    } catch (WorkflowException e) {
        error(e.getMessage() + ", trace: " + Arrays.asList(e.getStackTrace()));
    }
}
Also used : DefaultWorkplaceDescription(org.onosproject.workflow.api.DefaultWorkplaceDescription) WorkflowService(org.onosproject.workflow.api.WorkflowService) WorkflowException(org.onosproject.workflow.api.WorkflowException)

Aggregations

DefaultWorkplaceDescription (org.onosproject.workflow.api.DefaultWorkplaceDescription)2 WorkflowException (org.onosproject.workflow.api.WorkflowException)2 WorkflowService (org.onosproject.workflow.api.WorkflowService)2