Currently users are forced to add an outputAs method to access the first element of the collection
listen(
"waitHumanReview",
to().one(
consumed("org.acme.newsletter.review.done")
.extensionByInstanceId("instanceid")))
.outputAs((Collection<?> events) -> events.iterator().next()),
// The engine sees the incoming JsonNode, sees this task expects
// HumanReview.class,
// and natively deserializes it for you before executing the lambda!
switchWhenOrElse(
h -> HumanReview.NEEDS_REVISION.equals(h.status()),
"humanEditorAgent",
"sendNewsletter",
HumanReview.class)
It would be nice if they can just write
listen(
"waitHumanReview",
to().one(
consumed("org.acme.newsletter.review.done")
.extensionByInstanceId("instanceid"))),
// The engine sees the incoming JsonNode, sees this task expects
// HumanReview.class,
// and natively deserializes it for you before executing the lambda!
switchWhenOrElse(
h -> HumanReview.NEEDS_REVISION.equals(h.status()),
"humanEditorAgent",
"sendNewsletter",
HumanReview.class),
Currently users are forced to add an outputAs method to access the first element of the collection
It would be nice if they can just write