The JobResultConsumption unit test exhibits the consumption of a job result. The test creates a launchy job which fails on even build numbers (just to have a job which fails first and succeeds the second time):
The launchy job is called by the Run Launchy Jenkins Task.
In the "failure" branch of the exclusive gateway there's the condition which uses the expression
job.get("launch").getLastBuildResult() to access the last build result of launchy:
In the "success" branch of the exclusive gateway there's the complementary condition: