Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.9.0)
E15995-08


oracle.wcps.conductor.services
Interface IScenariosService


public interface IScenariosService

Service for management and execution of scenarios.


Method Summary
 IScenarioStatement createScenario(ClientContext clientContext, IScenarioStatement statement)
          Creates a new scenario definition
 void deleteScenario(ClientContext clientContext, java.lang.String scenarioName)
          Deletes a scenario by name.
 java.lang.Object executeScenario(ClientContext clientContext, java.lang.String scenarioName, java.util.Map<java.lang.String,?> parameters)
          Executes a scenario by name.
 void exportScenario(ClientContext clientContext, java.lang.String directoryPath, java.lang.String scenarioName)
          Exports a scenario by name for a given namespace to the specified directory.
 IScenarioDebugService getDebugService()
          Returns an instance of the debug service for scenario debugging.
 IScenarioStatement getScenario(ClientContext clientContext, java.lang.String scenarioName)
          Retrieves a scenario by name.
 java.util.List<IScenarioStatement> getScenarios(ClientContext clientContext)
          Retrieves the collection of scenarios for the specified namespace (in ClientContext).
 java.util.List<IScenarioStatement> getScenariosByTag(ClientContext clientContext, java.lang.String tag)
          Retrieves the collection of scenarios for the specified namespace (in ClientContext) and tag.
 IStatementFactory getStatementFactory()
          Returns the statement factory for constructing scenario statements.
 IScenarioStatement importScenario(ClientContext clientContext, java.io.File file)
          Imports a scenario definition based on the provided file.
 IScenarioStatement importScenario(ClientContext clientContext, java.net.URL url)
          Imports a scenario definition based on the provided URL.
 void renameScenario(ClientContext clientContext, java.lang.String oldName, java.lang.String newName)
          Renames an existing scenario.
 IScenarioStatement saveScenario(ClientContext clientContext, IScenarioStatement statement)
          Saves an existing scenario definition.
 IScenarioStatement validateScenario(ClientContext clientContext, IScenarioStatement scenario, boolean throwException)
          Validates the provided scenario.

 

Method Detail

getStatementFactory

IStatementFactory getStatementFactory()
Returns the statement factory for constructing scenario statements.
Returns:
the statement factory.

getScenario

IScenarioStatement getScenario(ClientContext clientContext,
                               java.lang.String scenarioName)
                               throws ConductorException
Retrieves a scenario by name.
Parameters:
clientContext - The client context to use for namespace, localization, etc.
scenarioName - The scenario name to retrieve
Returns:
The scenario definition, if it exists.
Throws:
ConductorException - if the named scenario does not exist or a persistence error is encountered.

saveScenario

IScenarioStatement saveScenario(ClientContext clientContext,
                                IScenarioStatement statement)
                                throws ConductorException
Saves an existing scenario definition.
Parameters:
clientContext - The client context to use for namespace, localization, etc.
statement - The scenario definition
Returns:
The updated scenario definition, if successful.
Throws:
ConductorException - if the specified scenario does not exist or a persistence error is encountered. If scenario has validation errors the save might be successful, depending on the error; however, the scenario cannot be executed and it's status will be set to DRAFT.

createScenario

IScenarioStatement createScenario(ClientContext clientContext,
                                  IScenarioStatement statement)
                                  throws ConductorException
Creates a new scenario definition
Parameters:
clientContext - The client context to use for namespace, localization, etc.
statement - The scenario definition
Returns:
The new scenario definition, if successful.
Throws:
ConductorException - if the specified named scenario already exists or a persistence error is encountered. If scenario has validation errors the save might be successful, depending on the error; however, the scenario cannot be executed and it's status will be set to DRAFT.

deleteScenario

void deleteScenario(ClientContext clientContext,
                    java.lang.String scenarioName)
                    throws ConductorException
Deletes a scenario by name.
Parameters:
clientContext - The client context to use for namespace, localization, etc.
scenarioName - The scenario name to delete.
Throws:
ConductorException - if the specified scenario name does not exist or a persistence error is encountered

getScenarios

java.util.List<IScenarioStatement> getScenarios(ClientContext clientContext)
                                                throws ConductorException
