Skip to content

Fix: Correct argument order for workflow import subject and description templates#2

Open
ashu82492 wants to merge 1 commit intoappform-io:masterfrom
ashu82492:bugfix-import-workflow
Open

Fix: Correct argument order for workflow import subject and description templates#2
ashu82492 wants to merge 1 commit intoappform-io:masterfrom
ashu82492:bugfix-import-workflow

Conversation

@ashu82492
Copy link

Issue

When importing workflows, the subjectIdTemplate and descriptionTemplate arguments were being passed in the wrong order to the workflow builder, causing these templates to be swapped during the import process.

Changes Made

Fixed argument order in WorkflowManager.java

  • Swapped the order of descriptionTemplate and subjectIdTemplate parameters

Fixed return value in import logic [Please review if this is correct]

  • Corrected the return statement to return the properly configured workflow object instead of inWorkflow
  • This ensures the workflow returned includes all the updates from the import operation

Removed unused import

  • Removed unused com.google.common.collect.Sets import

Added test assertions

  • Subject ID and Description templates are correctly set to "Subject"
  • Tests cover both initial import and idempotent import scenarios

Updated test fixture

  • Added descriptionTemplate and subjectIdTemplate fields to workflow_details.json fixture to properly test the scenario

Testing

All existing tests pass and tested the import feature locally.

transition.getRule(),
transition.getActionIds())));
return inWorkflow;
return workflow;
Copy link
Author

@ashu82492 ashu82492 Feb 6, 2026

Choose a reason for hiding this comment

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

Please double verify if this is correct.
This should return the the updated workflow rather than input inWorkflow.

Copy link
Contributor

@tusharmndr tusharmndr Feb 16, 2026

Choose a reason for hiding this comment

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

ImportResult should be newly imported workflow, but here workflow might be incomplete as the Dto workflow object might not have complete transition and states,
Please re-read the workflow for import result, example schema

.flatMap(schemaSummary -> schemaStore.read(schemaSummary.getId()))
                .map(schema -> new ImportResult<>(schema, true, null))

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