public interface IRuntimeContext extends IAuditable, ILogger
Modifier and Type | Field and Description |
---|---|
static String |
FEEDBACK_OUTPUT
Unused
|
static int |
PARAMETERS_FAIL
Currently only used as an indicator that BIRT report specification parameters could not be read.
|
static int |
PARAMETERS_OK
Currently only used as an indicator that BIRT report specification parameters could be read properly.
|
static int |
PARAMETERS_UI_NEEDED
Indicates that parameters are required by an action, and the parameters aren't available so they need to be
prompted for.
|
static int |
PROMPT_NO
Indicates that no parameter prompts are pending.
|
static int |
PROMPT_NOW
Indicates that we need to prompt immediately for parameters.
|
static int |
PROMPT_WAITING
Indicates that parameter prompts are pending.
|
static int |
RUNTIME_CONTEXT_RESOLVE_FAIL
Indicates that parameters for an action could not be resolved.
|
static int |
RUNTIME_CONTEXT_RESOLVE_OK
Indicates that the parameters for an action were able to be resolved.
|
static int |
RUNTIME_CONTEXT_VALIDATE_FAIL
Indicator of action validation failure
|
static int |
RUNTIME_CONTEXT_VALIDATE_OK
Indicator of action validation success
|
static int |
RUNTIME_STATUS_FAILURE
Indicator of action failure.
|
static int |
RUNTIME_STATUS_INITIALIZE_FAIL
Indicator of initialization failure
|
static int |
RUNTIME_STATUS_INITIALIZE_OK
Indicator that initialization happened successfully
|
static int |
RUNTIME_STATUS_NOT_STARTED
When beginning execution of an action sequence, the status starts off as not started.
|
static int |
RUNTIME_STATUS_RUNNING
As an action sequence begins execution, the status is set to running.
|
static int |
RUNTIME_STATUS_SETUP_FAIL
Indicates an invalid instance ID was passed into the execution of an action sequence
|
static int |
RUNTIME_STATUS_SUCCESS
Indicates that the action executed successfully
|
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
Modifier and Type | Method and Description |
---|---|
void |
addInputParameter(String name,
IActionParameter param)
Adds an input parameter to the list of all inputs for the action sequence
|
void |
addTempParameter(String name,
IActionParameter output)
Adds a parameter to the current inputs.
|
String |
applyInputsToFormat(String format)
Does parameter substitution on the input string, searching for all parameter declarations in the input string,
and substituting the value from the matching input parameter.
|
String |
applyInputsToFormat(String format,
IParameterResolver resolver)
Does parameter substitution on the input string, searching for all parameter declarations in the input string,
and substituting the value from the matching input parameter.
|
void |
audit(String messageType,
String message,
String value,
long duration)
Writes a message to the audit log.
|
void |
createFeedbackParameter(IActionParameter actionParam)
Deprecated.
Adds a feedback parameter for prompts based on an Action Parameter. Uses the Selections defined in
the Action Parameter for the options and sets the default to the current value
|
void |
createFeedbackParameter(ISelectionMapper selMap,
String fieldName,
Object defaultValues)
Adds a feedback parameter (essentially a form input field) for a required input.
|
void |
createFeedbackParameter(ISelectionMapper selMap,
String fieldName,
Object defaults,
boolean optional)
Adds a feedback parameter (essentially a form input field) for a required input.
|
void |
createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValue,
boolean visible)
Adds a scalar feedback parameter
|
void |
createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValue,
boolean visible,
boolean optional)
Adds a scalar feedback parameter
|
void |
createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValues,
List values,
Map dispNames,
String displayStyle)
Creates a feedback parameter that uses a list for the values
|
void |
createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValues,
List values,
Map dispNames,
String displayStyle,
boolean optional)
Creates a feedback parameter that uses a list for the values
|
String |
createNewInstance(boolean persisted)
Creates a new runtime context that is a child of this instance
|
String |
createNewInstance(boolean persisted,
Map parameters)
Creates a new runtime context that is a child of this instance and sets attributes of the runtime data from
the parameter Map
|
String |
createNewInstance(boolean persisted,
Map parameters,
boolean forceImmediateWrite)
Creates a new runtime context that is a child of this instance and sets attributes of the runtime data from
the parameter Map, and can optionally cause the new instance to be forcibly written to the underlying
persistence mechanism.
|
void |
dispose() |
void |
dispose(List exceptParameters) |
void |
executeSequence(IActionCompleteListener listener,
IExecutionListener execListener,
boolean async)
Executes the action sequence.
|
boolean |
feedbackAllowed() |
void |
forceSaveRuntimeData()
Forces the immediate write of runtime data to underlying persistence mechanism.
|
IActionSequence |
getActionSequence() |
String |
getActionTitle()
During execution of an action sequence, returns the IActionSequence#getTitle().
|
String |
getCurrentComponentName() |
org.pentaho.commons.connection.IPentahoStreamSource |
getDataSource(String parameterName)
Get's the content item associated with the parameter, and returns the content item's datasource
|
IContentItem |
getFeedbackContentItem()
Interfaces to the current output handler to get the content item that is handling feedback (i.e.
|
String |
getHandle()
Returns the unique context identifier.
|
Set |
getInputNames() |
IActionParameter |
getInputParameter(String name)
Returns the named input parameter.
|
String |
getInputParameterStringValue(String name)
Gets the value of the specified input parameter as a
String . |
Object |
getInputParameterValue(String name)
Gets the value of the specified input parameter.
|
InputStream |
getInputStream(String parameterName)
Returns an input stream from an input parameter, if the input parameter is a content item.
|
String |
getInstanceId()
Returns the unique execution instance.
|
List |
getMessages() |
IContentItem |
getOutputContentItem(String mimeType)
Interfaces to the current output handler to get the content item that describes the output from this request's
component execution.
|
IContentItem |
getOutputContentItem(String outputName,
String mimeType)
Interfaces to the current output handler to get the named content item from this request's component
execution.
|
List<IContentItem> |
getOutputContentItems()
Interfaces to the current context to get the content items which was generated
|
IContentItem |
getOutputItem(String outputName,
String mimeType,
String extension)
Returns an output stream for writing.
|
Set |
getOutputNames() |
IActionParameter |
getOutputParameter(String name)
Returns the named output parameter.
|
int |
getOutputPreference()
Gets the output type prefered by the handler.
|
IParameterManager |
getParameterManager() |
Map |
getParameterProviders() |
org.dom4j.Document |
getResourceAsDocument(IActionSequenceResource actionParameter)
Gets the named resource as a Document.
|
String |
getResourceAsString(IActionSequenceResource actionParameter)
Gets the named resource as a String.
|
org.pentaho.commons.connection.IPentahoStreamSource |
getResourceDataSource(IActionSequenceResource actionResource)
Gets the named resource as a DataSource.
|
IActionSequenceResource |
getResourceDefintion(String name)
Gets the named resource definition from the executing action sequence.
|
InputStream |
getResourceInputStream(IActionSequenceResource actionResource)
Gets the named resource as an InputStream.
|
Set |
getResourceNames() |
IPentahoSession |
getSession() |
String |
getSolutionPath() |
int |
getStatus() |
IPentahoUrlFactory |
getUrlFactory()
The Url Factory is used for building URL's that link to this or another application
|
boolean |
isPromptPending()
Tells if a component is waiting for a prompt
|
void |
promptNeeded()
Sets the prompt flag but continue processing Actions
|
void |
promptNow()
Forces the runtime to stop processing Actions and return to prompt
|
void |
sendFeedbackForm()
Generates a parameter acquisition form for required parameters.
|
void |
setActionSequence(IActionSequence actionSequence)
Sets the current action sequence
|
void |
setCreateFeedbackParameterCallback(ICreateFeedbackParameterCallback callback) |
void |
setOutputHandler(IOutputHandler outputHandler)
Sets the output handler for the runtime context
|
void |
setOutputValue(String name,
Object output)
Sets the value of a named output parameter
|
void |
setParameterTarget(String target)
Sets the target window that the content will be displayed in.
|
void |
setParameterXsl(String xsl)
Sets the xsl file to be used to generate the parameter page for the current component.
|
void |
setPromptStatus(int status)
Sets the default prompt status PROMPT_NO, PROMPT_WAITING, PROMPT_NOW
|
void |
validateSequence(String sequenceName,
IExecutionListener execListener)
Validates the action sequence for consistency
|
getActionName, getId, getObjectName, getProcessId
static final String FEEDBACK_OUTPUT
static final int RUNTIME_CONTEXT_VALIDATE_FAIL
static final int RUNTIME_CONTEXT_VALIDATE_OK
static final int RUNTIME_CONTEXT_RESOLVE_OK
static final int RUNTIME_CONTEXT_RESOLVE_FAIL
static final int RUNTIME_STATUS_NOT_STARTED
static final int RUNTIME_STATUS_INITIALIZE_OK
static final int RUNTIME_STATUS_INITIALIZE_FAIL
static final int RUNTIME_STATUS_RUNNING
static final int RUNTIME_STATUS_SUCCESS
static final int RUNTIME_STATUS_FAILURE
static final int RUNTIME_STATUS_SETUP_FAIL
static final int PARAMETERS_FAIL
static final int PARAMETERS_OK
static final int PARAMETERS_UI_NEEDED
static final int PROMPT_NO
static final int PROMPT_WAITING
static final int PROMPT_NOW
String getHandle()
RuntimeContext
object, and should be unique down to the date/time of construction. The default
form of this as implemented in RuntimeContext includes context- plus the hashcode and the date/time.RuntimeContext
String getActionTitle()
IActionSequence#getSequenceTitle()
void promptNow()
void promptNeeded()
boolean isPromptPending()
String getInstanceId()
void setActionSequence(IActionSequence actionSequence)
actionSequence
- The action sequence to validateIActionSequence getActionSequence()
void validateSequence(String sequenceName, IExecutionListener execListener) throws ActionValidationException
sequenceName
- The name of the sequence to validateIllegalStateException
ActionSequenceException
ActionValidationException
void executeSequence(IActionCompleteListener listener, IExecutionListener execListener, boolean async) throws ActionSequenceException
listener
- The listener to be notified when the sequence finishesasync
- Whether the action is synchronous or asynchronous.ActionSequenceException
RUNTIME_STATUS_FAILURE
,
RUNTIME_STATUS_SUCCESS
IPentahoUrlFactory getUrlFactory()
String getSolutionPath()
String getCurrentComponentName()
IPentahoSession getSession()
void audit(String messageType, String message, String value, long duration)
messageType
- Message type as defined in MessageTypesmessage
- Message to appear in the logvalue
- Value of an object to be logged.duration
- For time-tracked execution paths, indicates the duration the task tookIAuditEntry
,
IAuditable
,
org.pentaho.core.audit.MessageTypes
IActionParameter getInputParameter(String name)
null
name
- The name of the parameter to getorg.pentaho.platform.api.engine.services.IParameterProvider
IActionParameter getOutputParameter(String name)
null
name
- The name of the parameter to getorg.pentaho.platform.api.engine.services.IParameterProvider
IActionSequenceResource getResourceDefintion(String name)
null
name
- The named resource to getIActionSequenceResource
Object getInputParameterValue(String name)
null
name
- The named parameter to retrieveIActionParameter
String getInputParameterStringValue(String name)
String
. Throws a
NullPointerException if the parameter is not found. This method never returns null
name
- The named parameter to retrieveIActionParameter
InputStream getResourceInputStream(IActionSequenceResource actionResource) throws FileNotFoundException
actionResource
- The resource to get from the SolutionRepository
InputStream
that contains the resource.FileNotFoundException
org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource) throws FileNotFoundException
actionResource
- The resource to get from the SolutionRepository
DataSource
FileNotFoundException
String getResourceAsString(IActionSequenceResource actionParameter) throws IOException
actionResource
- The resource to get from the SolutionRepository
String
IOException
org.dom4j.Document getResourceAsDocument(IActionSequenceResource actionParameter) throws IOException, org.dom4j.DocumentException
actionResource
- The resource to get from the SolutionRepository
DataSource
IOException
org.dom4j.DocumentException
void setOutputValue(String name, Object output)
name
- The name of the output parameteroutput
- The value to set the output parameter tovoid addTempParameter(String name, IActionParameter output)
name
- The name of the temporary parameteroutput
- The value to set the temporary parameter toIContentItem getOutputItem(String outputName, String mimeType, String extension)
outputName
- The name of the outputmimeType
- The mime type of the outputextension
- The file extension of the outputInputStream getInputStream(String parameterName)
parameterName
- The name of the parameterorg.pentaho.commons.connection.IPentahoStreamSource getDataSource(String parameterName)
parameterName
- The name of the parameterIContentItem.getDataSource()
Set getInputNames()
Set getResourceNames()
Set getOutputNames()
String applyInputsToFormat(String format)
format
- The string containing possible parameter referencesString applyInputsToFormat(String format, IParameterResolver resolver)
format
- The string containing possible parameter referencesResolver
- for parameters for overriding behaviorvoid addInputParameter(String name, IActionParameter param)
name
- The name of the parameter (the key to the parameter map)param
- The parameter to addIActionParameter
boolean feedbackAllowed()
IContentItem getFeedbackContentItem()
IContentItem
,
IOutputHandler
List<IContentItem> getOutputContentItems()
IContentItem
IContentItem getOutputContentItem(String mimeType)
IContentItem
,
IOutputHandler
IContentItem getOutputContentItem(String outputName, String mimeType)
outputName
- the name of the outputIContentItem
,
IOutputHandler
void sendFeedbackForm() throws ActionSequencePromptException
ActionSequenceException
ActionSequencePromptException
IOutputHandler
void setCreateFeedbackParameterCallback(ICreateFeedbackParameterCallback callback)
@Deprecated void createFeedbackParameter(IActionParameter actionParam)
actionParam
- The Action Parameter to use as the model for the promptvoid createFeedbackParameter(ISelectionMapper selMap, String fieldName, Object defaultValues)
selMap
- Maps IPentahoResultSet
objects to selection objectsfieldName
- Name of the form fielddefaultValues
- default values for the input fieldSelectionMapper
void createFeedbackParameter(ISelectionMapper selMap, String fieldName, Object defaults, boolean optional)
selMap
- Maps IPentahoResultSet
objects to selection objectsfieldName
- Name of the form fielddefaults
- default values for the input fieldoptional
- specifies if the feedback parameter is required or notSelectionMapper
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible)
fieldName
- Name of the input fielddisplayName
- display name of the input fieldhint
- Fly-over hint for the input fielddefaultValue
- Default value for the input fieldvisible
- Whether the input field is visible or notXForm
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible, boolean optional)
fieldName
- Name of the input fielddisplayName
- display name of the input fieldhint
- Fly-over hint for the input fielddefaultValue
- Default value for the input fieldvisible
- Whether the input field is visible or notoptional
- specifies if the feedback parameter is required or notXForm
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle)
fieldName
- The name of the fielddisplayName
- Display namehint
- Fly-over hint for the input fielddefaultValues
- Default value of the input fieldvalues
- List of valuesdispNames
- Map of display namesdisplayStyle
- how to display the controlXForm
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle, boolean optional)
fieldName
- The name of the fielddisplayName
- Display namehint
- Fly-over hint for the input fielddefaultValues
- Default value of the input fieldvalues
- List of valuesdispNames
- Map of display namesdisplayStyle
- how to display the controlXForm
int getStatus()
List getMessages()
String createNewInstance(boolean persisted)
persisted
- Should the runtime data be persistedString createNewInstance(boolean persisted, Map parameters)
persisted
- Should the runtime data be persistedparameters
- parameters for the new instanceString createNewInstance(boolean persisted, Map parameters, boolean forceImmediateWrite)
persisted
- Should the runtime data be persistedparameters
- parameters for the new instanceforceImmediateWrite
- if true, will call the new runtime element's forceSave method before returning.void dispose()
void dispose(List exceptParameters)
void setParameterXsl(String xsl)
xsl
- The name of the XSL filevoid setParameterTarget(String target)
target
- Window namevoid forceSaveRuntimeData()
int getOutputPreference()
void setOutputHandler(IOutputHandler outputHandler)
outputHandler
- The output handlervoid setPromptStatus(int status)
status
- IParameterManager getParameterManager()
Map getParameterProviders()
Copyright © 2020 Hitachi Vantara. All rights reserved.