What happened:
When extensionByInstanceId is used in a workflow, the DefaultCloudEventPredicate tries to convert the event model's JsonNode into a CloudEvent instance via JacksonModel.as(CloudEvent.class) -> ObjectMapper.convertValue(node, CloudEvent.class).
What you expected to happen:
To use extensionByInstanceId without an exception.
How to reproduce it:
Try to execute a workflow with consumed("type").extensionByInstanceId("extensionName"), something like it:
@Override
public Workflow descriptor() {
return FuncWorkflowBuilder.workflow("intelligent-newsletter")
.tasks(agent("draftAgent", draftAgent::write, NewsletterRequest.class),
emitJson("draftReady", "org.acme.email.review.required", NewsletterDraft.class),
listen("waitHumanReview",
toOne(consumed("org.acme.newsletter.review.done").extensionByInstanceId("flowinstanceid")))
.outputAs((JsonNode node) -> node.isArray() ? node.get(0) : node),
switchWhenOrElse(h -> HumanReview.ReviewStatus.NEEDS_REVISION.equals(h.status()),
"humanEditorAgent", "sendNewsletter", HumanReview.class),
function("humanEditorAgent", humanEditorAgent::edit, HumanReview.class).then("draftReady"),
consume("sendNewsletter", draft -> mailService.send("subscribers@acme.finance.org", draft),
NewsletterDraft.class).inputFrom(input -> input.get("draft"), Map.class))
.build();
}
Anything else we need to know?:
You can see the stack trace error here
Environment:
- Specification version used:
What happened:
When
extensionByInstanceIdis used in a workflow, theDefaultCloudEventPredicatetries to convert the event model'sJsonNodeinto aCloudEventinstance viaJacksonModel.as(CloudEvent.class)->ObjectMapper.convertValue(node, CloudEvent.class).What you expected to happen:
To use
extensionByInstanceIdwithout an exception.How to reproduce it:
Try to execute a workflow with
consumed("type").extensionByInstanceId("extensionName"), something like it:Anything else we need to know?:
You can see the stack trace error here
Environment: