public interface IExecutionContext
Execution contexts are mostly created by AWM when:
memory map, which contains returned output parameters. These
parameters can then be used by subsequent tools.
An execution context instance is only used once for most executed actions. The only exceptions are edit scenarios with related save- and close actions. If an editor is opened by an AWM tool, the execution context is mapped to the editor using a TaurusEditorPart. Executed save- and close- actions will be able to reuse the context from the action that opened he editor.
Mass processing actions create a single main execution context
and one sub-context for each selected element. The sub-contexts can be
acquired by getMassProcessingContexts().
It's possible to instantiate a new execution context using
TaurusFactory.createExecutionContext(ISystemImage). It's recommended
to initialize the context using initContext(IResource) or
initContext(List).
Not intended to be implemented by clients.
ActionExecutor,
IToolExecutor| Modifier and Type | Method and Description |
|---|---|
void |
addParmForOutputDialog(RToolOutParameter pOutParm)
Parameters added to the ExecutionContext by this Method will be shown in
an output dialog at the end of an Action.
|
void |
addResource(IResource pRes,
java.lang.String pName)
Adds an
IResource with the given name. |
void |
addResourceToMemory(IResource pResource)
Deprecated.
use
getMassProcessingContexts() instead to add sub
contexts. |
void |
addToolExecStatus(ToolExecutionStatus pToolStatus)
Adds a tool execution status to the list of statuses.
|
IExecutionContext |
duplicate()
Duplicates this execution context, including the following information:
Context parameters
Memory (previous tool) parameters
Context Resource
TAURUS System
|
java.util.Map<Property,IPropertyValue> |
getActionContextMap()
Receives a map with all Properties which have been created based on a
resource and/or manually added Properties.
|
ActionDescriptor |
getActionDescriptor()
Gets the
ActionDescriptor of the context. |
java.util.List<IResource> |
getContextResources()
Returns a list of context resources.
|
FileDescriptor |
getFileFromContext(FileDescriptor pFileDescr)
Retrieves a FileDescriptor from the context map.
|
FileDescriptor |
getFileFromMemory(java.lang.String fileDescrID)
Retrieves a FileDescriptor from the context memory Map.
|
java.util.Map<java.lang.String,FileDescriptor> |
getFileMemory()
Gets the file memory which contains file descriptors with resolved
physical names which were returned by previous tools of an action.
|
java.util.ArrayList<IExecutionContext> |
getMassProcessingContexts()
Returns a list of execution contexts for every resource that is being
processed by a mass processing action.
|
java.util.List<IResource> |
getMemoryResources()
Deprecated.
Use
getMassProcessingContexts() instead |
java.util.Map<Property,IPropertyValue> |
getParameterMemoryMap()
Receives a map with all Properties which have been saved in the context.
|
IPropertyValue |
getParmFromContext(Property pKey)
Receives a Property from the ExecutionContext.
|
IPropertyValue |
getParmFromMemory(Property pKey)
Retrieves a parameter Property from a map where previous tools might have
stored their output parameter Properties.
|
java.util.List<RToolOutParameter> |
getParmsForOutputDialog()
Returns a List of
RToolOutParameters, which have the
attribute To_OutputDialog set to true. |
IResource |
getResource()
Receives the resource which is assigned to this context.
|
IResource |
getResource(java.lang.String pName)
Returns the
IResource with the given name, which has been added
to the context by a resource operation (tool defined resource
processing). |
IExecutionContext |
getResourceContext(java.lang.String pResourceName)
Returns the
IExecutionContext of a resource with a logical name. |
ISystemImage |
getSystemImage()
Gets the
ISystemImage the context is connected with. |
java.util.List<ToolExecutionStatus> |
getToolExecStatusList()
Gets a list of tool execution statuses.
|
IExecutionContext |
initContext(IResource pRes)
Initializes the IExecutionContext from the given resource.
|
IExecutionContext |
initContext(java.util.List<IResource> pResources)
Initializes the IExecutionContext from the list of resources.
|
void |
populateContext(IResource pRes)
Deprecated.
use
getActionContextMap() and
IResource.getAllPropertyValues() to add the
properties directly to the context or
initContext(IResource) to add a the whole resource
context (including parent properties) to this execution
context. |
void |
putFileParmIntoMemory(FileDescriptor pFileDescriptor)
Puts a File Descriptor in the execution memory.
|
void |
putParmIntoContext(Property pProp,
IPropertyValue pPropValue)
Manually puts a Property into the context Map.
|
void |
putParmIntoMemory(Property pProp,
IPropertyValue pPropValue)
Puts a parameter Property into a map, providing them to following tools
during the execution.
|
void |
setActionContext(java.util.Map<Property,IPropertyValue> pActionContext)
Set the action context of the execution context.
|
void |
setContextResources(java.util.List<IResource> pContextResources)
Sets the context resources for mass processing.
|
void |
setFileMemory(java.util.Map<java.lang.String,FileDescriptor> pFileMemory)
Completely sets the file memory of this context.
|
void |
setParmMemory(java.util.Map<Property,IPropertyValue> pParmMemory)
Set the parameter memory of the execution context.
|
void |
setResource(IResource pResource)
Sets the resource of this context.
|
void addParmForOutputDialog(RToolOutParameter pOutParm)
pOutParm - The RToolOutParameter or
RToolFileOutput to be shown in an output dialog.java.util.Map<Property,IPropertyValue> getActionContextMap()
FileDescriptor getFileFromMemory(java.lang.String fileDescrID) throws TaurusToolException
Usually this will be used when the NamePhysical or the
Type attributes of a FileDescriptor were changed by a
previous tool.
fileDescrID - The ID of the desired FileDescriptorTaurusToolException - if the FileDescriptor does not exist within the parameter
memory.FileDescriptor getFileFromContext(FileDescriptor pFileDescr) throws TaurusToolException
pFileDescr - The ID of the desired FileDescriptorTaurusToolException - if the FileDescriptor does not exist within the context.java.util.Map<Property,IPropertyValue> getParameterMemoryMap()
IPropertyValue getParmFromContext(Property pKey) throws TaurusToolException
initContext(IResource) method.
Properties could have also been added by the
putParmIntoContext(Property, IPropertyValue) method.
pKey - The desired PropertyTaurusToolException - if no value for the property was found in the context.IPropertyValue getParmFromMemory(Property pKey) throws TaurusToolException
pKey - The Property which should be retrievedTaurusToolException - if no value for the property was found in the memory.java.util.List<RToolOutParameter> getParmsForOutputDialog()
RToolOutParameters, which have the
attribute To_OutputDialog set to true.IResource getResource()
IExecutionContext initContext(IResource pRes)
pRes - The resource which shall be used to initialize the
ExecutionContextIExecutionContext initContext(java.util.List<IResource> pResources)
getMassProcessingContexts(). Internally calls
initContext(IResource) for every given resource.
pResources - A list of IResources.void putParmIntoContext(Property pProp, IPropertyValue pPropValue)
initContext(IResource) method should provide all necessary
Properties from the given resource.pProp - The Property which shall be stored in the contextpPropValue - The corresponding IPropertyValuevoid putParmIntoMemory(Property pProp, IPropertyValue pPropValue)
pProp - The Property which an output parameter was pointing topPropValue - The corresponding IPropertyValuevoid setResource(IResource pResource)
pResource - The IResource which shall be assigned to the contextvoid setActionContext(java.util.Map<Property,IPropertyValue> pActionContext)
pActionContext - action context to be set in the execution contextvoid setParmMemory(java.util.Map<Property,IPropertyValue> pParmMemory)
pParmMemory - parameter memory to be set in the execution contextIResource getResource(java.lang.String pName)
IResource with the given name, which has been added
to the context by a resource operation (tool defined resource
processing).pName - The logical name of the desired resourceToolDescriptor.getResourceProcessing()void addResource(IResource pRes, java.lang.String pName)
IResource with the given name. This should be done if a
tool defined resource operation was executed.pRes - The resource to be addedpName - The logical name of the resource@Deprecated void populateContext(IResource pRes)
getActionContextMap() and
IResource.getAllPropertyValues() to add the
properties directly to the context or
initContext(IResource) to add a the whole resource
context (including parent properties) to this execution
context.pRes - the IResource which should be use to populate the
context.ActionDescriptor getActionDescriptor()
ActionDescriptor of the context. Note that a context can
be created without an action descriptor so this method can return
null.null.java.util.List<ToolExecutionStatus> getToolExecStatusList()
null.void addToolExecStatus(ToolExecutionStatus pToolStatus)
pToolStatus - the new tool execution status to be added.ISystemImage getSystemImage()
ISystemImage the context is connected with. Note that
the context does not need to use the system image, but it is recommended
to always add an image for other callers to be used.ISystemImage. Can be null.java.util.Map<java.lang.String,FileDescriptor> getFileMemory()
void setFileMemory(java.util.Map<java.lang.String,FileDescriptor> pFileMemory)
pFileMemory - the new file memory map.getFileMemory(),
getFileFromMemory(String)void putFileParmIntoMemory(FileDescriptor pFileDescriptor)
pFileDescriptor - The FileDescriptor which shall be stored in the parameter
memoryIExecutionContext duplicate()
IExecutionContext getResourceContext(java.lang.String pResourceName)
IExecutionContext of a resource with a logical name.
The logical name comes from TOOL-DEFINED resource operations.pResourceName - the logical name of a resourceIExecutionContext of the resource or
null if no resource with that name was foundvoid setContextResources(java.util.List<IResource> pContextResources)
pContextResources - a list of resources, typically all elements which are selected
for a multi selection action. Must not be null.ActionDescriptor.isMassProcessing()java.util.List<IResource> getContextResources()
null unless
setContextResources(List) was called with null as
parameter.@Deprecated java.util.List<IResource> getMemoryResources()
getMassProcessingContexts() insteadaddResourceToMemory(IResource)@Deprecated void addResourceToMemory(IResource pResource)
getMassProcessingContexts() instead to add sub
contexts.pResource - the resource to be added in the memorygetMemoryResources()java.util.ArrayList<IExecutionContext> getMassProcessingContexts()
getMassProcessingContexts() on any of the contained
contexts will always return an empty list.Copyright © 2015 Micro Focus GmbH. All rights reserved.