User Community Service Desk Downloads
If you can't find the product or version you're looking for, visit support.ataccama.com/downloads

Executor

Executor is a configuration file that lets you define task listeners that can perform actions (for example, call an external application) when the executor starts or finishes a task (load, export, processDelta call).

nme-executor.xml

<executorConfig>
    <taskListeners>
        ...
    </taskListeners>
</executorConfig>

Executor Task Listeners

Task listeners allow executing custom code when a task status changes (task is enqueued, started, aborted, finished, failed). Every task listener has following parameters (code fragments executed or templates used when the state of the task changes accordingly):

  • whenEnqueued - Task is put to queue and is waiting.

  • whenStarted - Task is started.

  • whenSucceeded - Task was successfully completed.

  • whenFailed - Task failed.

  • whenAborted - Task was aborted.

In parameters above, following information about task is available (every listener has it own syntax how to refer to these variables):

  • TASK_ID - Numeric task ID visible in the console.

  • TASK_TYPE_ID - String ID of the task, "batchLoad.system1_full".

  • TASK_NAME - Human readable task name, "Batch load system1_full".

  • ERROR_MESSAGE - Error message, empty string if no error occured.

  • TP_transactionId - All task properties in format TP_propertyName, are available only in whenSucceeded, whenFailed, whenAborted.

    • transactionId is always defined, other properties may be defined in batch operation or passed through service call.

WorkflowTaskListener

WorkflowTaskListener allows running eWF workflows. Additional information about task is available as semi-expression variables, syntax is ${VARIABLE}.

<listener class="com.ataccama.nme.ext.workflow.WorkflowTaskListener">
    <whenSucceeded>
    <workflowName>someWorkflow.ewf</workflowName>
    <params>
      <param name="TASK_ID" expression="${TASK_ID}" />
      <param name="TASK_NAME" expression="${TASK_NAME}" />
    </params>
    </whenSucceeded>
</listener>

Parameters:

  • workflowName - ID of workflow to run (contains .ewf suffix)

ShellTaskListener

ShellTaskListener allows executing shell commands. Additional information about task is available as enviroment variables.

<listener class="com.ataccama.nme.engine.monitoring.ShellTaskListener">
    <whenSucceeded>
        mail -s "$TASK_NAME has finished" admin@domain.com &lt;&lt;EOT
        $TASK_NAME ($TASK_ID) has successfully finished.
EOT
    </whenSucceeded>
  <whenFailed>
    mail -s "$TASK_NAME has failed!" admin@domain.com &lt;&lt;EOT
    $TASK_NAME ($TASK_ID) has failed.
EOT
  </whenFailed>
</listener>

Parameters:

  • interpreter(default: /bin/sh) - Which command should be used to execute the script (Windows: use cmd /c)

  • fileSuffix (default: .sh) - Suffix for the temp file created (Windows: use .bat or .cmd)

In addition to task information, the script fragments may use all the environment variables passed to the java command running MDM.

SqlTaskListener

SqlTaskListener allows executing SQL query on given database. Additional information about task is available as name-binded variables.

<listener class="com.ataccama.nme.engine.monitoring.SqlTaskListener">
  <dbConnection>someDB</dbConnection>
  <whenSucceeded>
    INSERT INTO TASK_LOG(id, name) VALUES(:TASK_ID, :TASK_NAME)
    </whenSucceeded>
  <whenFailed>
    INSERT INTO TASK_LOG_ERROR(id, name, message) VALUES(:TASK_ID, :TASK_NAME, :ERROR_MESSAGE)
  </whemFailed>
</listener>

Parameters:

  • dbConnection - Name of database connection defined in main server configuration

HttpSoapTaskListener

HttpSoapTaskListener allows calling external services. Additional information about task is available as semi-expression variables, syntax is ${VARIABLE}. Use CDATA section to include message XML in configuration XML.

<listener class="com.ataccama.nme.engine.monitoring.HttpSoapTaskListener">
  <urlResourceName>task_status</urlResourceName>
  <soapAction>action</soapAction>
  <whenSucceeded>
      <![CDATA[
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://www.example.com/ws">
        <soapenv:Header/>
        <soapenv:Body>
          <ws:action>
            <ws:id>${TASK_ID}</ws:id>
            <ws:name>${TASK_NAME}</ws:name>
          </ws:action>
        </soapenv:Body>
      </soapenv:Envelope>
      ]]>
  </whenSucceeded>
</listener>

Parameters:

  • urlResourceName - Name of the URL resource defined in the server runtime configuration file (see Runtime Configuration).

  • soapAction - URL of the target web service.

  • timeout (optional, default: 5000) - Timeout in milliseconds, if target web service does not respond within in time, request is considered as timeout.

  • soapVersion (optional, default: SOAP_1_1) - Either SOAP_1_1 for SOAP version 1.1 or SOAP_1_2 for SOAP version 1.2.

  • encoding (optional) - Request encoding.

  • deprecated (use urlResourceName instead):

    • url - URL of target web service.

    • username (optional) - Username in case authorization is required, only HTTP Basic authorization is supported.

    • password (optional) - Password, encrypted passwords are supported.

Was this page useful?