トランスフォームスクリプト(Oncomplete())が実行されるタイミングではターゲットテーブルにインポート処理が行われる前でしょうか、後でしょうか?

Fagi
Tera Contributor

いつもお世話になっております。

 

トランスフォームマップを使用してインポート処理後に、項目のチェックを行い、チェックに引っかかった項目情報をイベントに渡し、Notificationでエラー通知を送信したいと考えています。

上記の理由から、項目のチェックはレコード事にではなく、全レコードを1回の処理でチェックしたいと考えています。

 

transformap script)(onComplete)を使用することで、ターゲットテーブルにインポート処理されて作成された全レコードの項目をチェック出来ると認識していたのですが、transform map scriptにデフォルトで用意されているtarget(ターゲットテーブルのGlideRecordオブジェクト)の行数をgetRowCount()で確認した所、0と出力されました。

トランスフォームスクリプト(Oncomplete())が実行されるタイミングはターゲットテーブルにレコードが作成された後ではなく、レコードが作成される前なのでしょうか?

 

トランスフォームスクリプトの代用案として、Transform historyテーブルにレコードが作成されたタイミングで実施される、Business Ruleの実装を考えていますが、この方法で可能でしょうか?

また、なにか他に良い方法があればご教授頂けると幸いです。

宜しくお願い致します。

 

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

The OnComplete Transform event script runs after all data rows have been read and transformed:

 

"タイミング:onComplete イベントスクリプトは、すべてのデータ行が読み取られて変換された後、インポート実行の最後に処理されます"

 

The target object in this case is a GlideRecord object of the last row of the target table:

インポートセット JS オブジェクトタイプonComplete インポートセットイベントのコンテキスト
sourceGlideRecordソースインポートセットテーブルの最後の行。
targetGlideRecordターゲットテーブルの最後の行。

 

Please see the following documentation for additional information: 変換イベントスクリプトを使用したマップ

 

You could setup an email notification on the Transform History [sys_import_set_run] table when a record is inserted or updated with the condition of: State is one of Complete with errors, Did not complete or errors greater than 0 etc. and further filter it to specific transform maps if required.

 

I hope this helps!

 

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

The OnComplete Transform event script runs after all data rows have been read and transformed:

 

"タイミング:onComplete イベントスクリプトは、すべてのデータ行が読み取られて変換された後、インポート実行の最後に処理されます"

 

The target object in this case is a GlideRecord object of the last row of the target table:

インポートセット JS オブジェクトタイプonComplete インポートセットイベントのコンテキスト
sourceGlideRecordソースインポートセットテーブルの最後の行。
targetGlideRecordターゲットテーブルの最後の行。

 

Please see the following documentation for additional information: 変換イベントスクリプトを使用したマップ

 

You could setup an email notification on the Transform History [sys_import_set_run] table when a record is inserted or updated with the condition of: State is one of Complete with errors, Did not complete or errors greater than 0 etc. and further filter it to specific transform maps if required.

 

I hope this helps!

 

Hi MiIlwood

 

Thank you for your quick response.

 

Am I correct in saying that all data rows are tested and converted, meaning that all records created by the import process are created in the target table?

Community Alums
Not applicable

Please, call me Joel / ジョエル. I apologize for not using more Japanese, but I can see that your English is far better than my Japanese!

 

All records are not necessarily created in the target table, this would depend on how you are coalescing the records and also the Choice action on the field maps (e.g.: if set to reject).

 

結合を使用したレコードの更新

参照フィールドのインポートの選択肢アクションを設定する