You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "ahgittin (via GitHub)" <gi...@apache.org> on 2023/05/22 14:39:16 UTC

[GitHub] [brooklyn-server] ahgittin opened a new pull request, #1400: Workflow - foreach, reducing, update-children, and more [WIP]

ahgittin opened a new pull request, #1400:
URL: https://github.com/apache/brooklyn-server/pull/1400

   implementation of the enhancements described in https://github.com/apache/brooklyn-docs/pull/379, specifically:
   
   * `reducing` on `workflow` and on a new `foreach` step
   * ability to test if an effector is defined, eg `${entity.effector.start}` for if there is a `start` effector on `entity`
   * tidy to forgive a rogue colon and to allow a list of steps to be interpreted as a workflow
   * `update-children` (WIP)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-server] iuliana commented on a diff in pull request #1400: Workflow - foreach, reducing, update-children, and more [WIP]

Posted by "iuliana (via GitHub)" <gi...@apache.org>.
iuliana commented on code in PR #1400:
URL: https://github.com/apache/brooklyn-server/pull/1400#discussion_r1200707106


##########
core/src/main/java/org/apache/brooklyn/core/workflow/WorkflowStepResolution.java:
##########
@@ -90,7 +91,18 @@ static WorkflowStepDefinition resolveStep(ManagementContext mgmt, Object def) {
                 if (s == null) s = defM.remove("shorthand");
                 if (s == null) s = defM.remove("s");
                 if (s == null) {
-                    throw new IllegalArgumentException("Step definition must indicate a `type` or a `step` / `shorthand` / `s` ("+def+")");
+                    if (defM.size()==1) {
+                        // assume the colon caused it accidentally to be a map
+                        s = Iterables.getOnlyElement(defM.keySet());
+                        if (s instanceof String && ((String)s).contains(" ")) {

Review Comment:
   @ahgittin Probably could replace this `if` with an elvis operator.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-server] ahgittin commented on pull request #1400: Workflow - foreach, reducing, update-children, and more

Posted by "ahgittin (via GitHub)" <gi...@apache.org>.
ahgittin commented on PR #1400:
URL: https://github.com/apache/brooklyn-server/pull/1400#issuecomment-1560688419

   `update-children` now completed, including recovering on interrupts with tests, and a few fixes for workflow/task interruption and resumption
   
   ready for final review and merge


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-server] ahgittin commented on a diff in pull request #1400: Workflow - foreach, reducing, update-children, and more [WIP]

Posted by "ahgittin (via GitHub)" <gi...@apache.org>.
ahgittin commented on code in PR #1400:
URL: https://github.com/apache/brooklyn-server/pull/1400#discussion_r1200746152


##########
core/src/main/java/org/apache/brooklyn/core/workflow/WorkflowStepResolution.java:
##########
@@ -90,7 +91,18 @@ static WorkflowStepDefinition resolveStep(ManagementContext mgmt, Object def) {
                 if (s == null) s = defM.remove("shorthand");
                 if (s == null) s = defM.remove("s");
                 if (s == null) {
-                    throw new IllegalArgumentException("Step definition must indicate a `type` or a `step` / `shorthand` / `s` ("+def+")");
+                    if (defM.size()==1) {
+                        // assume the colon caused it accidentally to be a map
+                        s = Iterables.getOnlyElement(defM.keySet());
+                        if (s instanceof String && ((String)s).contains(" ")) {

Review Comment:
   in this (rare!) instance i think the longer-winded syntax is worth it for readability



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-server] asfgit merged pull request #1400: Workflow - foreach, reducing, update-children, and more

Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit merged PR #1400:
URL: https://github.com/apache/brooklyn-server/pull/1400


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org