INSTANCESTOPPING では、メッセージ・フローを停止するための要求が実行されたかどうかが検査され、要求が実行された場合は true のブール値が返されます。
メッセージ・フロー関数では、メッセージ・フロー内のすべての処理を停止する要求が実行された場合、TRUE が返され、それ以外の場合は、FALSE が返されます。
/*
* Do not code loops like this as it never increments loopCounter
* but with the INSTANCESTOPPING() check it would exit when the flow is stopped
*/
declare loopCounter integer 0;
INFINITE_LOOP : WHILE (loopCounter < 1000) DO
IF (INSTANCESTOPPING() = TRUE) THEN
LEAVE INFINITE_LOOP;
END IF;
END WHILE INFINITE_LOOP;