blob: 9f609b3200d23afb485e2abac7e238195d0c0a54 [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
18import org.onosproject.event.Event;
19import org.onosproject.event.ListenerService;
20
21/**
22 * Interface for workflow execution service.
23 */
24public interface WorkflowExecutionService extends ListenerService<WorkflowDataEvent, WorkflowDataListener> {
25
26 /**
27 * Executes init worklet.
28 * @param context workflow context
29 */
30 void execInitWorklet(WorkflowContext context);
31
32 /**
jaegonkime0f45b52018-10-09 20:23:26 +090033 * Evals workflow context.
34 * @param contextName the name of workflow context
35 */
36 void eval(String contextName);
37
38 /**
jaegonkim6a7b5242018-09-12 23:09:42 +090039 * Triggers workflow event map.
40 * @param event triggering event
41 * @param generator event hint generation method reference
42 */
43 void eventMapTrigger(Event event, EventHintSupplier generator);
44
45 /**
46 * Registers workflow event map.
47 * @param eventType event type (class name of event)
48 * @param eventHint event hint value
49 * @param contextName workflow context name to be called by this event map
jaegonkime0f45b52018-10-09 20:23:26 +090050 * @param programCounterString worklet type to be called by this event map
jaegonkim6a7b5242018-09-12 23:09:42 +090051 * @throws WorkflowException workflow exception
52 */
53 void registerEventMap(Class<? extends Event> eventType, String eventHint,
jaegonkime0f45b52018-10-09 20:23:26 +090054 String contextName, String programCounterString) throws WorkflowException;
jaegonkim6a7b5242018-09-12 23:09:42 +090055}