1 /*
2 * Copyright 2010 Fraunhofer Gesellschaft, Munich, Germany,
3 * for its Fraunhofer Institute for Computer Architecture and Software
4 * Technology (FIRST), Berlin, Germany. All rights reserved.
5 * http://www.first.fraunhofer.de/
6 */
7 package net.kwfgrid.gwes.operationmapper;
8
9 import net.kwfgrid.gworkflowdl.structure.Transition;
10 import net.kwfgrid.gwes.GenericWorkflowHandler;
11 import net.kwfgrid.gwes.exception.OperationMapperException;
12
13 import java.util.ArrayList;
14
15 /**
16 * The abstract class OperationMapper is used to encapsulate methods that map operations to a less abstract one, e.g.,
17 * <ul>
18 * <li>Operation to OperationClass (Red to Yellow)</li>
19 * <li>OperationClass to OperationCandidates (Yellow to Blue)</li>
20 * <li>Select one OperationCandidate (Blue to Green)</li>
21 * </ul>
22 * @author Andreas Hoheisel
23 * (<a href="http://www.andreas-hoheisel.de">www.andreas-hoheisel.de</a>)
24 * @version $Id: OperationMapper.java 1419 2010-11-01 14:12:17Z hoheisel $
25 */
26 public abstract class OperationMapper {
27
28 /**
29 * Maps the operation contained in the specified transition to a less abstract level.
30 * @param handler The parent workflow handler.
31 * @param transition
32 * @return <code>true</code> if a mapping was possible, <code>false</code> otherwise.
33 */
34 public abstract boolean processTransition(GenericWorkflowHandler handler, Transition transition) throws OperationMapperException;
35
36 /**
37 * Maps the operation contained in the specified list of transitions to a less abstract level.
38 * @param handler The parent workflow handler.
39 * @param transitions The list of transitions.
40 * @return <code>true</code> if a mapping was possible, <code>false</code> otherwise.
41 * @throws OperationMapperException
42 */
43 public abstract boolean processTransitions(GenericWorkflowHandler handler, ArrayList<Transition> transitions) throws OperationMapperException;
44
45 }