@Joel Wiesmann & @Juergen Lechner:
With the following SQL query (Oracle), you can list all of the RT lines pertaining to :RSET
scripting commands.
WITH RT_MESSAGE_INSERTS AS (
SELECT RT_AH_IDNR, RT_TYPE, RT_LNR, RT_TIMESTAMP, RT_MSGNR, RT_CONTENT,
SUBSTR(RT_MSGINSERT, 1, INSTR(RT_MSGINSERT, '|', 1, 1) - 1) MSG_INSERT_1,
SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,1) +1, INSTR(RT_MSGINSERT,'|', 1,2) - INSTR(RT_MSGINSERT,'|', 1,1) -1) MSG_INSERT_2,
SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,2) +1, INSTR(RT_MSGINSERT,'|', 1,3) - INSTR(RT_MSGINSERT,'|', 1,2) -1) MSG_INSERT_3,
SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,3) +1, INSTR(RT_MSGINSERT,'|', 1,4) - INSTR(RT_MSGINSERT,'|', 1,3) -1) MSG_INSERT_4,
SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,4) +1, INSTR(RT_MSGINSERT,'|', 1,5) - INSTR(RT_MSGINSERT,'|', 1,4) -1) MSG_INSERT_5,
SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,5) +1, INSTR(RT_MSGINSERT,'|', 1,6) - INSTR(RT_MSGINSERT,'|', 1,5) -1) MSG_INSERT_6,
SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,6) +1) MSG_INSERT_7
FROM RT
)
SELECT * FROM RT_MESSAGE_INSERTS
WHERE RT_TYPE = 'ACT'
AND RT_MSGNR = 00020237
AND MSG_INSERT_7 = 'RSET'
You can identify all of the :RSET
-variables associated with a particular task using a query like the one below.
SELECT SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,4) +1, INSTR(RT_MSGINSERT,'|', 1,5) - INSTR(RT_MSGINSERT,'|', 1,4) -1)
FROM RT
WHERE SUBSTR(RT_MSGINSERT,INSTR(RT_MSGINSERT,'|', 1,6) +1) = 'RSET'
AND RT_AH_IDNR = original_run_ID
I do not believe the AE looks at RT records pertaining to the original run though. This is unnecessary and inconsistent with observed behavior. I also do not believe :RSET
-variables are stored differently in the DB. The difference in behavior arises solely from how the AE interprets :RSET
commands during task activation.
My guess is that it works like this:
When the Automation Engine evaluates an :RSET
statement, if the task is a restart, the AE ignores the value after the equals sign, and looks up the value set in the original run.
SELECT EV_VALUE value
FROM EV
WHERE EV_VNAME = variable_name
AND EV_AH_IDNR = original_run_ID
UNION ALL
SELECT AV_VALUE value
FROM AV
WHERE AV_VNAME = variable_name
AND AV_AH_IDNR = original_run_ID
The final value set in the task may not be the initial value set by
:RSET
, because it can have been modified subsequent to the :RSET
.
The above is at least consistent with observed behavior.