Closed RichardW98 closed 9 months ago
@RichardW98 @masayag can you try these changes instead?
fromStateData
to extract the input from .results
, then use just .
as the function argumenttoStateData
definition (not relevant to the change, but looks better 😉 )diff --git a/assessment/src/main/resources/assessment.sw.yaml b/assessment/src/main/resources/assessment.sw.yaml
index 663b2a4..1f3e533 100644
--- a/assessment/src/main/resources/assessment.sw.yaml
+++ b/assessment/src/main/resources/assessment.sw.yaml
@@ -28,6 +28,11 @@ states:
repositoryUrl: ".repositoryUrl"
actionDataFilter:
toStateData: ".result"
+ - name: printAction
+ functionRef:
+ refName: logOuput
+ arguments:
+ message: "\"Before preCheck: \\(.)\""
- name: preCheck
functionRef:
refName: preCheck
@@ -35,13 +40,13 @@ states:
# replace workflowdata with any other words, then the call will be received by the precheck.
# but the result is unable to be fetched
workflowdata:
- result: .result
+ result: .
actionDataFilter:
- results: "${ {preCheck: .workflowdata} }"
- toStateData: "${ .preCheck }"
+ fromStateData: .result
+ toStateData: ".preCheck"
- name: printAction
functionRef:
refName: logOuput
arguments:
- message: ".preCheck"
+ message: "\"After preCheck: \\(.)\""
end: true
\ No newline at end of file
diff --git a/assessment/src/main/resources/specs/precheck.yaml b/assessment/src/main/resources/specs/precheck.yaml
index 18dd31c..7a863ec 100644
--- a/assessment/src/main/resources/specs/precheck.yaml
+++ b/assessment/src/main/resources/specs/precheck.yaml
@@ -27,6 +27,10 @@ paths:
responses:
"200":
description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JsonNodeModelInput'
components:
schemas:
JsonNodeModelInput:
Thank you @dmartinol for the advice! now the issue of response fetching is ressolved. but it seems the stackOverFlow error is still there. I have to try with:
- name: preCheck
functionRef:
refName: preCheck
arguments:
# replace workflowdata with any other words, then the call will be received by the precheck.
# but the precheck's execution result is still unable to be fetched
test:
result: .
actionDataFilter:
fromStateData: .result
toStateData: ".preCheck"
and then it will work
I just tried it again and it works! Thank you @dmartinol! I will update the pr and @masayag please review again
rewrite assessment subflow to openapi rest api current issue: when send a post with "workflowdata" in requestbody, there will be an error:
The assumption here is that "." in jq points back to "workflowdata" which caused a deadloop in the Json Node Parser, then the memory leaks result in the
StackOverflowError
. But we need more investigationthe "workflowdata" node can be renamed to other words, but the execution result of preCheck still can't be output into root "data" of assessment