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

add endpoint for calling mutation ExecuteAfter #425

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

Conversation

ydayagi
Copy link
Contributor

@ydayagi ydayagi commented Feb 17, 2025

DO NOT MERGE BEFORE #306. This one depends on it.

assessedByInstance = await this.orchestratorService.fetchInstance({
instanceId: instance.businessKey,
instanceId: variables.orchestratorAssessmentInstanceId as string,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the as string here? I guess not thanks to the check on line 151

Copy link
Contributor Author

@ydayagi ydayagi Feb 18, 2025

Choose a reason for hiding this comment

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

@mareklibra line 151 helps for the case that it is undefined not for the type. because it is of type unknown (the field orchestratorAssessmentInstanceId) I get compile error. so, yes, it is needed.

inputData:
executeWorkflowRequestDTO.inputData as ProcessInstanceVariables,
definitionVersion: definition.version,
inputData: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This part looks suspicious, can you please confirm it is as expected?

When looking at changes around https://github.com/redhat-developer/rhdh-plugins/pull/425/files#diff-dfd9240b67dcd5abbff3560a8d0f341802d928a817c13e2350a999bb2751d5fdR588 , there seems to be just an addition of fields but the change here puts executeWorkflowRequestDTO.inputData into a sub-property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed this change is required. this is the new implementation in sonataflow. if you have workflowdata field then it is treated as the input to the workflow execution and all the rest is stored without using it. If you do not have workflowdata then the whole variables object is treated as the input to the workflow execution. putting the input in the workflowdata field enables us to pass orchestratorAssessmentInstanceId into variables and having it stored and read when querying the workflow instance/execution/run.

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

Successfully merging this pull request may close these issues.

2 participants