2ronwalf// The MIT License
2ronwalf//
2ronwalf// Copyright (c) 2004 Evren Sirin
2ronwalf//
2ronwalf// Permission is hereby granted, free of charge, to any person obtaining a copy
2ronwalf// of this software and associated documentation files (the "Software"), to
2ronwalf// deal in the Software without restriction, including without limitation the
2ronwalf// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
2ronwalf// sell copies of the Software, and to permit persons to whom the Software is
2ronwalf// furnished to do so, subject to the following conditions:
2ronwalf//
2ronwalf// The above copyright notice and this permission notice shall be included in
2ronwalf// all copies or substantial portions of the Software.
2ronwalf//
2ronwalf// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2ronwalf// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2ronwalf// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2ronwalf// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2ronwalf// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2ronwalf// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2ronwalf// IN THE SOFTWARE.
2ronwalf
2ronwalf/*
2ronwalf * Created on Jun 27, 2003
2ronwalf */
2ronwalfpackage org.mindswap.owls.process.execution;
2ronwalf
2ronwalfimport java.util.EventListener;
2ronwalf
2ronwalfimport org.mindswap.owl.OWLKnowledgeBase;
2ronwalfimport org.mindswap.owls.process.Perform;
2ronwalfimport org.mindswap.owls.process.Process;
2ronwalfimport org.mindswap.query.ValueMap;
2ronwalf
2ronwalf/**
2ronwalf * @author Evren Sirin
2ronwalf *
2ronwalf */
2ronwalfpublic interface ProcessExecutionEngine extends EventListener {
2ronwalf /**
2ronwalf * @deprecated Use addMonitor(ProcessMonitor monitor) instead
2ronwalf */
2ronwalf public void addExecutionListener(ProcessExecutionListener listener);
2ronwalf
2ronwalf public void addMonitor(ProcessMonitor monitor);
2ronwalf
2ronwalf /**
2ronwalf * Set the KB where preconditions will be evaluated and the results will be put. This
2ronwalf * is simply the execution environment.
2ronwalf */
2ronwalf public void setKB(OWLKnowledgeBase kb);
2ronwalf
2ronwalf /**
2ronwalf * Get the KB.
2ronwalf */
2ronwalf public OWLKnowledgeBase getKB();
2ronwalf
2ronwalf /**
2ronwalf * Enable/disable precondition evaluation. Note that if there are local variables
2ronwalf * bound by the precondition then the execution may fail when precondition evaluation
2ronwalf * is disabled.
2ronwalf */
2ronwalf public void setPreconditionCheck(boolean checkPreconditions);
2ronwalf
2ronwalf /**
2ronwalf * Get if the execution engine verifies preconditions.
2ronwalf */
2ronwalf public boolean isPreconditionCheck();
2ronwalf
2ronwalf /**
2ronwalf * Set the behavior for cases where evaluating a precondition may yield multiple different
2ronwalf * values for a local variable. If this option is enabled then the execution engine will
2ronwalf * simply pick the first value from the possible bindings and conintue. Otherwise an
2ronwalf * ExecutionException will be thrown indicating that execution failed.
2ronwalf *
2ronwalf * @param allow If true one of the multiple bindings for a precondition is chosen else
2ronwalf * an ExecutionException is thrown
2ronwalf */
2ronwalf public void setAllowMultipleSatisifedPreconditions(boolean allow);
2ronwalf
2ronwalf /**
4daenzerorama * Returns if multiple satisifed preconditions are allowed
4daenzerorama * @return true if multiple satisifed preconditions are allowed. false, otherwise
2ronwalf */
4daenzerorama public boolean isAllowMultipleSatisifedPreconditions();
2ronwalf
2ronwalf /**
2ronwalf * Execute the given process with no value bindings for input parameters. Process is
2ronwalf * assumed to have no input parameters or all the value bindings were already specified
2ronwalf * in the defaultValues
2ronwalf *
2ronwalf * @param p Process to be executed
2ronwalf * @return Value bindings for the output parameters after the execution. Returns null if
2ronwalf * execution is not successful
2ronwalf */
2ronwalf public ValueMap execute(Process p) throws Exception;
2ronwalf
2ronwalf
2ronwalf /**
2ronwalf * Execute the given OWL-S process with the given input value bindings. If a value is not
2ronwalf * specified for a parameter in the valueMap then the default values of the process is
2ronwalf * searched.
2ronwalf *
2ronwalf * @param p Process to be executed
2ronwalf * @param map Value bindings for the input parameters
2ronwalf * @return Value bindings for the output parameters after the execution. Returns null if
2ronwalf * execution is not successful
2ronwalf */
2ronwalf public ValueMap execute(Process p, ValueMap bindings) throws Exception;
2ronwalf
2ronwalf /**
2ronwalf * Execute the given perform construct. Perform shoud contain all the necessary input
2ronwalf * bindings specified.
2ronwalf *
2ronwalf * @param perform
2ronwalf * @return
2ronwalf * @throws Exception
2ronwalf */
2ronwalf public ValueMap execute(Perform perform) throws Exception;
2ronwalf}