Skip to content

Support several "output" in the SWS application#47

Open
umeshsarkar wants to merge 7 commits into
mainfrom
46-support-several-output-in-the-sws-application
Open

Support several "output" in the SWS application#47
umeshsarkar wants to merge 7 commits into
mainfrom
46-support-several-output-in-the-sws-application

Conversation

@umeshsarkar

@umeshsarkar umeshsarkar commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

Closes #46

The main change in this PR is that the application now supports several output variables in the FCL file, and the response structure has been updated to represent the result of each output variable. Everything else remains the same as before.

To better illustrate the support for several output variables, an example has been added in the ConstructionRobotAssistanceDecisionRules.fcl file. This file contains several output variables. To run this example, use the following command:

mvn spring-boot:run -D"spring-boot.run.profiles"=construction

In the previous version (which supported only a single output variable), the second element in the response JSON decisionResult was fixed. It always shows a single set of results, including a slidingDecision and a description, as shown below:

{
  "decisionStatus": "Sliding Decision Response",
  "decisionResult": {
    "slidingDecision": "HUMAN_ON_THE_LOOP",
    "description": "Human has to be informed about AI's rescheduling"
  },
  "decisionExplanation": {
    "...": "..."
  }
}

Since the current version supports several output parameters, having a single decisionResult field is now confusing, unstructured, and hard to read. To make the response more readable and structured, the decisionResult field now includes individual entries for each output variable, each with its own result set. The name of "individual entries" is coming from the defined output variable name in the FCL file. For example:

{
  "decisionStatus": "Sliding Decision Response",
  "decisionResult": {
    "suggestedWorkSharingApproach": {
      "slidingDecision": "ROBOT_AUTONOMOUSLY",
      "description": "Let the robot continue trying"
    },
    "systemAutonomousOperatingStatus": {
      "slidingDecision": "AUTONOMOUS",
      "description": "System is currently operating autonomously"
    }
  },
  "decisionExplanation": {
    "...": "..."
  }
}

Note: This implementation is an initial idea and should be discussed further.
to do: update the README

@umeshsarkar umeshsarkar linked an issue Jul 15, 2025 that may be closed by this pull request
@umeshsarkar umeshsarkar self-assigned this Jul 15, 2025
@umeshsarkar umeshsarkar changed the base branch from 44-the-suggestedworksharingapproach-should-be-configurable to main July 23, 2025 12:24
@umeshsarkar umeshsarkar marked this pull request as ready for review August 5, 2025 10:17
@AllArgsConstructor
public class SlidingDecision {
private String decisionResult;
private Map<String, String> decisionResult;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

instead of decisionResult, better use slidingDecisionOutputParameters to be consistent with our input parameter naming in the JSON

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.

support several "output" in the SWS application

2 participants