blob: 4f91bba71de781cf533a1723d7f457b2ec999e88 [file] [log] [blame]
jaegonkim6a7b5242018-09-12 23:09:42 +09001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.workflow.api;
17
18/**
19 * An interface representing branch worklet. Branch worklet is used for branching workflow execution.
20 */
21public interface BranchWorklet extends Worklet {
22
23 @Override
24 default void process(WorkflowContext context) throws WorkflowException {
25 throw new WorkflowException("This workletType.process should not be called");
26 }
27
28 @Override
29 default boolean isNext(WorkflowContext context) throws WorkflowException {
30 throw new WorkflowException("This workletType.isNext should not be called");
31 }
32
33 /**
34 * Returns next worklet class for branching.
35 * @param context workflow context
36 * @return next worklet class
37 * @throws WorkflowException workflow exception
38 */
39 Class<? extends Worklet> next(WorkflowContext context) throws WorkflowException;
40}
41