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(rest): Add support for storing GraphQL/REST Connector's response as a document #3746

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

johnBgood
Copy link
Collaborator

@johnBgood johnBgood commented Dec 4, 2024

Description

  • Add a "Store response" checkbox in the Element Templates of the REST Connector and the GraphQL Connector
  • Handle the response storage depending on where the code is executed (SM, SaaS cluster, Cloud Function)
  • Returns a new document fields in the response + in the process variables

Related issues

https://github.com/camunda/team-connectors/issues/787
#3734

Checklist

  • PR has a milestone or the no milestone label.

@johnBgood johnBgood self-assigned this Dec 4, 2024
@johnBgood johnBgood added this to the 8.7.0-alpha3 milestone Dec 4, 2024
@@ -97,4 +97,8 @@ public void deleteDocument(CamundaDocumentReference reference) {
public void clear() {
documents.clear();
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

found it helpful for test purposes, and this is the InMemory store not a production one, I guess it's ok

* The connector is executed in the context of the cloud function. This is where the
* HttpCommonRequest will be executed.
*/
record SaaSCloudFunctionSideEnvironment(boolean storeResponseSelected)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

maybe the Environment part of the name is redundant, let me know

* Environment variable to check if the current execution is running in a Google Cloud Function.
*/
private static final String CLOUD_FUNCTION_MARKER_VARIABLE =
"CAMUNDA_CONNECTOR_HTTP_BLOCK_URL_GCP_META_DATA_INTERNAL";
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 could create another env variable dedicated to this purpose, wdyt?

@johnBgood johnBgood changed the title feat(rest): Add support for storing REST Connector's response as a document feat(rest): Add support for storing GraphQL/REST Connector's response as a document Dec 4, 2024
@johnBgood johnBgood force-pushed the 787-file-upload-download-support-for-the-rest-connector branch from 14ff3f9 to 9f899d6 Compare December 4, 2024 16:25
@johnBgood johnBgood force-pushed the 787-file-upload-download-support-for-the-rest-connector branch 2 times, most recently from 638134a to b9fc1e7 Compare December 5, 2024 14:42
@johnBgood johnBgood marked this pull request as ready for review December 11, 2024 15:40
@johnBgood johnBgood requested a review from a team as a code owner December 11, 2024 15:40
@johnBgood johnBgood force-pushed the 787-file-upload-download-support-for-the-rest-connector branch from 1df27e3 to a8c2e84 Compare December 11, 2024 15:51
@@ -45,7 +46,7 @@ public static class BuilderFinalStep {
private String documentId;
private String storeId;
private String contentType;
private String fileName;
private String fileName = UUID.randomUUID().toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets let the client decide on the filename and not do it here.

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