Skip to content
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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

johnBgood
Copy link
Collaborator

Description

Related issues

closes #

Checklist

  • PR has a milestone or the no milestone label.

@johnBgood johnBgood self-assigned this Nov 14, 2024
@johnBgood johnBgood force-pushed the 788-file-upload-support-for-the-webhook-connector branch from c49c998 to 55f050f Compare November 14, 2024 15:36
@johnBgood johnBgood added this to the 8.7.0-alpha2 milestone Nov 14, 2024
@@ -101,6 +96,11 @@ public InboundConnectorContextImpl(
logs);
}

@Override
public ActivationCheckResult canActivate(Object variables) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ActivationResult?

Copy link
Collaborator Author

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

Copy link
Contributor

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);
Copy link
Contributor

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?

Comment on lines +19 to +33
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 {}
}
}
Copy link
Contributor

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.

Copy link
Contributor

@sbuettner sbuettner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants