Support for optional rApp and rApp instance parameters
[nonrtric/plt/rappmanager.git] / rapp-manager-models / src / main / java / com / oransc / rappmanager / models / statemachine / RappInstanceStateMachine.java
index c4cd18b..b776df7 100755 (executable)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START======================================================================
  * Copyright (C) 2023 Nordix Foundation. All rights reserved.
+ * Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.
  * ===============================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,6 +52,10 @@ public class RappInstanceStateMachine {
     public void sendRappInstanceEvent(RappInstance rappInstance, RappEvent rappEvent) {
         logger.info("Sending rapp instance event {} for {}", rappEvent.name(), rappInstance.getRappInstanceId());
         logger.debug("State machine map is {}", stateMachineMap);
+        stateMachineMap.get(rappInstance.getRappInstanceId()).getExtendedState().getVariables()
+                .put("sme", rappInstance.isSMEEnabled());
+        stateMachineMap.get(rappInstance.getRappInstanceId()).getExtendedState().getVariables()
+                .put("dme", rappInstance.isDMEEnabled());
         stateMachineMap.get(rappInstance.getRappInstanceId())
                 .sendEvent(Mono.just(MessageBuilder.withPayload(rappEvent).build())).subscribe();
     }