Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 - Asset Console Creating an Access Definition File Guide


[TRANSACTION] (define transaction)

[TRANSACTION] specifies the range to be handled as a transaction when an access definition file is being used to customize an operation window.

If the processing status is NORMAL when the processing defined in the transaction ends, the transaction is committed; if the processing status is not NORMAL, the transaction is rolled back.

Organization of this page

Syntax

[TRANSACTION]
  . . .
  [BEGIN]
    . . .
  [END]
[TRANSACTION_END]

Values

Codes the transaction processing.

Remarks

Whether or not transaction processing is complete is determined according to the status referenced by the transaction processing end tag [TRANSACTION_END] or by the embedded function $BREAK, which breaks out of the transaction processing. If the status is NORMAL, the transaction is committed; if the status is not NORMAL, it is not committed (it is rolled back).

The status of the access definition file is updated on an ongoing basis by execution of tags and embedded functions. If processing that updates the status is specified more than once in a transaction, whether to commit or roll back is based on the status that was last specified.

This means that if a transaction is committed immediately before a [TRANSACTION_END] tag or a $BREAK embedded function, we recommend that you use the $SETSTATUS embedded function to explicitly specify NORMAL as the status.

Note that transaction processing cannot be nested.

Example

The following shows an example of transaction processing:

[TRANSACTION]
  [APPEND]
    AssetInfo
  [DATA]
    AssetInfo.AssetID = '10000'
    AssetInfo.AssetNo = '10000'
    AssetInfo.AssetWorkKind = '001'
    AssetInfo.AssetKind = '001'
    AssetInfo.AssetBranchNo = '0'
  [SET_VALUE]
    STATUS = $GETSTATUS()
  [IF]
    STATUS = NORMAL
  [THEN]
    ##Process 1
    [APPEND]
      InstalledInfo
    [DATA]
      InstalledInfo.InstalledID = '10000'
      InstalledInfo.AssetID = '10000'
    [SET_VALUE]
      STATUS = $GETSTATUS()
    [IF]
      STATUS = NORMAL
    [THEN]
      ##Process 2
      [SET_VALUE]
        MSG = 'TRANSACTION : COMMIT'
        $ECHO(MSG)
    [ELSE]
      ##Process 3
      [SET_VALUE]
        MSG = 'TRANSACTION : ROLLBACK'
        $ECHO(MSG)
    [IF_END]
  [ELSE]
    ##Process 4
    [SET_VALUE]
      MSG = 'TRANSACTION : ROLLBACK'
      $ECHO(MSG)
  [IF_END]
[TRANSACTION_END]

In this processing, the following exception processing is performed.