進行中のフローの実行をキャンセルする方法Summary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } フローは通常、手動操作を必要とせずに完了まで実行され、自動的にフローのエンドポイントに到達します。ただし、誤ってロジックを使用してフローを作成し、それが無限にループする可能性があります。無限ループは、どのプログラミング言語でも発生する可能性があります。この記事では、これらの進行中のフローの実行をキャンセルする方法について説明します。 Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } フローをサポートするすべての ServiceNow リリース Instructions<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } 特定のフローに対して実行中のすべてのフロー実行 (ステータスが「処理中」) をキャンセルするには、次の手順を実行します。 1. スクリプト - バックグラウンドを開きます。 2.次のスクリプトを実行します。 var now_GR = new GlideRecord("sys_flow_context"); now_GR.addQuery("name", "NAME OF FLOW TO CANCEL HERE"); now_GR.query(); while (now_GR.next()) { sn_fd.FlowAPI.cancel(now_GR.getUniqueValue(), 'Canceling Test Flows'); } 3.ここでキャンセルするフローの名前をフローの正確な名前に置き換えます。フローデザイナーでフローを表示すると、 プロパティ > 名前 の下にフロー名が表示されます。 重要:最初に非本番インスタンスでこのプロセスをテストします。 前のスクリプトは、顧客インスタンスで数千のフロー実行をキャンセルするために正常に使用されました。ただし、ServiceNow 開発者はこのコードを公式にテストまたは検証していないため、公式にはサポートされていません。このスクリプトを本番環境で使用する前に、非本番環境で慎重にテストしてください。 Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } }