- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 09:24 PM
いつもお世話になっております。
トランスフォームマップを使用してインポート処理後に、項目のチェックを行い、チェックに引っかかった項目情報をイベントに渡し、Notificationでエラー通知を送信したいと考えています。
上記の理由から、項目のチェックはレコード事にではなく、全レコードを1回の処理でチェックしたいと考えています。
transformap script)(onComplete)を使用することで、ターゲットテーブルにインポート処理されて作成された全レコードの項目をチェック出来ると認識していたのですが、transform map scriptにデフォルトで用意されているtarget(ターゲットテーブルのGlideRecordオブジェクト)の行数をgetRowCount()で確認した所、0と出力されました。
トランスフォームスクリプト(Oncomplete())が実行されるタイミングはターゲットテーブルにレコードが作成された後ではなく、レコードが作成される前なのでしょうか?
トランスフォームスクリプトの代用案として、Transform historyテーブルにレコードが作成されたタイミングで実施される、Business Ruleの実装を考えていますが、この方法で可能でしょうか?
また、なにか他に良い方法があればご教授頂けると幸いです。
宜しくお願い致します。
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 10:02 PM - edited 11-07-2022 10:04 PM
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 インポートセットイベントのコンテキスト |
source | GlideRecord | ソースインポートセットテーブルの最後の行。 |
target | GlideRecord | ターゲットテーブルの最後の行。 |
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 10:02 PM - edited 11-07-2022 10:04 PM
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 インポートセットイベントのコンテキスト |
source | GlideRecord | ソースインポートセットテーブルの最後の行。 |
target | GlideRecord | ターゲットテーブルの最後の行。 |
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 10:38 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 10:53 PM
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).