Skip to content

3827 Add Form trigger component handler#3828

Merged
ivicac merged 10 commits intomasterfrom
3827_server
Jan 2, 2026
Merged

3827 Add Form trigger component handler#3828
ivicac merged 10 commits intomasterfrom
3827_server

Conversation

@ivicac
Copy link
Copy Markdown
Contributor

@ivicac ivicac commented Dec 30, 2025

  • 3827 Add Form trigger component handler
  • 3827 Refactor checkValue in WebhookRequestDeserializer to handle nested maps and improve FileEntry mapping logic.
  • 3827 Introduce Trigger Form API Controller and DTO
  • 3827 Add GraphQL schema and controller for TriggerDefinition
  • 3827 Refactor parameter parsing by unifying handlers into parseMap method and improving value conversion logic

@ivicac ivicac linked an issue Dec 30, 2025 that may be closed by this pull request
3 tasks
@ivicac ivicac changed the title 3827 server 3827 Add Form trigger component handler Dec 30, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a Form component with trigger capabilities, along with supporting infrastructure for form-based workflow triggers. The implementation includes webhook request handling improvements, GraphQL API support for trigger definitions, and a REST API for retrieving form configurations.

Key changes include:

  • Introduction of a new Form component with a "New Form Request" trigger that supports various field types (text, email, date, file uploads, etc.)
  • Refactoring of webhook parameter parsing to handle nested maps and improve value conversion logic using a unified parseMap method
  • Addition of GraphQL schema and REST endpoints for accessing trigger definitions and form configurations

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
settings.gradle.kts Adds the new form component module to the build configuration
AbstractWebhookTriggerController.java Refactors parameter parsing by unifying parseFormUrlencodedParams into a generalized parseMap method with improved nested structure and value conversion support
trigger-definition.graphqls Defines GraphQL schema for TriggerDefinition type with associated properties and query
PlatformConfigurationAuthorizeHttpRequestContributor.java Configures public access to /api/trigger-form/** endpoints for unauthenticated form submissions
TriggerFormApiController.java Implements REST endpoint to retrieve form configuration based on workflow execution ID
TriggerDefinitionGraphQlController.java Exposes TriggerDefinition via GraphQL query interface
build.gradle.kts Adds platform-security-web-api dependency for security configuration
TriggerFormDTO.java Defines data transfer object structure for form configurations including inputs and styling options
WebhookRequestDeserializer.java Refactors checkValue method to recursively handle nested maps and improve FileEntry mapping logic
form.svg Provides SVG icon for the Form component
NewFormRequestTrigger.java Implements the core trigger logic for handling form submissions with extensive field type support
FormConstants.java Defines constants and FieldType enum for form configuration
FormComponentHandler.java Registers the Form component with the component framework
form/build.gradle.kts Defines build configuration for the new form component module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ivicac ivicac force-pushed the 3827_server branch 3 times, most recently from 19c28e4 to 4391818 Compare December 30, 2025 08:51
@ivicac ivicac requested a review from Copilot December 30, 2025 20:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (2)

server/libs/platform/platform-webhook/platform-webhook-rest/platform-webhook-rest-api/src/main/java/com/bytechef/platform/webhook/rest/AbstractWebhookTriggerController.java:366

  • If a key ends with "[" or ".", after splitting, one of the resulting elements in the keys array will be an empty string. This empty string will be used as a map key at line 385 or 392, which could lead to unexpected behavior. Consider filtering out empty strings from the keys array after splitting, or adding validation to handle this edge case.
            // Split the key on [ or .
            String[] keys = key.split("\\[|\\.");

            Map<String, Object> currentMap = multiMap;

            for (int i = 0; i < keys.length; i++) {
                String currentKey = keys[i];

                // Remove any trailing ]
                if (currentKey.endsWith("]")) {
                    currentKey = currentKey.substring(0, currentKey.length() - 1);
                }

server/libs/platform/platform-webhook/platform-webhook-rest/platform-webhook-rest-api/src/main/java/com/bytechef/platform/webhook/rest/AbstractWebhookTriggerController.java:394

  • If a key path has already been set to a non-Map value and subsequent entries try to use it as a nested map, line 394 will throw a ClassCastException. For example, if "user" is set to a string value first, then "user.name" is processed, the code will attempt to cast the string to a Map. Consider adding validation to check if the existing value is a Map before casting, or handle the key collision scenario appropriately.
                    currentMap.putIfAbsent(currentKey, new HashMap<String, Object>());

                    currentMap = (Map<String, Object>) currentMap.get(currentKey);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ivicac ivicac force-pushed the 3827_server branch 2 times, most recently from 1a57c0f to 1768179 Compare December 30, 2025 21:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ivicac ivicac force-pushed the 3827_server branch 2 times, most recently from 8dc2599 to 756e381 Compare December 31, 2025 13:02
@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

@ivicac ivicac merged commit 82b7fb0 into master Jan 2, 2026
11 of 12 checks passed
@ivicac ivicac deleted the 3827_server branch January 2, 2026 07:22
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.

Built-in Form component

2 participants