There is a flaw in the example code:
Workflow.await(() -> this.fulfilled);
This will block in case the signal method is called with false as an argument:
workflow.fulfillOrderSignal(false);
In that case the above await statement will block forever.
One way to solve this is to change the type of the fulfilled field to Boolean
and change the wait condition to:
Workflow.await(() -> this.fulfilled != null);
Then it works in both cases, i.e. the fulfilled could be either false or true.
Hello,
Thanks for catching this! We will update the course and make corrections.
Mason