-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(webhook): Add support for document upload #3659
base: main
Are you sure you want to change the base?
Conversation
c49c998
to
55f050f
Compare
...in/java/io/camunda/connector/runtime/core/inbound/correlation/InboundCorrelationHandler.java
Dismissed
Show dismissed
Hide dismissed
...src/main/java/io/camunda/connector/runtime/inbound/webhook/InboundWebhookRestController.java
Dismissed
Show dismissed
Hide dismissed
@@ -101,6 +96,11 @@ public InboundConnectorContextImpl( | |||
logs); | |||
} | |||
|
|||
@Override | |||
public ActivationCheckResult canActivate(Object variables) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about ActivationResult
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed that with the team and came up with this name, as we are not activating anything. ActivationResult
might be a bit misleading in that regard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, although we activate without correlate. 😄
@@ -128,9 +137,12 @@ private ResponseEntity<?> processWebhook( | |||
// when verification was skipped | |||
// Step 2: trigger and correlate | |||
var webhookResult = connectorHook.triggerWebhook(payload); | |||
var ctxData = toWebhookTriggerResultContext(webhookResult); | |||
// create documents if the connector is activable | |||
var documentReferences = createDocuments(connector.context(), payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we deal with errors during createDocuments
? Will the exceptions just bubble up?
public sealed interface ActivationCheckResult { | ||
|
||
sealed interface Success extends ActivationCheckResult { | ||
ProcessElementContext activatedElement(); | ||
|
||
record CanActivate(ProcessElementContext activatedElement) implements Success {} | ||
} | ||
|
||
sealed interface Failure extends ActivationCheckResult { | ||
|
||
record NoMatchingElement(boolean discardUnmatchedEvents) implements Failure {} | ||
|
||
record TooManyMatchingElements() implements Failure {} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice type hierarchy and model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Description
Related issues
closes #
Checklist
no milestone
label.