[WCM] Fix example code to reflect changes for #8226

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.1, 2.2, 2.3
| Fixed tickets | #8226