This is an automated email from the ASF dual-hosted git repository.

fjtiradosarti pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new da98be8ae [Fix 1868] Including usage of $WORKFLOW.prevActionResult 
(#1878)
da98be8ae is described below

commit da98be8ae092cbf4a997757d6a792f46af47ab62
Author: Francisco Javier Tirado Sarti 
<[email protected]>
AuthorDate: Tue Feb 27 13:13:05 2024 +0100

    [Fix 1868] Including usage of $WORKFLOW.prevActionResult (#1878)
---
 .../src/main/resources/foreach.sw.json                | 19 ++++++-------------
 .../java/org/kie/kogito/examples/ForEachRestIT.java   |  2 +-
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git 
a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/main/resources/foreach.sw.json
 
b/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/main/resources/foreach.sw.json
index 5532eed27..dbd6852ad 100644
--- 
a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/main/resources/foreach.sw.json
+++ 
b/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/main/resources/foreach.sw.json
@@ -6,9 +6,9 @@
   "start": "start",
   "functions": [
     {
-      "name": "printMessage",
-      "type": "custom",
-      "operation": "sysout"
+      "name": "double",
+      "type": "expression",
+      "operation": "$WORKFLOW.prevActionResult*2"
     },
     {
       "name": "increase",
@@ -30,18 +30,11 @@
       "actions": [
         {
           "name":"increase",
-          "functionRef": {
-            "refName": "increase"
-          }
+          "functionRef": "increase"
         },
         {
-          "name": "printAction",
-          "functionRef": {
-            "refName": "printMessage",
-            "arguments": {
-              "message": ".item"
-            }
-          }
+          "name": "double",
+          "functionRef": "double"
         }],
         "end": true
     }
diff --git 
a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java
 
b/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java
index f185daf26..8b8b06e11 100644
--- 
a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java
+++ 
b/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java
@@ -41,7 +41,7 @@ class ForEachRestIT {
                 .post("/foreach")
                 .then()
                 .statusCode(201)
-                .body("workflowdata.output", is(Arrays.asList(2, 3, 4)))
+                .body("workflowdata.output", is(Arrays.asList(4, 6, 8)))
                 .body("workflowdata.input", nullValue());
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to