Retrieves the collection of scenarios for the specified namespace (in ClientContext).
Parameters:
clientContext - The client context to use for namespace, localization, pagination, etc.
Returns:
A list of summarized scenario metadata.
Throws:
ConductorException - if a persistence error is encountered

getScenariosByTag

java.util.List<IScenarioStatement> getScenariosByTag(ClientContext clientContext,
                                                     java.lang.String tag)
                                                     throws ConductorException
Retrieves the collection of scenarios for the specified namespace (in ClientContext) and tag.
Parameters:
clientContext - The client context to use for namespace, localization, pagination, etc.
tag - The tag to search for.
Returns:
A list of summarized scenario metadata.
Throws:
ConductorException - if a persistence error is encountered

renameScenario

void renameScenario(ClientContext clientContext,
                    java.lang.String oldName,
                    java.lang.String newName)
                    throws ConductorException
Renames an existing scenario.
Parameters:
clientContext - The client context to use for namespace, localization, etc.
oldName - The current scenario name.
newName - The new name of the scenario.
Throws:
ConductorException - if a scenario specified by new name already exists, if a scenario specified by old name does not exist, or a persistence error is encountered.

executeScenario

java.lang.Object executeScenario(ClientContext clientContext,
                                 java.lang.String scenarioName,
                                 java.util.Map<java.lang.String,?> parameters)
                                 throws ConductorException
Executes a scenario by name.
Parameters:
clientContext - The client context to use for namespace, localization, etc.
scenarioName - The named scenario to execute.
parameters - Parameters to be used as input parameters to the scenario.
Returns:
The scenario results.
Throws:
ConductorException - if the specified scenario name does not exist, the specified scenario is not runnable or a persistence error is encountered.

getDebugService

IScenarioDebugService getDebugService()
Returns an instance of the debug service for scenario debugging.
Returns:
An instance of the scenario debugger.

validateScenario

IScenarioStatement validateScenario(ClientContext clientContext,
                                    IScenarioStatement scenario,
                                    boolean throwException)
                                    throws ScenarioValidationException
Validates the provided scenario.
Parameters:
clientContext - The client context to use for namespace, localization, etc.
scenario - The scenario definition to validate.
throwException - Indicates that an exception should be thrown if there are validation errors.
Returns:
The scenario definition. If validation errors are present, the scenario definition will be marked up with the statement(s) that violate the validation.
Throws:
ScenarioValidationException - if scenario has validation errors. TODO remove throwException parameter. ScenarioValidationException is a checked exception, not optional.

importScenario

IScenarioStatement importScenario(ClientContext clientContext,
                                  java.net.URL url)
                                  throws ConductorException
Imports a scenario definition based on the provided URL.

If the scenario definition does not exist (by scenario name), it will be created. If the scenario definition does exist, it will be overwritten with the new scenario definition.

Only XML scenario definitions are currently supported.

Parameters:
clientContext - The client context to use for namespace, localization, etc.
url - The url to the scenario definition in XML.
Returns:
The imported scenario definition if successful.
Throws:
ConductorException - if the scenario already exists, scenario has validation errors or a persistence error is encountered

importScenario

IScenarioStatement importScenario(ClientContext clientContext,
                                  java.io.File file)
                                  throws ConductorException
Imports a scenario definition based on the provided file.

If the scenario definition does not exist (by scenario name), it will be created. If the scenario definition does exist, it will be overwritten with the new scenario definition.

Only XML scenario definitions are currently supported.

Parameters:
clientContext - The client context to use for namespace, localization, etc.
file - The file to the scenario definition in XML.
Returns:
The imported scenario definition if successful.
Throws:
ConductorException - if the scenario already exists, scenario has validation errors or a persistence error is encountered

exportScenario

void exportScenario(ClientContext clientContext,
                    java.lang.String directoryPath,
                    java.lang.String scenarioName)
                    throws ConductorException
Exports a scenario by name for a given namespace to the specified directory.

The format of the scenario will be in XML.

Parameters:
clientContext - The client context to use for namespace, localization, etc.
directoryPath - The directory path to export the scenario to.
scenarioName - The name of the scenario to export.
Throws:
ConductorException - if the specified directory path does not exist, or is not a directory, scenario has validation errors or a persistence error is encountered

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.9.0)
E15995-08


Copyright © 2009, 2014, Oracle and/or its affiliates. All rights reserved.