Package org.talend.transform.runtime.api

# Interface MapExecutionContext

public interface MapExecutionContext
Provides context for a single execution of a map.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`PROP_JAVA_INPUT_OBJECT`
The Java input object.
`static final String`
`PROP_RESULT_URL`
The URL associated with the Result of the execution context.
`static final String`
`PROP_SOURCE_URL`
The URL associated with the Source of the execution context.

## Method Summary

Modifier and Type
Method
Description
`void`
`addInputFile(String mapElemPath, File file)`
Sets the input file for the specified map element.
`void`
`addInputSource(String mapElemPath, Source source)`
Sets the input Source object for the specified map element.
`void`
`addInputUrl(String mapElemPath, String url)`
Sets the input URL for the specified map element.
`void`
`addOutputFile(String mapElemPath, File file)`
Sets the output file for the specified map element.
`void`
`addOutputResult(String mapElemPath, Result result)`
Sets the output Result for the specified map element.
`void`
`addOutputUrl(String mapElemPath, String url)`
Sets the output URL for the specified map element.
`Map<String,Object>`
`getExecutionProperties()`
Get the properties associated with this execution.
`ExecutionStatus`
`getExecutionStatus()`
Returns the execution results of the map.
`String`
`getExecutionStatusMap()`
Returns the path of the map set to process the `ExecutionStatus`.
`JavaMapReader`
`getJavaMapReader()`
Get the `JavaMapReader` to be used to process each `Map` object.
`MessageAdaptor`
`getMessageAdaptor()`
Gets the adaptor to be used to handle any Read/WriteMessage IO functions for this execution.
`Result`
`getResult()`
Returns the previously set Result object.
`Source`
`getSource()`
Returns the previously set Source object.
`void`
`setExecutionProperties(Map<String,Object> executionProperties)`
Set the properties associated with this execution.
`void`
`setExecutionStatusMap(String path)`
Sets the map that is to be executed to process the `ExecutionStatus` for this execution.
`void`
`setMessageAdaptor(MessageAdaptor adaptor)`
Sets an adaptor to be used to handle any Read/WriteMessage IO functions for this execution.
`void`
`setOutputProperties(Properties outputProperties)`
Sets the output properties used when formatting XML
`void`
`setResult(Result result)`
Sets the Result object of the execution of the map.
`void`
`setSource(Source source)`
Sets the Source object of the execution of the map.
`void`
`setUseJavaMapReader(boolean useJavaMapReader)`
Set to true if you prefer to provide the input to the map using the JavaMapReader class.

## Field Details

### PROP_SOURCE_URL

static final String PROP_SOURCE_URL
The URL associated with the Source of the execution context.

See Also:
  - Constant Field Values

### PROP_RESULT_URL

static final String PROP_RESULT_URL
The URL associated with the Result of the execution context.

See Also:
  - Constant Field Values

### PROP_JAVA_INPUT_OBJECT

static final String PROP_JAVA_INPUT_OBJECT
The Java input object. Used as the possible first argument for calling Java functions.

See Also:
  - Constant Field Values

## Method Details

### getExecutionProperties

Map<String,Object> getExecutionProperties()
Get the properties associated with this execution. These properties can be used to communicate with the map (using the GetExecutionProperty function.

Returns:
  a Properties

### setExecutionProperties

void setExecutionProperties(Map<String,Object> executionProperties)
Set the properties associated with this execution. These properties can be used to communicate with the map (using the GetExecutionProperty function.

### getResult

Result getResult()
Returns the previously set Result object. This will be populated upon the execution of the map if not previously set.

### setResult

void setResult(Result result)
Sets the Result object of the execution of the map. This is typically where the output of the map is given (unless the map writes to files specified elsewhere). If this object is not set when the map executes, a Result object of the correct type will be set.

Parameters:
  `result` -

### getSource

Source getSource()
Returns the previously set Source object.

### setSource

void setSource(Source source)
Sets the Source object of the execution of the map. This is typically where the input of the map is given (unless the map reads from files specified elsewhere).

Parameters:
  `source` -

### getExecutionStatus

ExecutionStatus getExecutionStatus()
Returns the execution results of the map. The returned `ExecutionStatus` object contains the overall status, and `StatusItem` objects for any problems encounted in the map execution.

### setExecutionStatusMap

void setExecutionStatusMap(String path)
Sets the map that is to be executed to process the `ExecutionStatus` for this execution.

Parameters:
  `path` - the path of the map to process the execution status. Follows the same path rules as {@link RuntimeEngine.getMapRuntime()}.

### getExecutionStatusMap

String getExecutionStatusMap()
Returns the path of the map set to process the `ExecutionStatus`. @see setExecutionStatusMap().

Returns:
  the path of the map

### addInputUrl

void addInputUrl(String mapElemPath, String url)
Sets the input URL for the specified map element. This is used when reading from multiple files in a map execution.

Parameters:
  `mapElemPath` -
  `url` -

### addInputFile

void addInputFile(String mapElemPath, File file)
Sets the input file for the specified map element. This is used when reading from multiple files in a map execution.

Parameters:
  `mapElemPath` -
  `file` -

### addInputSource

void addInputSource(String mapElemPath, Source source)
Sets the input Source object for the specified map element. This is used when reading from multiple Source objects (like Java objects) in a map execution.

Parameters:
  `mapElemPath` -
  `source` -

### addOutputUrl

void addOutputUrl(String mapElemPath, String url)
Sets the output URL for the specified map element. This is used when writing to multiple files in a map execution.

Parameters:
  `mapElemPath` -
  `url` -

### addOutputFile

void addOutputFile(String mapElemPath, File file)
Sets the output file for the specified map element. This is used when writing to multiple files in a map execution.

Parameters:
  `mapElemPath` -
  `file` -

### addOutputResult

void addOutputResult(String mapElemPath, Result result)
Sets the output Result for the specified map element. This is used when writing to multiple Result objects (like for Java) in a map execution.

Parameters:
  `mapElemPath` -
  `result` -

### setMessageAdaptor

void setMessageAdaptor(MessageAdaptor adaptor)
Sets an adaptor to be used to handle any Read/WriteMessage IO functions for this execution.

Parameters:
  `adaptor` -

### getMessageAdaptor

MessageAdaptor getMessageAdaptor()
Gets the adaptor to be used to handle any Read/WriteMessage IO functions for this execution.

Returns:
  the adaptor

### setUseJavaMapReader

void setUseJavaMapReader(boolean useJavaMapReader)
Set to true if you prefer to provide the input to the map using the JavaMapReader class. If this is true, then the call to execute the map will return immediately and the JavaMapReader object will be available at `getJavaMapReader()`.

Parameters:
  `useJavaMapReader` -

### getJavaMapReader

JavaMapReader getJavaMapReader()
Get the `JavaMapReader` to be used to process each `Map` object.

Returns:
  a JavaMapReader

### setOutputProperties

void setOutputProperties(Properties outputProperties)
Sets the output properties used when formatting XML

Parameters:
  `outputProperties` -