From 558674fa346c0e8f4f684f63ecf8b74b4cd4ce8e Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Sat, 17 Aug 2024 01:08:35 +0300
Subject: [PATCH 01/31] update product order process

---
 .../FetchAcknowledgedProductOrders.java       |  97 ++++++++
 .../InitializeProcessProductOrders.java       | 220 ++++++++++++++++++
 .../osom/management/OrderCompleteService.java |  29 +++
 .../osom/management/ProductOrderManager.java  | 175 ++++++++++++++
 src/main/resources/application.yml            |  13 ++
 .../osl/osom/ProcessOrderIntegrationTest.java |   2 +-
 6 files changed, 535 insertions(+), 1 deletion(-)
 create mode 100644 src/main/java/org/etsi/osl/osom/management/FetchAcknowledgedProductOrders.java
 create mode 100644 src/main/java/org/etsi/osl/osom/management/InitializeProcessProductOrders.java
 create mode 100644 src/main/java/org/etsi/osl/osom/management/ProductOrderManager.java

diff --git a/src/main/java/org/etsi/osl/osom/management/FetchAcknowledgedProductOrders.java b/src/main/java/org/etsi/osl/osom/management/FetchAcknowledgedProductOrders.java
new file mode 100644
index 0000000..b4241ba
--- /dev/null
+++ b/src/main/java/org/etsi/osl/osom/management/FetchAcknowledgedProductOrders.java
@@ -0,0 +1,97 @@
+/*-
+ * ========================LICENSE_START=================================
+ * org.etsi.osl.osom
+ * %%
+ * Copyright (C) 2019 openslice.io
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================LICENSE_END==================================
+ */
+package org.etsi.osl.osom.management;
+
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.po622.model.ProductOrder;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateType;
+import org.etsi.osl.tmf.so641.model.ServiceOrder;
+import org.etsi.osl.tmf.so641.model.ServiceOrderStateType;
+import org.flowable.engine.TaskService;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.JavaDelegate;
+import org.flowable.task.api.Task;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component(value = "fetchAcknowledgedProductOrders") // bean name
+public class FetchAcknowledgedProductOrders implements JavaDelegate {
+
+	private static final transient Log logger = LogFactory.getLog(FetchAcknowledgedProductOrders.class.getName());
+
+
+    @Autowired
+    private ProductOrderManager productOrderManager;
+
+    @Autowired
+    private ServiceOrderManager serviceOrderManager;
+
+	@Autowired
+	private TaskService taskService;
+
+	
+	public void execute(DelegateExecution execution) {
+		logger.info("======================" + execution.getProcessDefinitionId()  + "======================================");
+		logger.info("FetchAcknowledgedProductOrders by Product Order Repository");
+
+		List<String> ordersToBeProcessed = null;
+		if (execution.getVariable("productOrdersToBeProcessed") instanceof ArrayList) {
+			ordersToBeProcessed = (ArrayList<String>) execution.getVariable("productOrdersToBeProcessed");
+			for (String orderid : ordersToBeProcessed) {
+				logger.info("productOrdersToBeProcessed From Previous = " + orderid);
+			}
+		} else {
+			ordersToBeProcessed = new ArrayList<>();
+		}
+
+		List<String> orderlist = productOrderManager.retrieveOrdersByState( ProductOrderStateType.ACKNOWLEDGED );
+		
+		if ( orderlist != null ) {
+			for (String orderid : orderlist) {
+				if ( !ordersToBeProcessed.contains( orderid )  ) {
+					
+
+					ProductOrder sor = productOrderManager.retrieveProductOrder( orderid );
+					if ( sor !=null && sor.getRequestedStartDate() != null ) {
+						Instant instant = Instant.now() ;                          // Capture the current moment as seen in UTC.
+						boolean canStart = sor.getRequestedStartDate().toInstant().isBefore( instant ) ;
+						
+						if ( canStart ) {
+							logger.info("Product order is scheduled to start now, orderid= "+ orderid +" date="+  sor.getRequestedStartDate().toInstant());
+							ordersToBeProcessed.add( orderid );	
+						} else {
+							logger.info("Product order is scheduled to start later, orderid= " + orderid );
+						}
+					}
+					
+				}
+			}	
+		}
+		
+		execution.setVariable("productOrdersToBeProcessed", ordersToBeProcessed);
+		
+
+
+	}
+}
diff --git a/src/main/java/org/etsi/osl/osom/management/InitializeProcessProductOrders.java b/src/main/java/org/etsi/osl/osom/management/InitializeProcessProductOrders.java
new file mode 100644
index 0000000..03ffa41
--- /dev/null
+++ b/src/main/java/org/etsi/osl/osom/management/InitializeProcessProductOrders.java
@@ -0,0 +1,220 @@
+/*-
+ * ========================LICENSE_START=================================
+ * org.etsi.osl.osom
+ * %%
+ * Copyright (C) 2019 openslice.io
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================LICENSE_END==================================
+ */
+package org.etsi.osl.osom.management;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.common.model.Any;
+import org.etsi.osl.tmf.common.model.service.Characteristic;
+import org.etsi.osl.tmf.common.model.service.Note;
+import org.etsi.osl.tmf.common.model.service.ServiceSpecificationRef;
+import org.etsi.osl.tmf.pcm620.model.ProductOffering;
+import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecification;
+import org.etsi.osl.tmf.po622.model.ProductOrder;
+import org.etsi.osl.tmf.po622.model.ProductOrderItem;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateType;
+import org.etsi.osl.tmf.po622.model.ProductOrderUpdate;
+import org.etsi.osl.tmf.prm669.model.RelatedParty;
+import org.etsi.osl.tmf.so641.model.ServiceOrder;
+import org.etsi.osl.tmf.so641.model.ServiceOrderCreate;
+import org.etsi.osl.tmf.so641.model.ServiceOrderItem;
+import org.etsi.osl.tmf.so641.model.ServiceOrderStateType;
+import org.etsi.osl.tmf.so641.model.ServiceRestriction;
+import org.flowable.engine.RuntimeService;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.JavaDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import jakarta.validation.Valid;
+
+@Component(value = "initializeProcessProductOrders") // bean name
+public class InitializeProcessProductOrders implements JavaDelegate {
+
+	private static final transient Log logger = LogFactory.getLog(InitializeProcessProductOrders.class.getName());
+
+	@Autowired
+	private ProductOrderManager productOrderManager;
+	
+
+    @Autowired
+    private ServiceOrderManager serviceOrderManager;
+    
+
+    @Value("${spring.application.name}")
+    private String compname;
+
+	@Autowired
+	private RuntimeService runtimeService;
+
+	public void execute(DelegateExecution execution) {
+
+		logger.info("Check if there are new Product Orders for Orchestration: " + execution.getVariables().toString());
+	
+
+		if (execution.getVariable("productOrdersToBeProcessed") instanceof ArrayList) {
+
+			List<String> ordersToBeProcessed = (ArrayList<String>) execution.getVariable("productOrdersToBeProcessed");
+			for (String oId : ordersToBeProcessed) {
+
+			  //process each order request
+			  processOrderRequest( oId );
+				
+			}
+
+		}
+
+	}
+
+  /**
+   * For each product order create a service order and perform the neccessary references
+   * @param oId
+   */
+  private void processOrderRequest(String oId) {
+      
+    //create equivalent service order
+    ProductOrder prodOrder = productOrderManager.retrieveProductOrder(oId);
+    logger.debug("Will send message that Product Order is IN-PROGRESS orderid= " + oId );
+    
+    ServiceOrder serviceOrder = createServiceOrderFromProductOrder(prodOrder);
+    
+    if (serviceOrder==null) {
+      logger.error("Service Order is NULL " );
+      
+      return;
+    }
+    
+    ProductOrderUpdate productOrderUpd = new ProductOrderUpdate();
+    productOrderUpd.setState(ProductOrderStateType.INPROGRESS);
+    for (ProductOrderItem poi : prodOrder.getProductOrderItem() ) {
+      if ( poi.getProduct() != null ) {
+        Characteristic charact = new Characteristic();
+        charact.setName("_SERVICE_ORDER_ID_");
+        charact.setValueType("TEXT");
+        charact.setValue(new Any( serviceOrder.getId() ));        
+        poi.getProduct().addProductCharacteristicItem(charact);
+      }
+      productOrderUpd.addProductOrderItemItem(poi);
+    }
+     
+    productOrderManager.updateProducteOrder( oId, productOrderUpd );                    
+    
+  }
+
+  private ServiceOrder createServiceOrderFromProductOrder(ProductOrder prodOrder) {
+
+
+    ServiceOrderCreate servOrder = new ServiceOrderCreate();
+    servOrder.setCategory("Automated order");
+    servOrder.setDescription("Automatically created for product order " + prodOrder.getId());
+    servOrder.setRequestedStartDate(prodOrder.getRequestedStartDate());
+    servOrder.setRequestedCompletionDate(prodOrder.getExpectedCompletionDate());
+    RelatedParty rpi = new RelatedParty();
+    rpi.setName("OSOM-ProductOrder");
+    rpi.setRole("REQUESTER");
+    rpi.setId("OSOM-ProductOrder");
+    servOrder.addRelatedPartyItem(rpi );
+
+    Note noteItemOrder = new Note();
+    noteItemOrder.text("Automatically created for product order " + prodOrder.getId());
+    noteItemOrder.setAuthor(compname);
+    servOrder.addNoteItem(noteItemOrder);
+
+    for (ProductOrderItem poi : prodOrder.getProductOrderItem()) {
+      @Valid
+      ProductOfferingRef poffRefpoi = poi.getProductOffering();
+
+      ProductOffering pOffer = productOrderManager.retrieveProductOffering(poffRefpoi.getId());
+      if (pOffer == null) {
+        logger.error("Product Order - ProductOffering in ProductOrderItem is NULL");
+        return null;
+      }
+      
+      if ( poi.getProduct() == null ) {
+        logger.error("Product Order - Product in ProductOrderItem is NULL");
+        return null;        
+      }
+
+      ProductSpecification pSepc =
+          productOrderManager.retrieveProductSpec(poi.getProduct().getProductSpecification().getId());
+      if (pSepc == null) {
+        logger.error("Product Order - ProductSpecification in Product, ProductOrderItem is NULL");
+        return null;
+      }
+
+      logger.debug("Product Order - ProductOffering name= " + pOffer.getName());
+      logger.debug("Product Order - ProductSpecification name= " + pSepc.getName());
+
+
+      for (ServiceSpecificationRef serviceSpec : pSepc.getServiceSpecification()) {
+        ServiceOrderItem soi = new ServiceOrderItem();
+        servOrder.getOrderItem().add(soi);
+        soi.setState(ServiceOrderStateType.ACKNOWLEDGED);
+
+        ServiceRestriction serviceRestriction = new ServiceRestriction();
+        ServiceSpecificationRef aServiceSpecificationRef = new ServiceSpecificationRef();
+        aServiceSpecificationRef.setId( serviceSpec.getId() );
+        aServiceSpecificationRef.setName( serviceSpec.getName());
+        aServiceSpecificationRef.setVersion( serviceSpec.getVersion());
+
+        serviceRestriction.setServiceSpecification(aServiceSpecificationRef);
+
+//        πρεπει να perasoyme τιμες από το product order στο service order item
+//        εδω debug
+        
+        for (Characteristic servChar : poi.getProduct().getProductCharacteristic()  ) {
+          servChar.setUuid(null);
+          serviceRestriction.addServiceCharacteristicItem(servChar);
+        }
+
+        
+
+        Characteristic refProductOrderChar = new Characteristic();
+        refProductOrderChar.setName("_PRODUCT_ORDER_ID_");
+        refProductOrderChar.setValueType("TEXT");
+        refProductOrderChar.setValue(new Any( prodOrder.getId() ));
+        serviceRestriction.addServiceCharacteristicItem(refProductOrderChar);
+        
+        Characteristic refProductOrderItemChar = new Characteristic();
+        refProductOrderItemChar.setName("_PRODUCT_ORDER_ITEM_ID_");
+        refProductOrderItemChar.setValueType("TEXT");
+        refProductOrderItemChar.setValue(new Any( poi.getId() ));
+        serviceRestriction.addServiceCharacteristicItem(refProductOrderItemChar);
+        
+        soi.setService(serviceRestriction);
+        
+      }
+      
+
+    }
+
+    ServiceOrder externalSOrder = serviceOrderManager.createServiceOrder(servOrder);
+
+
+    return externalSOrder;
+
+
+  }
+  
+  
+}
diff --git a/src/main/java/org/etsi/osl/osom/management/OrderCompleteService.java b/src/main/java/org/etsi/osl/osom/management/OrderCompleteService.java
index 8f39cd0..039f7ae 100644
--- a/src/main/java/org/etsi/osl/osom/management/OrderCompleteService.java
+++ b/src/main/java/org/etsi/osl/osom/management/OrderCompleteService.java
@@ -22,13 +22,18 @@ package org.etsi.osl.osom.management;
 import java.time.OffsetDateTime;
 import java.time.ZoneOffset;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.common.model.service.Characteristic;
 import org.etsi.osl.tmf.common.model.service.Note;
 import org.etsi.osl.tmf.common.model.service.ResourceRef;
 import org.etsi.osl.tmf.common.model.service.ServiceRef;
 import org.etsi.osl.tmf.common.model.service.ServiceStateType;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateType;
+import org.etsi.osl.tmf.po622.model.ProductOrderUpdate;
 import org.etsi.osl.tmf.ri639.model.Resource;
 import org.etsi.osl.tmf.sim638.model.Service;
 import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
@@ -54,6 +59,9 @@ public class OrderCompleteService implements JavaDelegate {
 
     @Autowired
     private ServiceOrderManager serviceOrderManager;
+
+    @Autowired
+    private ProductOrderManager productOrderManager;
     
 
     @Autowired
@@ -112,6 +120,7 @@ public class OrderCompleteService implements JavaDelegate {
 			boolean existsInactiveInORder= false;
 			boolean existsTerminatedInORder= false;
 			//boolean updateServiceOrder= false;
+			Map<String, Characteristic> productOrderIds = new HashMap<>();
 			
 			logger.info("ServiceOrder id:" + sOrder.getId());
 			for (ServiceOrderItem soi : sOrder.getOrderItem()) {
@@ -192,6 +201,12 @@ public class OrderCompleteService implements JavaDelegate {
 				allTerminatedItemsInOrder = allTerminatedItemsInOrder && soi.getState().equals( ServiceOrderStateType.COMPLETED );
 
 				logger.info("ServiceOrderItem state:" + sserviceState.toString() );
+				
+				Characteristic prodOrderChar = soi.getService().findCharacteristicByName("_PRODUCT_ORDER_ID_");
+				if ( prodOrderChar != null ) {
+				  productOrderIds.put( prodOrderChar.getValue().getValue(), prodOrderChar);
+				}
+				
 			}
 			
 			   
@@ -221,6 +236,20 @@ public class OrderCompleteService implements JavaDelegate {
 				
 				serviceOrderManager.updateServiceOrderOrder( sOrder.getId() , serviceOrderUpd);
 
+				//pass the state to related product orders, if any
+				for (String prodOredIds : productOrderIds.keySet()) {
+				  ProductOrderUpdate productOrderUpd = new ProductOrderUpdate();
+				  
+				  if ( serviceOrderUpd.getState().equals( ServiceOrderStateType.COMPLETED ) ) {
+				    productOrderUpd.setState( ProductOrderStateType.COMPLETED );
+				  } else if ( serviceOrderUpd.getState().equals( ServiceOrderStateType.FAILED ) ) {
+                    productOrderUpd.setState( ProductOrderStateType.FAILED );
+                  }  
+				  
+				    
+				  productOrderManager.updateProducteOrder(prodOredIds, productOrderUpd);
+                }
+				
 			}
 			
 		}
diff --git a/src/main/java/org/etsi/osl/osom/management/ProductOrderManager.java b/src/main/java/org/etsi/osl/osom/management/ProductOrderManager.java
new file mode 100644
index 0000000..19b9d6e
--- /dev/null
+++ b/src/main/java/org/etsi/osl/osom/management/ProductOrderManager.java
@@ -0,0 +1,175 @@
+package org.etsi.osl.osom.management;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.camel.ProducerTemplate;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.pcm620.model.ProductOffering;
+import org.etsi.osl.tmf.pcm620.model.ProductSpecification;
+import org.etsi.osl.tmf.po622.model.ProductOrder;
+import org.etsi.osl.tmf.po622.model.ProductOrderStateType;
+import org.etsi.osl.tmf.po622.model.ProductOrderUpdate;
+import org.etsi.osl.tmf.so641.model.ServiceOrder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import jakarta.validation.constraints.NotNull;
+
+@Service
+public class ProductOrderManager {
+
+
+  private static final transient Log logger =
+      LogFactory.getLog(ProductOrderManager.class.getName());
+
+
+  @Autowired
+  private ProducerTemplate template;
+
+  @Value("${CATALOG_GET_PRODUCTORDER_IDS_BY_STATE}")
+  private String CATALOG_GET_PRODUCTORDER_IDS_BY_STATE = "";
+
+  @Value("${CATALOG_GET_PRODUCTORDER_BY_ID}")
+  private String CATALOG_GET_PRODUCTORDER_BY_ID = "";
+
+
+  @Value("${CATALOG_UPD_PRODUCTORDER_BY_ID}")
+  private String CATALOG_UPD_PRODUCTORDER_BY_ID = "";
+
+
+  @Value("${CATALOG_GET_PRODUCTSPEC_BY_ID}")
+  private String CATALOG_GET_PRODUCTSPEC_BY_ID = "";
+
+
+  @Value("${CATALOG_GET_PRODUCTOFFERING_BY_ID}")
+  private String CATALOG_GET_PRODUCTOFFERING_BY_ID = "";
+  
+  
+
+  public List<String> retrieveOrdersByState(ProductOrderStateType orderState) {
+    logger.info("will retrieve Product Orders " + orderState.toString() + " from catalog ");
+    try {
+      Map<String, Object> map = new HashMap<>();
+      map.put("orderstate", orderState.toString());
+      Object response =
+          template.requestBodyAndHeaders(CATALOG_GET_PRODUCTORDER_IDS_BY_STATE, "", map);
+
+      logger.debug("will retrieve Service Orders " + orderState.toString()
+          + " from catalog response: " + response.getClass());
+      if (!(response instanceof String)) {
+        logger.error("List  object is wrong.");
+        return null;
+      }
+      // String[] sor = toJsonObj( (String)response, String[].class );
+
+      ArrayList<String> sor = toJsonObj((String) response, ArrayList.class);
+      logger.debug("retrieveOrdersByState response is: " + response);
+
+      // return asList(sor);
+      return sor;
+
+    } catch (Exception e) {
+      logger.error("Cannot retrieve Listof Product Orders " + orderState.toString()
+          + " from catalog. " + e.toString());
+    }
+    return null;
+  }
+
+  public ProductOrder retrieveProductOrder(String orderid) {
+    logger.info("will retrieve Product Order from catalog orderid=" + orderid);
+    try {
+      Object response = template.requestBody(CATALOG_GET_PRODUCTORDER_BY_ID, orderid);
+
+      if (!(response instanceof String)) {
+        logger.error("Product Order object is wrong.");
+        return null;
+      }
+      logger.debug("retrieveProductOrder response is: " + response);
+      ProductOrder sor = toJsonObj((String) response, ProductOrder.class);
+
+      return sor;
+
+    } catch (Exception e) {
+      logger.error("Cannot retrieve Product Order details from catalog. " + e.toString());
+    }
+    return null;
+  }
+
+
+
+  public ProductSpecification retrieveProductSpec(@NotNull String id) {
+    logger.info("will retrieve ProductSpecification from catalog orderid=" + id);
+    try {
+      Object response = template.requestBody(CATALOG_GET_PRODUCTSPEC_BY_ID, id);
+
+      if (!(response instanceof String)) {
+        logger.error("ProductSpecification object is wrong.");
+        return null;
+      }
+      logger.debug("retrieveProductSpecification response is: " + response);
+      ProductSpecification sor = toJsonObj((String) response, ProductSpecification.class);
+
+      return sor;
+
+    } catch (Exception e) {
+      logger.error("Cannot retrieve ProductSpecification  details from catalog. " + e.toString());
+    }
+    return null;
+  }
+
+  public ProductOffering retrieveProductOffering(@NotNull String id) {
+    logger.info("will retrieve ProductOffering from catalog orderid=" + id);
+    try {
+      Object response = template.requestBody(CATALOG_GET_PRODUCTOFFERING_BY_ID, id);
+
+      if (!(response instanceof String)) {
+        logger.error("ProductOffering object is wrong.");
+        return null;
+      }
+      logger.debug("retrievProductOffering response is: " + response);
+      ProductOffering sor = toJsonObj((String) response, ProductOffering.class);
+
+      return sor;
+
+    } catch (Exception e) {
+      logger.error("Cannot retrieve ProductOffering details from catalog. " + e.toString());
+    }
+    return null;
+  }
+
+
+
+  static <T> T toJsonObj(String content, Class<T> valueType) throws IOException {
+    ObjectMapper mapper = new ObjectMapper();
+    mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+    return mapper.readValue(content, valueType);
+  }
+
+  static String toJsonString(Object object) throws IOException {
+    ObjectMapper mapper = new ObjectMapper();
+    mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+    return mapper.writeValueAsString(object);
+  }
+
+  public void updateProducteOrder(String orderid, ProductOrderUpdate productOrderUpd) {
+    logger.info("will set Product Order in progress orderid=" + orderid);
+    try {
+
+      template.sendBodyAndHeader(CATALOG_UPD_PRODUCTORDER_BY_ID, toJsonString(productOrderUpd),
+          "orderid", orderid);
+
+
+    } catch (Exception e) {
+      logger.error("Cannot set Product Order status from catalog. " + e.toString());
+    }
+
+  }
+
+
+}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index fd9ed49..b99b5a1 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -75,6 +75,19 @@ NFV_CATALOG_GET_NSD_BY_ID: "jms:queue:NFVCATALOG.GET.NSD_BY_ID"
 NFV_CATALOG_UPD_DEPLOYMENT_BY_ID: "jms:queue:NFVCATALOG.UPD.DEPLOYMENT_BY_ID"
 NFV_CATALOG_NS_DAY2_ACTION: "jms:queue:ns.action.run"
 
+CATALOG_GET_PRODUCTSPEC_BY_ID: "jms:queue:CATALOG.GET.PRODUCTSPEC_BY_ID"
+CATALOG_ADD_PRODUCTSPEC: "jms:queue:CATALOG.ADD.PRODUCTSPEC"
+CATALOG_UPD_PRODUCTSPEC: "jms:queue:CATALOG.UPD.PRODUCTSPEC"
+CATALOG_UPDADD_PRODUCTSPEC: "jms:queue:CATALOG.UPDADD.PRODUCTSPEC"
+CATALOG_GET_PRODUCTOFFERING_BY_ID: "jms:queue:CATALOG.GET.PRODUCTOFFERING_BY_ID"
+
+CATALOG_GET_PRODUCTORDERS: "jms:queue:CATALOG.GET.PRODUCTORDERS"
+CATALOG_GET_PRODUCTORDER_BY_ID: "jms:queue:CATALOG.GET.PRODUCTORDER_BY_ID"
+CATALOG_ADD_PRODUCTORDER: "jms:queue:CATALOG.ADD.PRODUCTORDER"
+CATALOG_UPD_PRODUCTORDER_BY_ID: "jms:queue:CATALOG.UPD.PRODUCTORDER_BY_ID"
+CATALOG_GET_INITIAL_PRODUCTORDERS_IDS: "jms:queue:CATALOG.GET.INITIAL_PRODUCTORDERS"
+CATALOG_GET_PRODUCTORDER_IDS_BY_STATE: "jms:queue:CATALOG.GET.ACKNOWLEDGED_PRODUCTORDERS"
+
 #NS ACTIONS
 NFV_CATALOG_NSACTIONS_SCALE: "jms:queue:NSACTIONS.SCALE"
 
diff --git a/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java b/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java
index 7ef1c9d..34e2d5a 100644
--- a/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java
+++ b/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java
@@ -184,7 +184,7 @@ public class ProcessOrderIntegrationTest {
 		assertThat(specCirros.getServiceSpecCharacteristic().size()  ).isEqualTo(12);
 		assertThat(sorder.getOrderItem().stream().findFirst().get().getService().getServiceCharacteristic().size()  ).isEqualTo(2);
 
-		assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(15);
+		assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(16);
 		assertThat(taskService.createTaskQuery().count()).isEqualTo(0);
 
 		assertThat( scmocked.getRequeestedDescriptor() ).isNull();
-- 
GitLab


From bb0ce385d1536c392cd229f7d4acf1e10809784c Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Sat, 17 Aug 2024 01:08:48 +0300
Subject: [PATCH 02/31] add process bpmn

---
 .../processes/ProductOrderProcess.bpmn        | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 src/main/resources/processes/ProductOrderProcess.bpmn

diff --git a/src/main/resources/processes/ProductOrderProcess.bpmn b/src/main/resources/processes/ProductOrderProcess.bpmn
new file mode 100644
index 0000000..8ae9ca7
--- /dev/null
+++ b/src/main/resources/processes/ProductOrderProcess.bpmn
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="ProductOrderSchedulerProcess" name="My process" isExecutable="true">
+    <startEvent id="timerstarteventProdOrders" name="Timer start">
+      <timerEventDefinition>
+        <timeCycle>0 0/1 * * * ?</timeCycle>
+      </timerEventDefinition>
+    </startEvent>
+    <serviceTask id="stFetchAcknowledgedProductOrders" name="Fetch Acknowledged Product Orders" activiti:delegateExpression="${fetchAcknowledgedProductOrders}"></serviceTask>
+    <sequenceFlow id="flow1" sourceRef="timerstarteventProdOrders" targetRef="stFetchAcknowledgedProductOrders"></sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <sequenceFlow id="flow2" sourceRef="stFetchAcknowledgedProductOrders" targetRef="stInitializeProcessProductOrder"></sequenceFlow>
+    <serviceTask id="stInitializeProcessProductOrder" name="Initialize Process Product Order" activiti:delegateExpression="${initializeProcessProductOrders}"></serviceTask>
+    <sequenceFlow id="flow3" sourceRef="stInitializeProcessProductOrder" targetRef="endevent1"></sequenceFlow>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_ProductOrderSchedulerProcess">
+    <bpmndi:BPMNPlane bpmnElement="ProductOrderSchedulerProcess" id="BPMNPlane_ProductOrderSchedulerProcess">
+      <bpmndi:BPMNShape bpmnElement="timerstarteventProdOrders" id="BPMNShape_timerstarteventProdOrders">
+        <omgdc:Bounds height="35.0" width="35.0" x="60.0" y="148.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="stFetchAcknowledgedProductOrders" id="BPMNShape_stFetchAcknowledgedProductOrders">
+        <omgdc:Bounds height="71.0" width="121.0" x="190.0" y="130.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="580.0" y="148.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="stInitializeProcessProductOrder" id="BPMNShape_stInitializeProcessProductOrder">
+        <omgdc:Bounds height="71.0" width="141.0" x="380.0" y="130.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="95.0" y="165.0"></omgdi:waypoint>
+        <omgdi:waypoint x="190.0" y="165.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="311.0" y="165.0"></omgdi:waypoint>
+        <omgdi:waypoint x="380.0" y="165.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="521.0" y="165.0"></omgdi:waypoint>
+        <omgdi:waypoint x="580.0" y="165.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
-- 
GitLab


From 63d30904027e708f9ec2c28bcb42382a663f0b12 Mon Sep 17 00:00:00 2001
From: Dimitrios Giannopoulos <dimit.giannopoulos@upnet.gr>
Date: Fri, 30 Aug 2024 13:54:17 +0000
Subject: [PATCH 03/31] fix: strictly compare between strings

---
 .gitlab-ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bb7d754..40be386 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,7 +21,7 @@ include:
       - ci-templates/default.yml
       - ci-templates/build.yml
     rules:
-      - if: '$CI_COMMIT_REF_PROTECTED && $CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"'
+      - if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"'
 
   - project: osl/code/org.etsi.osl.main
     ref: develop
@@ -29,7 +29,7 @@ include:
       - ci-templates/default.yml
       - ci-templates/build_unprotected.yml
     rules:
-      - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && !$CI_COMMIT_REF_PROTECTED'
+      - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && $CI_COMMIT_REF_PROTECTED == "false"'
 
 maven_build:
   extends: .maven_build
-- 
GitLab


From a8b16f23c384cf89241087dd6fd2e7d14fbfa815 Mon Sep 17 00:00:00 2001
From: trantzas <ktrantzas@ece.upatras.gr>
Date: Tue, 17 Sep 2024 19:38:45 +0000
Subject: [PATCH 04/31] Development preparation for release 2024Q4

---
 Dockerfile | 6 +++---
 pom.xml    | 8 ++++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 68aefbc..c861b12 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,7 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk
 MAINTAINER openslice.io
 RUN mkdir /opt/shareclasses
 RUN mkdir -p /opt/openslice/lib/
-COPY target/org.etsi.osl.osom-1.0.0.jar /opt/openslice/lib/
-COPY target/org.etsi.osl.osom-1.0.0-exec.jar /opt/openslice/lib/
+COPY target/org.etsi.osl.osom-1.0.1-SNAPSHOT.jar /opt/openslice/lib/
+COPY target/org.etsi.osl.osom-1.0.1-SNAPSHOT-exec.jar /opt/openslice/lib/
 COPY . /opt/openslice/lib/
-CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses","-jar", "/opt/openslice/lib/org.etsi.osl.osom-1.0.0-exec.jar"]
\ No newline at end of file
+CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses","-jar", "/opt/openslice/lib/org.etsi.osl.osom-1.0.1-SNAPSHOT-exec.jar"]
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 9a6a469..d79871f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,16 +5,20 @@
 	<parent>
 		<groupId>org.etsi.osl</groupId>
 		<artifactId>org.etsi.osl.main</artifactId>
-		<version>1.0.0</version>
+		<version>2024Q4-SNAPSHOT</version>
 		<relativePath>../org.etsi.osl.main</relativePath>
 	</parent>
 
 
 	<artifactId>org.etsi.osl.osom</artifactId>
 	<name>org.etsi.osl.osom</name>
+	<version>${org.etsi.osl.osom.version}</version>
 	<url>http://maven.apache.org</url>
 
-
+	<organization>
+		<name>OpenSlice by ETSI</name>
+		<url>https://osl.etsi.org</url>
+	</organization>
 
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-- 
GitLab


From 5b36e7a900d68889e1efa27e82733c43e5d0907f Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 25 Oct 2024 20:13:30 +0300
Subject: [PATCH 05/31] fix for #25

---
 src/main/resources/application.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index fd9ed49..8e52aa4 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -103,7 +103,7 @@ CATALOG_ADD_RESOURCESPEC: "jms:queue:CATALOG.ADD.RESOURCESPEC"
 CATALOG_UPD_RESOURCESPEC: "jms:queue:CATALOG.UPD.RESOURCESPEC"
 CATALOG_UPDADD_RESOURCESPEC: "jms:queue:CATALOG.UPDADD.RESOURCESPEC"
 CATALOG_GET_RESOURCESPEC_BY_ID: "jms:queue:CATALOG.GET.RESOURCESPEC_BY_ID"
-CATALOG_GET_RESOURCESPEC_BY_ΝAME_CATEGORY: "jms:queue:CATALOG.GET.RESOURCESPEC_BY_ΝAME_CATEGORY"
+CATALOG_GET_RESOURCESPEC_BY_NAME_CATEGORY: "jms:queue:CATALOG.GET.RESOURCESPEC_BY_NAME_CATEGORY"
 
 #CRD ACTIONS
 CRD_DEPLOY_CR_REQ: "jms:queue:CRD.DEPLOY.CR_REQ"
-- 
GitLab


From ceffd3b1abb0d64938e06b6f28073458b4ad6dc5 Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 8 Nov 2024 16:52:12 +0200
Subject: [PATCH 06/31] fix for #26

---
 pom.xml                            | 1 +
 src/main/resources/application.yml | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d79871f..949684c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,6 +86,7 @@
 		<dependency>
 			<groupId>com.h2database</groupId>
 			<artifactId>h2</artifactId>
+			<version>2.3.232</version>
 		</dependency>
 		<dependency>
 			<groupId>org.etsi.osl</groupId>
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 8e52aa4..b5e9001 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,11 +1,14 @@
 server:
   port: 13689
     
+flowable:
+  history-level: none    
+  
 spring:
   application:
     name: openslice-osom
   datasource:
-    url: jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
+    url: jdbc:h2:~/temp/tempdb;DB_CLOSE_DELAY=-1
     password: sa
     username: sa
   jpa:
-- 
GitLab


From 788a47f09ee7246282cf05b71ea3a400492017f4 Mon Sep 17 00:00:00 2001
From: trantzas <ktrantzas@ece.upatras.gr>
Date: Thu, 14 Nov 2024 10:49:52 +0000
Subject: [PATCH 07/31] Reverting default osom's db to in memory. All the
 deployment files (docker-compose, helm) by default switch to local db. Fix
 for #26

---
 src/main/resources/application.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index b5e9001..26208b4 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -8,7 +8,7 @@ spring:
   application:
     name: openslice-osom
   datasource:
-    url: jdbc:h2:~/temp/tempdb;DB_CLOSE_DELAY=-1
+    url: jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
     password: sa
     username: sa
   jpa:
-- 
GitLab


From ac9e937ad53f3d191a36c5ab75205259a2ac154f Mon Sep 17 00:00:00 2001
From: Kostis Trantzas <ktrantzas@ece.upatras.gr>
Date: Mon, 18 Nov 2024 18:29:49 +0200
Subject: [PATCH 08/31] fix for #24

---
 .../org/etsi/osl/osom/management/CreateReservedService.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/CreateReservedService.java b/src/main/java/org/etsi/osl/osom/management/CreateReservedService.java
index d545ff9..0609bd0 100644
--- a/src/main/java/org/etsi/osl/osom/management/CreateReservedService.java
+++ b/src/main/java/org/etsi/osl/osom/management/CreateReservedService.java
@@ -310,7 +310,7 @@ public class CreateReservedService implements JavaDelegate {
 			if ( initCharValues != null ) {
 			  if ( initCharValues.get( c.getName() ) != null ) {
 			    Characteristic orderCharacteristic = new Characteristic()
-			        .value( new Any( initCharValues.get( c.getName() ), initCharValues.get( c.getName() ))) ;
+			        .value( new Any( initCharValues.get( c.getName() ), null ) );
                 serviceToCreate.addServiceCharacteristicItem( helperCreateCharacteristicItem(c, orderCharacteristic ) );
                 characteristicFound = true;
                 continue;
-- 
GitLab


From 4c6bdf5d480f4f6e7f9bbbef6458ab4ceee7cb0c Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Wed, 4 Dec 2024 19:59:06 +0200
Subject: [PATCH 09/31] Fix for Create generic controlller resources

---
 .../osl/osom/management/AutomationCheck.java  |   4 +-
 ...GCOrchestrationCheckDeploymentService.java | 130 ++++++
 .../management/GCOrchestrationService.java    | 390 ++++++++++++++++++
 .../osom/management/ServiceOrderManager.java  |  58 ++-
 .../resources/GenericResourceController.md    |  90 ++++
 .../GenericControllerDeploymentReq.bpmn       |  79 ++++
 .../processes/ServiceCreationProcess.bpmn     |  21 +
 7 files changed, 770 insertions(+), 2 deletions(-)
 create mode 100644 src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java
 create mode 100644 src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java
 create mode 100644 src/main/resources/GenericResourceController.md
 create mode 100644 src/main/resources/processes/GenericControllerDeploymentReq.bpmn

diff --git a/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java b/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
index d8aef5d..e55f373 100644
--- a/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
+++ b/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
@@ -89,7 +89,9 @@ public class AutomationCheck implements JavaDelegate {
 				execution.setVariable("brokeActivity", "RFS_OSM" ); 						
 			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") &&  ( spec.findSpecCharacteristicByName( "_CR_SPEC" ) != null ) ) {
 				execution.setVariable("brokeActivity", "RFS_CRSPEC" ); 						
-			} 		
+			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") ) {
+              execution.setVariable("brokeActivity", "GRSPEC" );                      
+          }		
 		}
 
 
diff --git a/src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java
new file mode 100644
index 0000000..7f8d9a4
--- /dev/null
+++ b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java
@@ -0,0 +1,130 @@
+/*-
+ * ========================LICENSE_START=================================
+ * org.etsi.osl.osom
+ * %%
+ * Copyright (C) 2019 openslice.io
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================LICENSE_END==================================
+ */
+package org.etsi.osl.osom.management;
+
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.common.model.service.Note;
+import org.etsi.osl.tmf.common.model.service.ResourceRef;
+import org.etsi.osl.tmf.common.model.service.ServiceStateType;
+import org.etsi.osl.tmf.ri639.model.Resource;
+import org.etsi.osl.tmf.sim638.model.Service;
+import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.JavaDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import jakarta.validation.Valid;
+
+
+@Component(value = "gcOrchestrationCheckDeploymentService") //bean name
+public class GCOrchestrationCheckDeploymentService implements JavaDelegate {
+
+	private static final transient Log logger = LogFactory.getLog(GCOrchestrationCheckDeploymentService.class.getName());
+
+
+
+    @Value("${spring.application.name}")
+    private String compname;
+
+	@Autowired
+	private ServiceOrderManager serviceOrderManager;
+	
+	public void execute(DelegateExecution execution) {
+
+		logger.info( "CROrchestrationCheckDeploymentService" );
+		logger.info( execution.getVariableNames().toString() );
+
+
+		if ( execution.getVariable("contextServiceId") == null) {
+
+			logger.error( "Variable contextServiceId is NULL!" );
+			execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
+			return;
+		}
+		Service aService = serviceOrderManager.retrieveService( (String) execution.getVariable("contextServiceId") );
+
+		if ( aService == null ) {
+			logger.info( "aService is null for contextServiceId = " +(String) execution.getVariable("contextServiceId") );			
+			execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
+			return;
+		}
+
+		execution.setVariable("serviceDeploymentFinished", Boolean.FALSE );
+
+		ServiceUpdate supd = new ServiceUpdate();
+		boolean propagateToSO = false;
+
+		//retrieve the related supporting resource by id and check its status
+		//ResourceRef supresourceRef = aService.getSupportingResource().stream().findFirst().get();//we assume for now we have only one related resource
+
+		List<Resource> rlist = new ArrayList<Resource>();
+        for (ResourceRef rref : aService.getSupportingResource()) {
+          Resource res = serviceOrderManager.retrieveResource(rref.getId());
+          
+          if (  res == null ) {
+            supd.setState( ServiceStateType.TERMINATED);
+            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE);
+            Service serviceResult = serviceOrderManager.updateService( aService.getId(), supd, propagateToSO );
+            return;
+          }
+          rlist.add(res);
+          
+        }
+        @Valid
+        ServiceStateType currentState = aService.getState();        
+        
+	    ServiceStateType nextState = aService.findNextStateBasedOnSupportingResources(rlist);
+	    
+	    if (!currentState.equals(nextState)) {
+	        supd.setState( nextState );     
+	        Note n = new Note();
+	        n.setText("Service Status Changed to: " +  nextState);
+	        n.setAuthor(compname);
+	        n.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+	        supd.addNoteItem(n);	        
+	        aService = serviceOrderManager.updateService( aService.getId(), supd, propagateToSO );	      
+	    }
+		
+		if ( aService!= null ) {
+			if ( aService.getState().equals(ServiceStateType.ACTIVE)
+					|| aService.getState().equals(ServiceStateType.TERMINATED)) {
+
+				logger.info("Deployment Status OK. Service state = " + aService.getState() );
+				execution.setVariable("serviceDeploymentFinished", Boolean.TRUE);
+				return;
+			}			
+		}
+		logger.info("Wait For Deployment Status. ");
+		
+		
+
+		
+		
+	}
+
+
+	
+}
diff --git a/src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java
new file mode 100644
index 0000000..5b041a6
--- /dev/null
+++ b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java
@@ -0,0 +1,390 @@
+/*-
+ * ========================LICENSE_START=================================
+ * org.etsi.osl.osom
+ * %%
+ * Copyright (C) 2019 openslice.io
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================LICENSE_END==================================
+ */
+package org.etsi.osl.osom.management;
+
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.common.model.Any;
+import org.etsi.osl.tmf.common.model.EValueType;
+import org.etsi.osl.tmf.common.model.service.Characteristic;
+import org.etsi.osl.tmf.common.model.service.Note;
+import org.etsi.osl.tmf.common.model.service.ResourceRef;
+import org.etsi.osl.tmf.common.model.service.ServiceStateType;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecification;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationCharacteristic;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationCharacteristicValue;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef;
+import org.etsi.osl.tmf.ri639.model.Resource;
+import org.etsi.osl.tmf.ri639.model.ResourceCreate;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecCharacteristic;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecification;
+import org.etsi.osl.tmf.sim638.model.Service;
+import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
+import org.etsi.osl.tmf.so641.model.ServiceOrder;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.JavaDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import jakarta.validation.Valid;
+
+
+@Component(value = "gcOrchestrationService") // bean name
+public class GCOrchestrationService implements JavaDelegate {
+
+  private static final transient Log logger =
+      LogFactory.getLog(GCOrchestrationService.class.getName());
+
+
+  @Value("${spring.application.name}")
+  private String compname;
+
+
+  @Autowired
+  private ServiceOrderManager serviceOrderManager;
+
+
+  public void execute(DelegateExecution execution) {
+
+    logger.info("Ceneric Controller OrchestrationService");
+    logger.info("VariableNames:" + execution.getVariableNames().toString());
+    logger.info("orderid:" + execution.getVariable("orderid").toString());
+    logger.info("contextServiceId:" + execution.getVariable("contextServiceId").toString());
+
+    try {
+      
+
+    ServiceUpdate su = new ServiceUpdate();// the object to update the service
+    Note noteItem = new Note();
+    noteItem.setText("");
+
+    if (execution.getVariable("contextServiceId") instanceof String contextServiceId)  {
+
+
+
+      ServiceOrder sorder =
+          serviceOrderManager.retrieveServiceOrder(execution.getVariable("orderid").toString());
+      Service aService =
+          serviceOrderManager.retrieveService( contextServiceId );
+      logger.info("Service name:" + aService.getName());
+      logger.info("Service state:" + aService.getState());
+      logger.info("Request for a Custom Resource creation for Service: " + aService.getId());
+
+      // we need to retrieve here the Service Spec of this service
+
+      ServiceSpecification spec =
+          serviceOrderManager.retrieveServiceSpec(aService.getServiceSpecificationRef().getId());
+
+      if (spec != null) {
+
+        
+        
+        
+        //we need to get the equivalent resource spec. since ServiceSpec is an RFS
+        ResourceSpecificationRef rSpecRef = spec.getResourceSpecification().stream().findFirst().get();
+        
+        ResourceSpecification rspec = serviceOrderManager.retrieveResourceSpec(rSpecRef.getId());
+        
+        //we will create a resource based on the values of resourcepsecificationRef
+        Resource resourceCR = createRelatedResource( rspec, sorder, aService );
+        ResourceRef rr = new ResourceRef();
+        rr.setId( resourceCR.getId() );
+        rr.setName( resourceCR.getName());
+        rr.setType( resourceCR.getType());
+        su.addSupportingResourceItem( rr );
+
+        Resource response = null;
+        
+        response = createNewResourceDeploymentRequest(aService, resourceCR, rspec, sorder.getId(), sorder.getStartDate(),
+              sorder.getExpectedCompletionDate() );
+        
+                
+        
+        if ( response!=null  ) {
+          su.setState(ServiceStateType.RESERVED);
+          Note successNoteItem = new Note();
+          successNoteItem.setText(String.format("Requesting Controller of "+ rSpecRef.getName() +" to deploy resource"));
+          successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+          successNoteItem.setAuthor(compname);
+          su.addNoteItem(successNoteItem);
+        } else {
+          su.setState(ServiceStateType.TERMINATED);
+          Note errNoteItem = new Note();
+          errNoteItem.setText(String.format("Requesting Controller to deploy resource failed "));
+          errNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+          errNoteItem.setAuthor(compname);
+          su.addNoteItem(errNoteItem);
+        }
+        Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
+        
+        return;
+
+      } else {
+
+        logger.error("Cannot retrieve ServiceSpecification for service :"
+            + (String) execution.getVariable("contextServiceId"));
+      }
+    } else {
+      logger.error("Cannot retrieve variable contextServiceId");
+    }
+
+    // if we get here something is wrong so we need to terminate the service.
+
+    
+    
+    }catch (Exception e) {
+      e.printStackTrace();
+    }
+    
+    
+    try {
+      Note noteItem = new Note();
+      noteItem.setText("Request to CR FAILED." + noteItem.getText());
+      noteItem.setAuthor(compname);
+      noteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+      ServiceUpdate su = new ServiceUpdate();// the object to update the service
+      su.addNoteItem(noteItem);
+      su.setState(ServiceStateType.TERMINATED);
+      serviceOrderManager.updateService(execution.getVariable("contextServiceId").toString(), su,
+          false);
+    }catch (Exception e) {
+      e.printStackTrace();
+    }
+
+  }
+
+
+  /**
+   * 
+   * THe resource has a temporary name.
+   * later on the name and its characteristics are updated via the generic controller
+   * 
+   * 
+   * @param rSpecRef
+   * @param sOrder
+   * @param aService
+   * @return
+   */
+  private Resource createRelatedResource(ResourceSpecification rspec, ServiceOrder sOrder, Service aService) {
+    
+    /**
+     * In future releases, it is better to create some helper function in the TMF model that
+     * Creates a resource from a resource specification, (or a service from a servic spec). 
+     * There are similar functions in other places, so it is better to move them in one place
+     */
+    ResourceCreate resCreate = new ResourceCreate();
+    resCreate.setName(  rspec.getName()+"-" + aService.getId() );
+    resCreate.setCategory( rspec.getCategory() );
+    resCreate.resourceVersion( rspec.getVersion() );
+    
+    resCreate.setStartOperatingDate( aService.getStartDate() );
+    resCreate.setEndOperatingDate(aService.getEndDate());
+    ResourceSpecificationRef rSpecRefObj = new ResourceSpecificationRef() ;
+    rSpecRefObj.id(rspec.getId())
+      .version(rspec.getVersion())
+      .name( rspec.getName())
+      .setType(rspec.getType());
+    resCreate.setResourceSpecification(rSpecRefObj); 
+    
+    
+    for (ResourceSpecificationCharacteristic c : rspec.getResourceSpecCharacteristic()) {
+      for (Characteristic orderCharacteristic : aService.getServiceCharacteristic() ) {
+          String specCharacteristicToSearch = c.getName();
+           if ( orderCharacteristic.getName().equals( specCharacteristicToSearch )) { //copy only characteristics that are related from the order     
+              
+             resCreate.addResourceCharacteristicItem(  addResourceCharacteristicItem(c, orderCharacteristic) );
+             break;
+          }
+      }
+    }
+    
+    //copy to resource the rest of the characteristics that do not exists yet from the above search
+    copyRemainingSpecCharacteristicsToResourceCharacteristic(rspec , resCreate.getResourceCharacteristic() );     
+    
+    return serviceOrderManager.createResource( resCreate, sOrder, rspec.getId() );
+
+    
+    
+  }
+  
+  
+  private org.etsi.osl.tmf.ri639.model.Characteristic addResourceCharacteristicItem(ResourceSpecificationCharacteristic c, Characteristic orderCharacteristic) {
+    org.etsi.osl.tmf.ri639.model.Characteristic resCharacteristicItem =  new org.etsi.osl.tmf.ri639.model.Characteristic();
+    resCharacteristicItem.setName( c.getName() );
+    resCharacteristicItem.setValueType( c.getValueType() );
+                
+    Any val = new Any();
+    val.setValue( orderCharacteristic.getValue().getValue() );
+    val.setAlias( orderCharacteristic.getValue().getAlias() );
+    
+    resCharacteristicItem.setValue( val );
+    
+    return resCharacteristicItem;
+  }
+  
+  
+  /**
+   * 
+   * This helper function it is better in future to be moved in the TMF model.
+   * There is similar in resource order
+   * 
+   * @param spec
+   * @param list
+   */
+  private void copyRemainingSpecCharacteristicsToResourceCharacteristic(ResourceSpecification spec,
+      @Valid List<org.etsi.osl.tmf.ri639.model.Characteristic> list) {
+    for (ResourceSpecificationCharacteristic sourceCharacteristic : spec.getResourceSpecCharacteristic()) {
+        if (  sourceCharacteristic.getValueType() != null ) {
+            boolean charfound = false;
+            for (org.etsi.osl.tmf.ri639.model.Characteristic destchar : list) {
+                if ( destchar.getName().equals(sourceCharacteristic.getName())) {
+                    charfound = true;
+                    break;
+                }
+            }
+            
+            if (!charfound) {
+            
+                org.etsi.osl.tmf.ri639.model.Characteristic newChar = new org.etsi.osl.tmf.ri639.model.Characteristic();
+                newChar.setName( sourceCharacteristic.getName() );
+                newChar.setValueType( sourceCharacteristic.getValueType() );
+                
+                if (  sourceCharacteristic.getValueType() != null && sourceCharacteristic.getValueType().equals( EValueType.ARRAY.getValue() ) ||
+                         sourceCharacteristic.getValueType() != null && sourceCharacteristic.getValueType().equals( EValueType.SET.getValue() ) ) {
+                    String valString = "";
+                    for (ResourceSpecificationCharacteristicValue specchar : sourceCharacteristic.getResourceSpecCharacteristicValue()) {
+                        if ( ( specchar.isIsDefault()!= null) && specchar.isIsDefault() ) {
+                            if ( !valString.equals("")) {
+                                valString = valString + ",";
+                            }
+                            valString = valString + "{\"value\":\"" + specchar.getValue().getValue() + "\",\"alias\":\"" + specchar.getValue().getAlias() + "\"}";
+                        }
+                        
+                    }
+                    
+                    newChar.setValue( new Any( "[" + valString + "]", "") );
+                    
+                    
+                } else {
+                    for (ResourceSpecificationCharacteristicValue specchar : sourceCharacteristic.getResourceSpecCharacteristicValue()) {
+                        if ( ( specchar.isIsDefault()!= null) && specchar.isIsDefault() ) {
+                            newChar.setValue( new Any(
+                                    specchar.getValue().getValue(), 
+                                    specchar.getValue().getAlias()) );
+                            break;
+                        }else {
+                            if (specchar.isIsDefault()== null){
+  
+                            logger.info("specchar is null value: " + sourceCharacteristic.getName() );
+                            }
+                        }
+  
+                    }                       
+                }
+                
+                
+                if ( newChar.getValue() !=null) {
+                    list.add(newChar );
+                } else {
+                    newChar.setValue( new Any(
+                            "", 
+                            "") );
+                    list.add(newChar );
+                }
+                
+            }
+            
+        }
+        
+        
+    }
+    
+  }
+
+
+  /**
+   * 
+   * This function makes a new deployment resource request for a resource  specification.
+   * The request is performed via the message queue.
+   * The function sends also some headers that maybe are needed for deployment
+   * These are the headers
+   * <br>
+   * <br><b>org.etsi.osl.serviceId:</b> This is the related service id that the created resource has a reference
+   * <br><b>org.etsi.osl.resourceId:</b> This is the related resource id that the created CR will wrap and reference. There
+   * <br><b>org.etsi.osl.prefixName:</b> we need to add a short prefix (default is cr) to various places. For example in K8s cannot start with a number
+   * <br><b>org.etsi.osl.serviceOrderId:</b> the related service order id of this deployment request
+   * <br>
+   * 
+   * @param aService reference to the service that the resource and the CR belongs to
+   * @param aResource reference the equivalent resource in TMF repo of the target CR. One to one mapping
+   * @param orderId related service order ID
+   * @param startDate start date of the deployment  (not used currently)
+   * @param endDate end date of the deployment (not used currently)
+   * @return a Resource as updated. It might return "OK" if everything is ok. 
+   * "SEE OTHER" if there are multiple CRIDGEs then some other cridge will handle the request for the equivalent cluster. 
+   * Any other response is handled as error
+   */
+  private Resource createNewResourceDeploymentRequest( Service aService,
+      Resource aResource, 
+      ResourceSpecification rRef, 
+      String orderId,
+      OffsetDateTime startDate,
+      OffsetDateTime endDate) {
+
+    try {
+      Map<String, Object> map = new HashMap<>();
+      map.put("org.etsi.osl.serviceId", aService.getId() );
+      map.put("org.etsi.osl.resourceId", aResource.getId() );
+      map.put("org.etsi.osl.prefixName", "gr" + aResource.getId().substring(0, 8) );
+      map.put("org.etsi.osl.serviceOrderId", orderId );
+      
+
+      logger.debug("createNewResourceDeploymentRequest ");
+      
+      String queueName = "jms:queue:CREATE/"+aResource.getCategory() + "/" + rRef.getVersion() ;
+      Resource response  = serviceOrderManager.gcGenericResourceDeploymentRequest(queueName , map, aResource);
+      
+
+      return response;
+      
+    } catch (Exception e) {
+      logger.error("cridgeDeploymentRequest failed");
+      e.printStackTrace();
+    }
+
+    return null;
+
+  }
+
+
+  private Object getServiceCharacteristic(Service aService, String val) {
+    if (aService.getServiceCharacteristicByName( val ) !=null ) {
+      return aService.getServiceCharacteristicByName( val ).getValue().getValue();
+    }
+    return "";
+  }
+
+
+}
diff --git a/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java b/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
index 6290743..336e487 100644
--- a/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
+++ b/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
@@ -36,6 +36,8 @@ import org.etsi.osl.model.nfv.NetworkServiceDescriptor;
 import org.etsi.osl.model.nfv.ScaleDescriptor;
 import org.etsi.osl.osom.serviceactions.NSActionRequestPayload;
 import org.etsi.osl.tmf.pm632.model.Organization;
+import org.etsi.osl.tmf.rcm634.model.LogicalResourceSpecification;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecification;
 import org.etsi.osl.tmf.ri639.model.LogicalResource;
 import org.etsi.osl.tmf.ri639.model.PhysicalResource;
 import org.etsi.osl.tmf.ri639.model.Resource;
@@ -188,7 +190,9 @@ public class ServiceOrderManager {
     @Value("${CATALOG_GET_RESOURCE_BY_ID}")
     private String CATALOG_GET_RESOURCE_BY_ID = "";
     
-    
+
+    @Value("${CATALOG_GET_RESOURCESPEC_BY_ID}")
+    private String CATALOG_GET_RESOURCESPEC_BY_ID = "";
 	
 	@Transactional
 	public void processOrder(ServiceOrder serviceOrder) {
@@ -1082,6 +1086,58 @@ public class ServiceOrderManager {
     
   }
 
+  public Resource gcGenericResourceDeploymentRequest(String queueName, Map<String, Object> map, Resource aResource) {
+    try {
+
+      logger.debug("gcGenericResourceDeploymentRequest queueName=" + queueName);
+      
+      String req = toJsonString(aResource);
+      Object response = template.requestBodyAndHeaders( queueName, req , map );
+        
+
+        if ( !(response instanceof String)) {
+            logger.error("gcGenericResourceDeploymentRequest response object is wrong.");
+            return null;
+        }
+        logger.debug("gcGenericResourceDeploymentRequest response is: " + response);
+        Resource res = toJsonObj( (String)response, LogicalResource.class);
+        return  res;
+        
+    }catch (Exception e) {
+        logger.error("Cannot retrieve gcGenericResourceDeploymentRequest response. " + e.toString());
+        e.printStackTrace();
+    }
+    return null;
+  }
+  
+  /**
+   * get  service spec by id from model via bus
+   * @param id
+   * @return
+   * @throws IOException
+   */
+  public ResourceSpecification retrieveResourceSpec(String specid) {
+      logger.info("will retrieve Resource Specification id=" + specid   );
+      
+      try {
+          Object response = template.
+                  requestBody( CATALOG_GET_RESOURCESPEC_BY_ID, specid);
+
+          if ( !(response instanceof String)) {
+              logger.error("Resource Specification object is wrong.");
+              return null;
+          }
+          LogicalResourceSpecification sor = toJsonObj( (String)response, LogicalResourceSpecification.class); 
+          //logger.debug("retrieveSpec response is: " + response);
+          return sor;
+          
+      }catch (Exception e) {
+          logger.error("Cannot retrieve Resource Specification details from catalog. " + e.toString());
+      }
+      return null;
+  }
+  
+
 
 
 }
diff --git a/src/main/resources/GenericResourceController.md b/src/main/resources/GenericResourceController.md
new file mode 100644
index 0000000..55b4418
--- /dev/null
+++ b/src/main/resources/GenericResourceController.md
@@ -0,0 +1,90 @@
+@startuml
+
+group Controller Startup [Controller Registration]
+
+	control "ResourceController" as ResourceController
+	entity "TMFAPI" as TMFAPI
+	queue MQa
+	
+    ResourceController -> MQa: RegisterResourceSpec
+    MQa -> TMFAPI: RegisterResourceSpec
+    note left
+    	Register a ResourceSpec with
+    	Name, Category, Version
+    end note
+    ResourceController -> MQa: QueueRegister
+    note left
+    	CREATE/<category_name>/<version>
+    	UPDATE/<category_name>/<version>
+    	DELETE/<category_name>/<version>    
+    end note
+
+	
+end	
+
+
+group Create RFS [Create RFS and underlying resource]
+	control "ResourceController" as ResourceController
+	entity "TMFAPI" as TMFAPI
+	queue MQa
+	entity "OSOM" as OSOM
+
+
+    TMFAPI -> OSOM: ServiceOrderCreate
+
+    OSOM -> OSOM: ServiceCreateTMF
+    	OSOM->MQa    : ServiceCreateMSG
+    	MQa -> TMFAPI: ServiceCreateMSG    	
+    	activate TMFAPI
+    	return Service 
+    	MQa -> OSOM: Service
+    	
+    	OSOM -> OSOM: ResourceCreateTMF
+    	
+    	OSOM->MQa    : ResourceCreateMSG
+    	MQa -> TMFAPI: ResourceCreate MSG   	
+    	activate TMFAPI
+    	return Resource 
+    	MQa -> OSOM: Resource       
+    	
+    		
+    	OSOM -> OSOM: ResourceDeployment
+    	OSOM -> MQa    : CreateGenericResourceMSG
+    	note left
+    		Header contains
+    		more metadata
+    		(ServiceID, ResourceID, OrderID)    	    
+    	end note
+    	MQa -> ResourceController: CreateGenericResourceMSG [CREATE/<category_name>/<version>]
+    	
+    	OSOM -> OSOM: WaitFor resourceStatus
+
+end
+
+
+group Resource Controller Process[Process underlying resource]
+    	ResourceController -> ResourceController: ProcessRequest
+
+    	ResourceController->MQa    : ResourceUpdate
+    	MQa -> TMFAPI: ResourceUpdate   
+    	activate TMFAPI
+    	return Resource  	
+    	MQa -> ResourceController: Resource  
+
+end
+
+group OSOM Check Deployment [Wait for underlying resource]
+    	OSOM -> OSOM: WaitFor resourceStatus
+    	OSOM->MQa: Check GETResource
+    	MQa -> TMFAPI: GETResource  
+    	activate TMFAPI
+    	return Resource  	
+    	MQa -> OSOM: Resource  
+    	note left
+    		Check resource Status
+    		(e.g. ACTIVE or RESERVED or ALARM)   	    
+    	end note
+end
+	
+
+@enduml
\ No newline at end of file
diff --git a/src/main/resources/processes/GenericControllerDeploymentReq.bpmn b/src/main/resources/processes/GenericControllerDeploymentReq.bpmn
new file mode 100644
index 0000000..ac06cd0
--- /dev/null
+++ b/src/main/resources/processes/GenericControllerDeploymentReq.bpmn
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="procGenericControllerDeploymentRequest" name="Generic Controller Deployment Request process" isExecutable="true">
+    <startEvent id="startevent1" name="Start"></startEvent>
+    <serviceTask id="stGCCreatetask" name="Generic Controller Create Task" activiti:delegateExpression="${gcOrchestrationService}"></serviceTask>
+    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="stGCCreatetask"></sequenceFlow>
+    <serviceTask id="stCheckGCServiceDeployment" name="Check Generic Controller Service Deployment" activiti:delegateExpression="${gcOrchestrationCheckDeploymentService}"></serviceTask>
+    <sequenceFlow id="flow2" sourceRef="stGCCreatetask" targetRef="stCheckGCServiceDeployment"></sequenceFlow>
+    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
+    <sequenceFlow id="flow3" sourceRef="stCheckGCServiceDeployment" targetRef="exclusivegateway1"></sequenceFlow>
+    <intermediateCatchEvent id="timerintermediatecatchevent1" name="Timer start wait 30 secs">
+      <timerEventDefinition>
+        <timeDuration>PT30S</timeDuration>
+      </timerEventDefinition>
+    </intermediateCatchEvent>
+    <sequenceFlow id="flowserviceDeploymentNotFinished" name="Service Deployment Not Finished" sourceRef="exclusivegateway1" targetRef="timerintermediatecatchevent1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!serviceDeploymentFinished}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow5" sourceRef="timerintermediatecatchevent1" targetRef="stCheckGCServiceDeployment"></sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <sequenceFlow id="flowServiceDeploymentFinished" name="Service Deployment Finished" sourceRef="exclusivegateway1" targetRef="endevent1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${serviceDeploymentFinished}]]></conditionExpression>
+    </sequenceFlow>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_procGenericControllerDeploymentRequest">
+    <bpmndi:BPMNPlane bpmnElement="procGenericControllerDeploymentRequest" id="BPMNPlane_procGenericControllerDeploymentRequest">
+      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="121.0" y="145.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="stGCCreatetask" id="BPMNShape_stGCCreatetask">
+        <omgdc:Bounds height="63.0" width="105.0" x="210.0" y="130.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="stCheckGCServiceDeployment" id="BPMNShape_stCheckGCServiceDeployment">
+        <omgdc:Bounds height="83.0" width="111.0" x="390.0" y="120.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
+        <omgdc:Bounds height="40.0" width="40.0" x="700.0" y="147.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="timerintermediatecatchevent1" id="BPMNShape_timerintermediatecatchevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="593.0" y="250.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="850.0" y="150.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="156.0" y="162.0"></omgdi:waypoint>
+        <omgdi:waypoint x="210.0" y="161.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="315.0" y="161.0"></omgdi:waypoint>
+        <omgdi:waypoint x="390.0" y="161.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="501.0" y="161.0"></omgdi:waypoint>
+        <omgdi:waypoint x="700.0" y="167.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flowserviceDeploymentNotFinished" id="BPMNEdge_flowserviceDeploymentNotFinished">
+        <omgdi:waypoint x="720.0" y="187.0"></omgdi:waypoint>
+        <omgdi:waypoint x="719.0" y="267.0"></omgdi:waypoint>
+        <omgdi:waypoint x="628.0" y="267.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="42.0" width="100.0" x="721.0" y="208.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="593.0" y="267.0"></omgdi:waypoint>
+        <omgdi:waypoint x="445.0" y="267.0"></omgdi:waypoint>
+        <omgdi:waypoint x="445.0" y="203.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flowServiceDeploymentFinished" id="BPMNEdge_flowServiceDeploymentFinished">
+        <omgdi:waypoint x="740.0" y="167.0"></omgdi:waypoint>
+        <omgdi:waypoint x="850.0" y="167.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="42.0" width="100.0" x="739.0" y="132.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
diff --git a/src/main/resources/processes/ServiceCreationProcess.bpmn b/src/main/resources/processes/ServiceCreationProcess.bpmn
index cce6e03..1fb3993 100644
--- a/src/main/resources/processes/ServiceCreationProcess.bpmn
+++ b/src/main/resources/processes/ServiceCreationProcess.bpmn
@@ -80,6 +80,11 @@
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${brokeActivity=='RFS_CRSPEC'}]]></conditionExpression>
     </sequenceFlow>
     <sequenceFlow id="flow44" sourceRef="parallelActivityCRDeploymentReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
+    <callActivity id="activityGenericResourceDeploymentReq" name="Generic Resource Deployment Request" calledElement="procGenericControllerDeploymentRequest" activiti:inheritVariables="true"></callActivity>
+    <sequenceFlow id="flow45" name="brokeActivity==&quot;GRSPEC&quot;" sourceRef="exclusivegateway2" targetRef="activityGenericResourceDeploymentReq">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${brokeActivity=='GRSPEC'}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow46" sourceRef="activityGenericResourceDeploymentReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
   </process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_CreateServiceProcess">
     <bpmndi:BPMNPlane bpmnElement="CreateServiceProcess" id="BPMNPlane_CreateServiceProcess">
@@ -140,6 +145,9 @@
       <bpmndi:BPMNShape bpmnElement="parallelActivityCRDeploymentReq" id="BPMNShape_parallelActivityCRDeploymentReq">
         <omgdc:Bounds height="90.0" width="129.0" x="1094.0" y="332.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="activityGenericResourceDeploymentReq" id="BPMNShape_activityGenericResourceDeploymentReq">
+        <omgdc:Bounds height="71.0" width="130.0" x="1094.0" y="820.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19">
         <omgdi:waypoint x="72.0" y="230.0"></omgdi:waypoint>
         <omgdi:waypoint x="100.0" y="231.0"></omgdi:waypoint>
@@ -296,6 +304,19 @@
         <omgdi:waypoint x="1223.0" y="377.0"></omgdi:waypoint>
         <omgdi:waypoint x="1355.0" y="376.0"></omgdi:waypoint>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow45" id="BPMNEdge_flow45">
+        <omgdi:waypoint x="907.0" y="250.0"></omgdi:waypoint>
+        <omgdi:waypoint x="907.0" y="855.0"></omgdi:waypoint>
+        <omgdi:waypoint x="1094.0" y="855.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="42.0" width="100.0" x="910.0" y="789.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow46" id="BPMNEdge_flow46">
+        <omgdi:waypoint x="1224.0" y="855.0"></omgdi:waypoint>
+        <omgdi:waypoint x="1407.0" y="855.0"></omgdi:waypoint>
+        <omgdi:waypoint x="1407.0" y="412.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </definitions>
\ No newline at end of file
-- 
GitLab


From c3826c443cb18822b4fcddd46fbf8cc86f9d9200 Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 6 Dec 2024 10:31:09 +0200
Subject: [PATCH 10/31] fixes for generic controller support

---
 .../management/CROrchestrationService.java    |  21 +-
 .../management/GCOrchestrationService.java    |  81 +++----
 .../osom/management/ServiceOrderManager.java  |   6 +-
 .../AutomaticallyHandleAction.java            | 204 +++++++++++++++++-
 4 files changed, 264 insertions(+), 48 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/CROrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/CROrchestrationService.java
index 235012d..cff7c1e 100644
--- a/src/main/java/org/etsi/osl/osom/management/CROrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/CROrchestrationService.java
@@ -108,6 +108,15 @@ public class CROrchestrationService implements JavaDelegate {
         rr.setName( resourceCR.getName());
         rr.setType( resourceCR.getType());
         su.addSupportingResourceItem( rr );
+        su.setState(ServiceStateType.RESERVED);
+        Note successNoteItem = new Note();
+        successNoteItem.setText(String.format("Requesting CRIDGE to deploy crspec"));
+        successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+        successNoteItem.setAuthor(compname);
+        su.addNoteItem(successNoteItem);        
+        Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
+        
+        
 
         String response = null;
         if (crspec != null) {
@@ -120,22 +129,16 @@ public class CROrchestrationService implements JavaDelegate {
         servicecrspecLast.getValue().setValue( crspec );
         su.addServiceCharacteristicItem(servicecrspecLast);
         
-        if ( response!=null && response.equals("OK")) {
-          su.setState(ServiceStateType.RESERVED);
-          Note successNoteItem = new Note();
-          successNoteItem.setText(String.format("Requesting CRIDGE to deploy crspec"));
-          successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
-          successNoteItem.setAuthor(compname);
-          su.addNoteItem(successNoteItem);
-        } else {
+        if ( response==null || !response.equals("OK")) {
+          su = new ServiceUpdate();
           su.setState(ServiceStateType.TERMINATED);
           Note errNoteItem = new Note();
           errNoteItem.setText(String.format("Requesting CRIDGE to deploy crspec failed with message: " + response));
           errNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
           errNoteItem.setAuthor(compname);
           su.addNoteItem(errNoteItem);
+          supd = serviceOrderManager.updateService(aService.getId(), su, false);
         }
-        Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
         
         return;
 
diff --git a/src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java
index 5b041a6..a7e0dea 100644
--- a/src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationService.java
@@ -68,10 +68,10 @@ public class GCOrchestrationService implements JavaDelegate {
 
   public void execute(DelegateExecution execution) {
 
-    logger.info("Ceneric Controller OrchestrationService");
-    logger.info("VariableNames:" + execution.getVariableNames().toString());
-    logger.info("orderid:" + execution.getVariable("orderid").toString());
-    logger.info("contextServiceId:" + execution.getVariable("contextServiceId").toString());
+    logger.debug("Ceneric Controller OrchestrationService");
+    logger.debug("VariableNames:" + execution.getVariableNames().toString());
+    logger.debug("orderid:" + execution.getVariable("orderid").toString());
+    logger.debug("contextServiceId:" + execution.getVariable("contextServiceId").toString());
 
     try {
       
@@ -108,36 +108,42 @@ public class GCOrchestrationService implements JavaDelegate {
         ResourceSpecification rspec = serviceOrderManager.retrieveResourceSpec(rSpecRef.getId());
         
         //we will create a resource based on the values of resourcepsecificationRef
-        Resource resourceCR = createRelatedResource( rspec, sorder, aService );
+        ResourceCreate resourceCreate = createRelatedResource( rspec, sorder, aService );
+        
+
+        //save it to TMF API service inventory
+        Resource resourceI = serviceOrderManager.createResource( resourceCreate, sorder, rspec.getId() );
+        
+        
         ResourceRef rr = new ResourceRef();
-        rr.setId( resourceCR.getId() );
-        rr.setName( resourceCR.getName());
-        rr.setType( resourceCR.getType());
+        rr.setId( resourceI.getId() );
+        rr.setName( resourceI.getName());
+        rr.setType( resourceI.getType());
         su.addSupportingResourceItem( rr );
 
+        su.setState(ServiceStateType.RESERVED);
+        Note successNoteItem = new Note();
+        successNoteItem.setText(String.format("Requesting Controller of "+ rSpecRef.getName() +" to deploy resource"));
+        successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+        successNoteItem.setAuthor(compname);
+        su.addNoteItem(successNoteItem);
+        Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
+        
         Resource response = null;
         
-        response = createNewResourceDeploymentRequest(aService, resourceCR, rspec, sorder.getId(), sorder.getStartDate(),
-              sorder.getExpectedCompletionDate() );
+        response = createNewResourceDeploymentRequest(aService, resourceI, resourceCreate,  sorder.getId() );
         
                 
         
-        if ( response!=null  ) {
-          su.setState(ServiceStateType.RESERVED);
-          Note successNoteItem = new Note();
-          successNoteItem.setText(String.format("Requesting Controller of "+ rSpecRef.getName() +" to deploy resource"));
-          successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
-          successNoteItem.setAuthor(compname);
-          su.addNoteItem(successNoteItem);
-        } else {
+        if ( response==null  ) {
           su.setState(ServiceStateType.TERMINATED);
           Note errNoteItem = new Note();
           errNoteItem.setText(String.format("Requesting Controller to deploy resource failed "));
           errNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
           errNoteItem.setAuthor(compname);
           su.addNoteItem(errNoteItem);
+          supd = serviceOrderManager.updateService(aService.getId(), su, false);
         }
-        Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
         
         return;
 
@@ -187,7 +193,7 @@ public class GCOrchestrationService implements JavaDelegate {
    * @param aService
    * @return
    */
-  private Resource createRelatedResource(ResourceSpecification rspec, ServiceOrder sOrder, Service aService) {
+  private ResourceCreate createRelatedResource(ResourceSpecification rspec, ServiceOrder sOrder, Service aService) {
     
     /**
      * In future releases, it is better to create some helper function in the TMF model that
@@ -221,9 +227,9 @@ public class GCOrchestrationService implements JavaDelegate {
     }
     
     //copy to resource the rest of the characteristics that do not exists yet from the above search
-    copyRemainingSpecCharacteristicsToResourceCharacteristic(rspec , resCreate.getResourceCharacteristic() );     
+    resCreate = copyRemainingSpecCharacteristicsToResourceCharacteristic(rspec , resCreate );     
     
-    return serviceOrderManager.createResource( resCreate, sOrder, rspec.getId() );
+    return resCreate;
 
     
     
@@ -253,8 +259,11 @@ public class GCOrchestrationService implements JavaDelegate {
    * @param spec
    * @param list
    */
-  private void copyRemainingSpecCharacteristicsToResourceCharacteristic(ResourceSpecification spec,
-      @Valid List<org.etsi.osl.tmf.ri639.model.Characteristic> list) {
+  private ResourceCreate copyRemainingSpecCharacteristicsToResourceCharacteristic(ResourceSpecification spec,
+      @Valid ResourceCreate resCreate) {
+    
+    List<org.etsi.osl.tmf.ri639.model.Characteristic> list = resCreate.getResourceCharacteristic();
+    
     for (ResourceSpecificationCharacteristic sourceCharacteristic : spec.getResourceSpecCharacteristic()) {
         if (  sourceCharacteristic.getValueType() != null ) {
             boolean charfound = false;
@@ -321,6 +330,8 @@ public class GCOrchestrationService implements JavaDelegate {
         
     }
     
+    return resCreate;
+    
   }
 
 
@@ -338,33 +349,29 @@ public class GCOrchestrationService implements JavaDelegate {
    * <br>
    * 
    * @param aService reference to the service that the resource and the CR belongs to
-   * @param aResource reference the equivalent resource in TMF repo of the target CR. One to one mapping
+   * @param resourceI reference the equivalent resource in TMF repo of the target CR. One to one mapping
    * @param orderId related service order ID
-   * @param startDate start date of the deployment  (not used currently)
-   * @param endDate end date of the deployment (not used currently)
    * @return a Resource as updated. It might return "OK" if everything is ok. 
    * "SEE OTHER" if there are multiple CRIDGEs then some other cridge will handle the request for the equivalent cluster. 
    * Any other response is handled as error
+   * return Resource object from the controller
    */
-  private Resource createNewResourceDeploymentRequest( Service aService,
-      Resource aResource, 
-      ResourceSpecification rRef, 
-      String orderId,
-      OffsetDateTime startDate,
-      OffsetDateTime endDate) {
+  private Resource createNewResourceDeploymentRequest( Service aService, Resource resourceI,
+      ResourceCreate aResourceCreate, 
+      String orderId) {
 
     try {
       Map<String, Object> map = new HashMap<>();
       map.put("org.etsi.osl.serviceId", aService.getId() );
-      map.put("org.etsi.osl.resourceId", aResource.getId() );
-      map.put("org.etsi.osl.prefixName", "gr" + aResource.getId().substring(0, 8) );
+      map.put("org.etsi.osl.resourceId", resourceI.getId() );
+      map.put("org.etsi.osl.prefixName", "gr" + resourceI.getId().substring(0, 8) );
       map.put("org.etsi.osl.serviceOrderId", orderId );
       
 
       logger.debug("createNewResourceDeploymentRequest ");
       
-      String queueName = "jms:queue:CREATE/"+aResource.getCategory() + "/" + rRef.getVersion() ;
-      Resource response  = serviceOrderManager.gcGenericResourceDeploymentRequest(queueName , map, aResource);
+      String queueName = "jms:queue:CREATE/"+ aResourceCreate.getCategory() + "/" + aResourceCreate.getResourceVersion() ;
+      Resource response  = serviceOrderManager.gcGenericResourceDeploymentRequest(queueName , map, aResourceCreate);
       
 
       return response;
diff --git a/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java b/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
index 336e487..4d79409 100644
--- a/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
+++ b/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
@@ -42,6 +42,7 @@ import org.etsi.osl.tmf.ri639.model.LogicalResource;
 import org.etsi.osl.tmf.ri639.model.PhysicalResource;
 import org.etsi.osl.tmf.ri639.model.Resource;
 import org.etsi.osl.tmf.ri639.model.ResourceCreate;
+import org.etsi.osl.tmf.ri639.model.ResourceUpdate;
 import org.etsi.osl.tmf.scm633.model.ServiceSpecification;
 import org.etsi.osl.tmf.sim638.model.ServiceActionQueueItem;
 import org.etsi.osl.tmf.sim638.model.ServiceCreate;
@@ -1086,7 +1087,7 @@ public class ServiceOrderManager {
     
   }
 
-  public Resource gcGenericResourceDeploymentRequest(String queueName, Map<String, Object> map, Resource aResource) {
+  public Resource gcGenericResourceDeploymentRequest(String queueName, Map<String, Object> map, ResourceUpdate aResource) {
     try {
 
       logger.debug("gcGenericResourceDeploymentRequest queueName=" + queueName);
@@ -1110,6 +1111,9 @@ public class ServiceOrderManager {
     return null;
   }
   
+  
+
+  
   /**
    * get  service spec by id from model via bus
    * @param id
diff --git a/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java b/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java
index 6bc7ce4..9b9d3b7 100644
--- a/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java
+++ b/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java
@@ -2,21 +2,40 @@ package org.etsi.osl.osom.serviceactions;
 
 import java.time.OffsetDateTime;
 import java.time.ZoneOffset;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.etsi.osl.osom.management.ServiceOrderManager;
+import org.etsi.osl.tmf.common.model.AttachmentRefOrValue;
+import org.etsi.osl.tmf.common.model.service.Characteristic;
 import org.etsi.osl.tmf.common.model.service.Note;
+import org.etsi.osl.tmf.common.model.service.ResourceRef;
+import org.etsi.osl.tmf.prm669.model.RelatedParty;
+import org.etsi.osl.tmf.ri639.model.Feature;
+import org.etsi.osl.tmf.ri639.model.Resource;
+import org.etsi.osl.tmf.ri639.model.ResourceCreate;
+import org.etsi.osl.tmf.ri639.model.ResourceRelationship;
+import org.etsi.osl.tmf.ri639.model.ResourceUpdate;
 import org.etsi.osl.tmf.sim638.model.Service;
+import org.etsi.osl.tmf.sim638.model.ServiceActionQueueAction;
 import org.etsi.osl.tmf.sim638.model.ServiceActionQueueItem;
+import org.etsi.osl.tmf.sim638.model.ServiceOrderRef;
 import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
 import org.flowable.engine.delegate.DelegateExecution;
 import org.flowable.engine.delegate.JavaDelegate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
+import jakarta.validation.Valid;
 
 @Component(value = "AutomaticallyHandleAction") //bean name
 public class AutomaticallyHandleAction  implements JavaDelegate {
@@ -31,7 +50,9 @@ public class AutomaticallyHandleAction  implements JavaDelegate {
     
 	public void execute(DelegateExecution execution) {
 		
-		logger.info("AutomaticallyHandleAction:" + execution.getVariableNames().toString() );
+		logger.debug("AutomaticallyHandleAction:" + execution.getVariableNames().toString() );
+	    logger.debug("Ceneric Controller OrchestrationService");
+	    logger.debug("VariableNames:" + execution.getVariableNames().toString());
 		
 		
 		ObjectMapper mapper = new ObjectMapper();
@@ -42,12 +63,85 @@ public class AutomaticallyHandleAction  implements JavaDelegate {
 			item = mapper.readValue( execution.getVariable("serviceActionItem").toString(), ServiceActionQueueItem.class);
 			aService = mapper.readValue( execution.getVariable("Service").toString(), Service.class);
 			
+			if ( aService.getSupportingResource().stream().findFirst().isPresent() ) { //there is a resourceRef			  
+
+	            ResourceRef rr = aService.getSupportingResource().stream().findFirst().get();
+	            
+	            Resource relatedResource = serviceOrderManager.retrieveResource( rr.getId() );
+	            
+	            ResourceUpdate aResourceUpdate = resourceToResourceUpdate(relatedResource);
+	            
+	            //pass characteristic values from services to resource
+	            Optional<ServiceOrderRef> sref = aService.getServiceOrder().stream().findFirst();
+	            String serviceOrderID="";
+	            if ( sref.isPresent()) {
+	              serviceOrderID = sref.get().getId();
+	            }
+
+                Boolean allServiceAndResourceCharacteristicsAreTheSame = true;
+                Boolean onlyStatusCharacteristicsChanged = true;
+	            for (org.etsi.osl.tmf.ri639.model.Characteristic resCharacteristic : aResourceUpdate.getResourceCharacteristic()) {
+	               Characteristic servChar = aService.getServiceCharacteristicByName( resCharacteristic.getName() );
+	              if ( servChar !=null) {      
+	                //we need to check if the characteristics that changed are only from the resources (e.g. start with status. )
+	                //if there are only from resources then we will not snd back an update request, otherwise we get into an infinite loop
+	                if ( resCharacteristic.getValue().getValue() != null && 
+	                    servChar.getValue().getValue()  != null &&
+	                    !resCharacteristic.getValue().getValue().equals( servChar.getValue().getValue() ) ) {
+	                  allServiceAndResourceCharacteristicsAreTheSame = false;
+                      if ( !servChar.getValue().getValue().startsWith("status.") ) {
+                        onlyStatusCharacteristicsChanged = false;
+                      } else {
+
+                        logger.debug("Only Status Characteristic Changed. Will not update the resource!" );
+                      }
+                    }
+	                
+
+                    resCharacteristic.getValue().setValue( servChar.getValue().getValue() );
+	                
+	              }
+	            } 
+	            
+	            
+	            try{
+	              
+	                Resource response = null;
+	                
+	                if ( item.getAction().equals( ServiceActionQueueAction.EVALUATE_CHARACTERISTIC_CHANGED  ) 
+	                    || item.getAction().equals( ServiceActionQueueAction.EVALUATE_CHILD_CHARACTERISTIC_CHANGED  ) 
+	                    || item.getAction().equals( ServiceActionQueueAction.EVALUATE_CHARACTERISTIC_CHANGED_MANODAY2  ) ) {
+	                    
+	                  if ( !onlyStatusCharacteristicsChanged && !allServiceAndResourceCharacteristicsAreTheSame) {
+	                      response = createNewResourceDeploymentRequest(aService, 
+	                            relatedResource, aResourceUpdate,  
+	                            serviceOrderID );     
+	                    
+	                  }            
+	                } else {
+
+	                  response = createNewResourceDeleteRequest(aService, 
+	                        relatedResource, aResourceUpdate,  
+	                        serviceOrderID );  
+	                }
+	                
+	              
+	            }catch (Exception e) {
+	              e.printStackTrace();
+	            }
+			  
+			  
+			}
+			
+			
+			
 			ServiceUpdate supd = new ServiceUpdate();
 			Note n = new Note();
 			n.setText("Service Action AutomaticallyHandleAction. Action: " + item.getAction() );
 			n.setAuthor( compname );
 			n.setDate( OffsetDateTime.now(ZoneOffset.UTC).toString() );
 			supd.addNoteItem( n );
+			
 			serviceOrderManager.deleteServiceActionQueueItem( item );			
 			serviceOrderManager.updateService( aService.getId() , supd, false);
 			
@@ -60,5 +154,113 @@ public class AutomaticallyHandleAction  implements JavaDelegate {
 			return;
 		}
 	}
+	
+	
+    private ResourceUpdate resourceToResourceUpdate(Resource source) {
+      if ( source == null ) {
+          return null;
+      }
+
+      ResourceUpdate resourceUpdate = new ResourceUpdate();
+
+      resourceUpdate.setCategory( source.getCategory() );
+      resourceUpdate.setDescription( source.getDescription() );
+      resourceUpdate.setEndOperatingDate( source.getEndOperatingDate() );
+      resourceUpdate.setName( source.getName() );
+      resourceUpdate.setResourceVersion( source.getResourceVersion() );
+      resourceUpdate.setStartOperatingDate( source.getStartOperatingDate() );
+      Set<Feature> set = source.getActivationFeature();
+      if ( set != null ) {
+          resourceUpdate.setActivationFeature( new ArrayList<Feature>( set ) );
+      }
+      resourceUpdate.setAdministrativeState( source.getAdministrativeState() );
+      Set<AttachmentRefOrValue> set1 = source.getAttachment();
+      if ( set1 != null ) {
+          resourceUpdate.setAttachment( new ArrayList<AttachmentRefOrValue>( set1 ) );
+      }
+      Set<Note> set2 = source.getNote();
+      if ( set2 != null ) {
+          resourceUpdate.setNote( new ArrayList<Note>( set2 ) );
+      }
+      resourceUpdate.setOperationalState( source.getOperationalState() );
+      resourceUpdate.setPlace( source.getPlace() );
+      Set<RelatedParty> set3 = source.getRelatedParty();
+      if ( set3 != null ) {
+          resourceUpdate.setRelatedParty( new ArrayList<RelatedParty>( set3 ) );
+      }
+      @Valid Set<org.etsi.osl.tmf.ri639.model.Characteristic> set4 = source.getResourceCharacteristic();
+      if ( set4 != null ) {
+          resourceUpdate.setResourceCharacteristic( new ArrayList<org.etsi.osl.tmf.ri639.model.Characteristic>( set4 ) );
+      }
+      Set<ResourceRelationship> set5 = source.getResourceRelationship();
+      if ( set5 != null ) {
+          resourceUpdate.setResourceRelationship( new ArrayList<ResourceRelationship>( set5 ) );
+      }
+      resourceUpdate.setResourceSpecification( source.getResourceSpecification() );
+      resourceUpdate.setResourceStatus( source.getResourceStatus() );
+      resourceUpdate.setUsageState( source.getUsageState() );
+
+      return resourceUpdate;
+  }
+    
+    private Resource createNewResourceDeploymentRequest( Service aService, 
+        Resource resourceI,
+        ResourceUpdate aResourceUpdate, 
+        String orderId) {
+
+      try {
+        Map<String, Object> map = new HashMap<>();
+        map.put("org.etsi.osl.serviceId", aService.getId() );
+        map.put("org.etsi.osl.resourceId", resourceI.getId() );
+        map.put("org.etsi.osl.prefixName", "gr" + resourceI.getId().substring(0, 8) );
+        map.put("org.etsi.osl.serviceOrderId", orderId );
+        
+
+        logger.debug("createNewResourceDeploymentRequest ");
+        
+        String queueName = "jms:queue:UPDATE/"+ aResourceUpdate.getCategory() + "/" + aResourceUpdate.getResourceVersion() ;
+        Resource response  = serviceOrderManager.gcGenericResourceDeploymentRequest(queueName , map, aResourceUpdate);
+        
+
+        return response;
+        
+      } catch (Exception e) {
+        logger.error("cridgeDeploymentRequest failed");
+        e.printStackTrace();
+      }
+
+      return null;
+
+    }
+    
+    private Resource createNewResourceDeleteRequest( Service aService, 
+        Resource resourceI,
+        ResourceUpdate aResourceUpdate, 
+        String orderId) {
+
+      try {
+        Map<String, Object> map = new HashMap<>();
+        map.put("org.etsi.osl.serviceId", aService.getId() );
+        map.put("org.etsi.osl.resourceId", resourceI.getId() );
+        map.put("org.etsi.osl.prefixName", "gr" + resourceI.getId().substring(0, 8) );
+        map.put("org.etsi.osl.serviceOrderId", orderId );
+        
+
+        logger.debug("createNewResourceDeploymentRequest ");
+        
+        String queueName = "jms:queue:DELETE/"+ aResourceUpdate.getCategory() + "/" + aResourceUpdate.getResourceVersion() ;
+        Resource response  = serviceOrderManager.gcGenericResourceDeploymentRequest(queueName , map, aResourceUpdate);
+        
+
+        return response;
+        
+      } catch (Exception e) {
+        logger.error("cridgeDeploymentRequest failed");
+        e.printStackTrace();
+      }
+
+      return null;
+
+    }
 
 }
-- 
GitLab


From b0921cfc307d558646248ffe9892104c4ace3eca Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 6 Dec 2024 10:37:26 +0200
Subject: [PATCH 11/31] fixes for #28

---
 .../java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java b/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java
index 7ef1c9d..34e2d5a 100644
--- a/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java
+++ b/src/test/java/org/etsi/osl/osom/ProcessOrderIntegrationTest.java
@@ -184,7 +184,7 @@ public class ProcessOrderIntegrationTest {
 		assertThat(specCirros.getServiceSpecCharacteristic().size()  ).isEqualTo(12);
 		assertThat(sorder.getOrderItem().stream().findFirst().get().getService().getServiceCharacteristic().size()  ).isEqualTo(2);
 
-		assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(15);
+		assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(16);
 		assertThat(taskService.createTaskQuery().count()).isEqualTo(0);
 
 		assertThat( scmocked.getRequeestedDescriptor() ).isNull();
-- 
GitLab


From a5a460d505b4a41f37fbcd4b568b16998422df1c Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 6 Dec 2024 13:21:05 +0200
Subject: [PATCH 12/31] removed line

---
 .../etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java  | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java b/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java
index 9b9d3b7..2602be8 100644
--- a/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java
+++ b/src/main/java/org/etsi/osl/osom/serviceactions/AutomaticallyHandleAction.java
@@ -51,7 +51,6 @@ public class AutomaticallyHandleAction  implements JavaDelegate {
 	public void execute(DelegateExecution execution) {
 		
 		logger.debug("AutomaticallyHandleAction:" + execution.getVariableNames().toString() );
-	    logger.debug("Ceneric Controller OrchestrationService");
 	    logger.debug("VariableNames:" + execution.getVariableNames().toString());
 		
 		
-- 
GitLab


From 0326973296025087c96b70523003cceae1e47837 Mon Sep 17 00:00:00 2001
From: George Tziavas <g.tziavas@ac.upatras.gr>
Date: Mon, 16 Dec 2024 09:32:50 +0200
Subject: [PATCH 13/31] 	new file:  
 .bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d 	new
 file:   .bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d 
 modified:   src/main/java/org/etsi/osl/osom/management/AutomationCheck.java 
 new file:  
 src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java 
 modified:   src/main/resources/processes/ServiceCreationProcess.bpmn

---
 .../processes/ServiceCreationProcess.bpmn2d   | 947 ++++++++++++++++++
 .../TerminateScheduledServices.bpmn2d         |   6 +
 .../osl/osom/management/AutomationCheck.java  |   6 +-
 .../MetricoOrchestrationService.java          |  50 +
 .../processes/ServiceCreationProcess.bpmn     |  42 +-
 5 files changed, 1036 insertions(+), 15 deletions(-)
 create mode 100644 .bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d
 create mode 100644 .bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d
 create mode 100644 src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java

diff --git a/.bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d b/.bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d
new file mode 100644
index 0000000..fb33f5d
--- /dev/null
+++ b/.bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d
@@ -0,0 +1,947 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" active="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="ServiceCreationProcess" snapToGrid="true" version="0.13.0">
+  <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="815196841"/>
+    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="37" y="213">
+      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1822228644"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="55" x="711" y="203">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="55" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.7" incomingConnections="//@connections.5"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1822228644"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="23" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Automation Check"/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1366647404"/>
+    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="1560" y="359">
+      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="3" transparency="0.0" width="35" height="35" style="//@styles.0"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.6"/>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="813953940"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="61" x="1040" y="70">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="61" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.12" incomingConnections="//@connections.11 //@connections.14"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="813953940"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="29" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="User Task Manual Complete Service"/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="162761602"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="131" height="81" x="1094" y="243">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="131" height="81" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.16" incomingConnections="//@connections.8"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="162761602"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="131" height="49" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="NFVO Deployment Request"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1973934667"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="131" height="91" x="1094" y="475">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="131" height="91" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.17" incomingConnections="//@connections.9"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.5/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1973934667"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="131" height="59" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="External Service Provider Deployment Request"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1180799606"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="128" height="81" x="1095" y="585">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="128" height="81" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.18" incomingConnections="//@connections.10"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.6/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1180799606"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="128" height="49" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Local Service Orchestration"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1201722971"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="71" x="1355" y="341">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="71" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.6" incomingConnections="//@connections.15 //@connections.16 //@connections.17 //@connections.18 //@connections.23 //@connections.25 //@connections.27 //@connections.28"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.7/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1201722971"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="39" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Evaluate Created Services Task "/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1539158571"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="66" x="100" y="198">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="66" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.8/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1539158571"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="34" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Create Service in RESERVED"/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1391140684"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="63" x="270" y="199">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="63" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2" incomingConnections="//@connections.1 //@connections.4 //@connections.21"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.9/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1391140684"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="31" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Process Create Rules"/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="82493526"/>
+    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="537" y="210">
+      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
+        <points y="20"/>
+        <points x="20"/>
+        <points x="40" y="20"/>
+        <points x="20" y="40"/>
+        <points y="20"/>
+      </graphicsAlgorithmChildren>
+      <points y="20"/>
+      <points x="20"/>
+      <points x="40" y="20"/>
+      <points x="20" y="40"/>
+      <points y="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.3 //@connections.5" incomingConnections="//@connections.2"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.10/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <anchors xsi:type="pi:ChopboxAnchor"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.10/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="30" y="10"/>
+        <points x="10" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="10" y="10"/>
+        <points x="30" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="115472372"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="121" height="71" x="387" y="485">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="121" height="71" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.4" incomingConnections="//@connections.19"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.11/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="115472372"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="121" height="39" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Create Service Process"/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="12" height="12" x="54" y="57" id="org.activiti.designer.guimi.parallel" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="2077291140"/>
+    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="887" y="210">
+      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
+        <points y="20"/>
+        <points x="20"/>
+        <points x="40" y="20"/>
+        <points x="20" y="40"/>
+        <points y="20"/>
+      </graphicsAlgorithmChildren>
+      <points y="20"/>
+      <points x="20"/>
+      <points x="40" y="20"/>
+      <points x="20" y="40"/>
+      <points y="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.8 //@connections.9 //@connections.10 //@connections.11 //@connections.22 //@connections.24 //@connections.26 //@connections.29" incomingConnections="//@connections.7"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.12/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <anchors xsi:type="pi:ChopboxAnchor"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.12/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="30" y="10"/>
+        <points x="10" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="10" y="10"/>
+        <points x="30" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1266031123"/>
+    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="1237" y="80">
+      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
+        <points y="20"/>
+        <points x="20"/>
+        <points x="40" y="20"/>
+        <points x="20" y="40"/>
+        <points y="20"/>
+      </graphicsAlgorithmChildren>
+      <points y="20"/>
+      <points x="20"/>
+      <points x="40" y="20"/>
+      <points x="20" y="40"/>
+      <points y="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.13 //@connections.15" incomingConnections="//@connections.12"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.13/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <anchors xsi:type="pi:ChopboxAnchor"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.13/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="30" y="10"/>
+        <points x="10" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="10" y="10"/>
+        <points x="30" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1500004015"/>
+    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="1137" y="169">
+      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0">
+        <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="31" height="31" x="2" y="2" style="//@styles.0"/>
+      </graphicsAlgorithmChildren>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.14" incomingConnections="//@connections.13"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.14/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="20" height="20" x="7" y="7" id="org.activiti.designer.guievent.timer" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="2077077883"/>
+    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="537" y="326">
+      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
+        <points y="20"/>
+        <points x="20"/>
+        <points x="40" y="20"/>
+        <points x="20" y="40"/>
+        <points y="20"/>
+      </graphicsAlgorithmChildren>
+      <points y="20"/>
+      <points x="20"/>
+      <points x="40" y="20"/>
+      <points x="20" y="40"/>
+      <points y="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.19 //@connections.20" incomingConnections="//@connections.3"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.15/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <anchors xsi:type="pi:ChopboxAnchor"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.15/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="30" y="10"/>
+        <points x="10" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="10" y="10"/>
+        <points x="30" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="200356510"/>
+    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="385" y="329">
+      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0">
+        <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="31" height="31" x="2" y="2" style="//@styles.0"/>
+      </graphicsAlgorithmChildren>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.21" incomingConnections="//@connections.20"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.16/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="20" height="20" x="7" y="7" id="org.activiti.designer.guievent.timer" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1859538327"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="143" height="81" x="1095" y="710">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="143" height="81" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.23" incomingConnections="//@connections.22"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.17/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1859538327"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="143" height="49" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Service Test Orchestration"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1380140605"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="129" height="90" x="1094" y="332">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="129" height="90" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.25" incomingConnections="//@connections.24"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.18/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1380140605"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="129" height="58" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="CR Deployment Request"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1669054728"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="130" height="71" x="1094" y="820">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="130" height="71" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.27" incomingConnections="//@connections.26"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.19/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="1669054728"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="130" height="39" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Generic Resource Deployment Request"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="767024104"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="121" height="71" x="1070" y="900">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="121" height="71" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.28" incomingConnections="//@connections.29"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.20/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="767024104"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="121" height="46" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Metrico Request"/>
+    </children>
+  </children>
+  <styles foreground="//@colors.2" lineWidth="20" id="EVENT">
+    <renderingStyle>
+      <adaptedGradientColoredAreas definedStyleId="bpmnEventStyle" gradientType="0">
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="250" green="251" blue="252"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="250" green="251" blue="252"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+      </adaptedGradientColoredAreas>
+    </renderingStyle>
+  </styles>
+  <styles foreground="//@colors.2" lineWidth="20" id="TASK">
+    <renderingStyle>
+      <adaptedGradientColoredAreas definedStyleId="bpmnTaskStyle" gradientType="0">
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="250" green="251" blue="252"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="255" green="255" blue="204"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+      </adaptedGradientColoredAreas>
+    </renderingStyle>
+  </styles>
+  <styles background="//@colors.2" foreground="//@colors.2" lineWidth="1" id="BPMN-POLYGON-ARROW"/>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@anchors.0" end="//@children.8/@anchors.0">
+    <properties key="independentObject" value="1154264171"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.8/@anchors.0" end="//@children.9/@anchors.0">
+    <properties key="independentObject" value="674474777"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.9/@anchors.0" end="//@children.10/@anchors.0">
+    <properties key="independentObject" value="953396352"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.10/@anchors.0" end="//@children.15/@anchors.0">
+    <properties key="independentObject" value="452838388"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="65" x="10" y="6" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="anyNotCreatedSupportingServices[!allSupportingServicesCreatedAndActive]"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.11/@anchors.0" end="//@children.9/@anchors.0">
+    <properties key="independentObject" value="1314172327"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="322" y="520"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.10/@anchors.0" end="//@children.1/@anchors.0">
+    <properties key="independentObject" value="464090216"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="-1" y="-33" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="allSupportingServicesCreatedAndActive"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.7/@anchors.0" end="//@children.2/@anchors.0">
+    <properties key="independentObject" value="1172247103"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.1/@anchors.0" end="//@children.12/@anchors.0">
+    <properties key="independentObject" value="1200400906"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.4/@anchors.0">
+    <properties key="independentObject" value="373137057"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="10" y="20" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;RFS_OSM&quot;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="283"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.5/@anchors.0">
+    <properties key="independentObject" value="1500062807"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="20" y="234" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;PARTNER&quot;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="520"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.6/@anchors.0">
+    <properties key="independentObject" value="573928657"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="10" y="334" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;AUTO&quot;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="625"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.3/@anchors.0">
+    <properties key="independentObject" value="2122667562"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="10" y="-79" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;MANUALLY&quot;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="100"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.3/@anchors.0" end="//@children.13/@anchors.0">
+    <properties key="independentObject" value="1662918832"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.13/@anchors.0" end="//@children.14/@anchors.0">
+    <properties key="independentObject" value="853148196"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="4" y="19" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="!serviceHandledManually"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1256" y="186"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.14/@anchors.0" end="//@children.3/@anchors.0">
+    <properties key="independentObject" value="1646542006"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1092" y="186"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.13/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="1330428417"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="12" y="-30" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="serviceHandledManually"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1407" y="100"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.4/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="2011653167"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1407" y="283"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.5/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="899440452"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1407" y="520"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.6/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="1381283938"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1407" y="625"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.15/@anchors.0" end="//@children.11/@anchors.0">
+    <properties key="independentObject" value="411143385"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="20" y="27" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="!allSupportingServicesCreated"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="557" y="519"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.15/@anchors.0" end="//@children.16/@anchors.0">
+    <properties key="independentObject" value="1711168274"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="65" x="-98" y="-56" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="allSupportingServicesCreated (but there are some not Active/Terminated)"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.16/@anchors.0" end="//@children.9/@anchors.0">
+    <properties key="independentObject" value="1531148329"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="322" y="346"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.17/@anchors.0">
+    <properties key="independentObject" value="1613365098"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="3" y="449" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;TESTSPEC&quot;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="750"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.17/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="1795927371"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1407" y="750"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.18/@anchors.0">
+    <properties key="independentObject" value="1383985042"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="34" y="94" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;RFS_CRSPEC&quot;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="377"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.18/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="271142928"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.19/@anchors.0">
+    <properties key="independentObject" value="2008707740"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="3" y="539" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;GRSPEC&quot;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="855"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.19/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="831845527"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1407" y="855"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.20/@anchors.0" end="//@children.7/@anchors.0">
+    <properties key="independentObject" value="1324951383"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value=""/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="1407" y="935"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.20/@anchors.0">
+    <properties key="independentObject" value="269254567"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value=""/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="907" y="935"/>
+  </connections>
+  <colors red="227" green="238" blue="249"/>
+  <colors red="255" green="255" blue="255"/>
+  <colors/>
+  <fonts name="Arial" size="8"/>
+  <fonts name="Arial" size="8" bold="true"/>
+</pi:Diagram>
diff --git a/.bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d b/.bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d
new file mode 100644
index 0000000..396e2bf
--- /dev/null
+++ b/.bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="TerminateScheduledServices" snapToGrid="true" version="0.13.0">
+  <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+  <colors red="227" green="238" blue="249"/>
+  <colors red="255" green="255" blue="255"/>
+</pi:Diagram>
diff --git a/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java b/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
index e55f373..272a3ea 100644
--- a/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
+++ b/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
@@ -88,8 +88,10 @@ public class AutomationCheck implements JavaDelegate {
 			} else if ( spec.getType().equals("ResourceFacingServiceSpecification") &&  ( spec.findSpecCharacteristicByName( "OSM_NSDCATALOGID" ) != null ) ) {
 				execution.setVariable("brokeActivity", "RFS_OSM" ); 						
 			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") &&  ( spec.findSpecCharacteristicByName( "_CR_SPEC" ) != null ) ) {
-				execution.setVariable("brokeActivity", "RFS_CRSPEC" ); 						
-			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") ) {
+				execution.setVariable("brokeActivity", "RFS_CRSPEC" );
+			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") &&  ( spec.findSpecCharacteristicByName( "_MT_" ) != null ) ) {
+				 execution.setVariable("brokeActivity", "RFS_MTSPEC" );
+			} else if ( spec.getType().equals("ResourceFacingServiceSpecification") ) {
               execution.setVariable("brokeActivity", "GRSPEC" );                      
           }		
 		}
diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
new file mode 100644
index 0000000..60f6395
--- /dev/null
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -0,0 +1,50 @@
+package org.etsi.osl.osom.management;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.sim638.model.Service;
+import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.JavaDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component(value = "metricoOrchestrationService")
+public class MetricoOrchestrationService implements JavaDelegate {
+    private static final transient Log logger = LogFactory.getLog(MetricoOrchestrationService.class.getName());
+
+    @Value("${spring.application.name}")
+    private String compname;
+
+    @Autowired
+    private ServiceOrderManager serviceOrderManager;
+
+    @Override
+    public void execute(DelegateExecution execution) {
+
+        logger.info( "MetricoOrchestrationService" );
+        logger.info( execution.getVariableNames().toString() );
+
+        if ( execution.getVariable("contextServiceId") == null) {
+
+            logger.error( "Variable contextServiceId is NULL!" );
+            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
+            return;
+        }
+        Service aService = serviceOrderManager.retrieveService( (String) execution.getVariable("contextServiceId") );
+
+        if ( aService == null ) {
+            logger.info( "aService is null for contextServiceId = " +(String) execution.getVariable("contextServiceId") );
+            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
+            return;
+        }
+
+        execution.setVariable("serviceDeploymentFinished", Boolean.FALSE );
+
+        ServiceUpdate supd = new ServiceUpdate();
+        boolean propagateToSO = false;
+
+
+    }
+}
diff --git a/src/main/resources/processes/ServiceCreationProcess.bpmn b/src/main/resources/processes/ServiceCreationProcess.bpmn
index 1fb3993..e296d3d 100644
--- a/src/main/resources/processes/ServiceCreationProcess.bpmn
+++ b/src/main/resources/processes/ServiceCreationProcess.bpmn
@@ -85,6 +85,9 @@
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${brokeActivity=='GRSPEC'}]]></conditionExpression>
     </sequenceFlow>
     <sequenceFlow id="flow46" sourceRef="activityGenericResourceDeploymentReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
+    <callActivity id="parallelMetricoReq" name="Metrico Request" activiti:async="true" calledElement="procMetricoDeploymentRequest" activiti:inheritVariables="false"></callActivity>
+    <sequenceFlow id="flow47" sourceRef="parallelMetricoReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
+    <sequenceFlow id="flow48" sourceRef="exclusivegateway2" targetRef="parallelMetricoReq"></sequenceFlow>
   </process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_CreateServiceProcess">
     <bpmndi:BPMNPlane bpmnElement="CreateServiceProcess" id="BPMNPlane_CreateServiceProcess">
@@ -148,6 +151,9 @@
       <bpmndi:BPMNShape bpmnElement="activityGenericResourceDeploymentReq" id="BPMNShape_activityGenericResourceDeploymentReq">
         <omgdc:Bounds height="71.0" width="130.0" x="1094.0" y="820.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="parallelMetricoReq" id="BPMNShape_parallelMetricoReq">
+        <omgdc:Bounds height="71.0" width="121.0" x="1070.0" y="900.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19">
         <omgdi:waypoint x="72.0" y="230.0"></omgdi:waypoint>
         <omgdi:waypoint x="100.0" y="231.0"></omgdi:waypoint>
@@ -164,7 +170,7 @@
         <omgdi:waypoint x="557.0" y="250.0"></omgdi:waypoint>
         <omgdi:waypoint x="557.0" y="326.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="70.0" width="100.0" x="567.0" y="256.0"></omgdc:Bounds>
+          <omgdc:Bounds height="65.0" width="100.0" x="567.0" y="256.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow23" id="BPMNEdge_flow23">
@@ -176,7 +182,7 @@
         <omgdi:waypoint x="577.0" y="230.0"></omgdi:waypoint>
         <omgdi:waypoint x="711.0" y="230.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="576.0" y="197.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="576.0" y="197.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow25" id="BPMNEdge_flow25">
@@ -192,7 +198,7 @@
         <omgdi:waypoint x="907.0" y="283.0"></omgdi:waypoint>
         <omgdi:waypoint x="1094.0" y="283.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="917.0" y="270.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="917.0" y="270.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow28" id="BPMNEdge_flow28">
@@ -200,7 +206,7 @@
         <omgdi:waypoint x="907.0" y="520.0"></omgdi:waypoint>
         <omgdi:waypoint x="1094.0" y="520.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="927.0" y="484.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="927.0" y="484.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow29" id="BPMNEdge_flow29">
@@ -208,7 +214,7 @@
         <omgdi:waypoint x="907.0" y="625.0"></omgdi:waypoint>
         <omgdi:waypoint x="1095.0" y="625.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="917.0" y="584.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="917.0" y="584.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow30" id="BPMNEdge_flow30">
@@ -216,7 +222,7 @@
         <omgdi:waypoint x="907.0" y="100.0"></omgdi:waypoint>
         <omgdi:waypoint x="1040.0" y="100.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="917.0" y="131.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="917.0" y="131.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow31" id="BPMNEdge_flow31">
@@ -228,7 +234,7 @@
         <omgdi:waypoint x="1256.0" y="186.0"></omgdi:waypoint>
         <omgdi:waypoint x="1172.0" y="186.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="1261.0" y="139.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="1261.0" y="139.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow33" id="BPMNEdge_flow33">
@@ -241,7 +247,7 @@
         <omgdi:waypoint x="1407.0" y="100.0"></omgdi:waypoint>
         <omgdi:waypoint x="1407.0" y="341.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="1289.0" y="70.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="1289.0" y="70.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow35" id="BPMNEdge_flow35">
@@ -264,14 +270,14 @@
         <omgdi:waypoint x="557.0" y="519.0"></omgdi:waypoint>
         <omgdi:waypoint x="508.0" y="520.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="577.0" y="393.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="577.0" y="393.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow39" id="BPMNEdge_flow39">
         <omgdi:waypoint x="537.0" y="346.0"></omgdi:waypoint>
         <omgdi:waypoint x="420.0" y="346.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="70.0" width="100.0" x="439.0" y="290.0"></omgdc:Bounds>
+          <omgdc:Bounds height="65.0" width="100.0" x="439.0" y="290.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow40" id="BPMNEdge_flow40">
@@ -284,7 +290,7 @@
         <omgdi:waypoint x="907.0" y="750.0"></omgdi:waypoint>
         <omgdi:waypoint x="1095.0" y="750.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="910.0" y="699.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="910.0" y="699.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow42" id="BPMNEdge_flow42">
@@ -297,7 +303,7 @@
         <omgdi:waypoint x="907.0" y="377.0"></omgdi:waypoint>
         <omgdi:waypoint x="1094.0" y="377.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="941.0" y="344.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="941.0" y="344.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow44" id="BPMNEdge_flow44">
@@ -309,7 +315,7 @@
         <omgdi:waypoint x="907.0" y="855.0"></omgdi:waypoint>
         <omgdi:waypoint x="1094.0" y="855.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="42.0" width="100.0" x="910.0" y="789.0"></omgdc:Bounds>
+          <omgdc:Bounds height="39.0" width="100.0" x="910.0" y="789.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow46" id="BPMNEdge_flow46">
@@ -317,6 +323,16 @@
         <omgdi:waypoint x="1407.0" y="855.0"></omgdi:waypoint>
         <omgdi:waypoint x="1407.0" y="412.0"></omgdi:waypoint>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow47" id="BPMNEdge_flow47">
+        <omgdi:waypoint x="1191.0" y="935.0"></omgdi:waypoint>
+        <omgdi:waypoint x="1407.0" y="935.0"></omgdi:waypoint>
+        <omgdi:waypoint x="1407.0" y="412.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow48" id="BPMNEdge_flow48">
+        <omgdi:waypoint x="907.0" y="250.0"></omgdi:waypoint>
+        <omgdi:waypoint x="907.0" y="935.0"></omgdi:waypoint>
+        <omgdi:waypoint x="1070.0" y="935.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </definitions>
\ No newline at end of file
-- 
GitLab


From be6efda96404927d044a42c19819c4a282957354 Mon Sep 17 00:00:00 2001
From: George Tziavas <g.tziavas@ac.upatras.gr>
Date: Mon, 16 Dec 2024 15:36:34 +0200
Subject: [PATCH 14/31] added one more action to service creation process

---
 .../processes/ServiceCreationProcess.bpmn2d   | 947 ------------------
 .../TerminateScheduledServices.bpmn2d         |   6 -
 .../osl/osom/management/AutomationCheck.java  |   2 +-
 ...coOrchestrationCheckDeploymentService.java |  50 +
 .../MetricoOrchestrationService.java          |  61 +-
 .../processes/ServiceCreationProcess.bpmn     |   7 +-
 6 files changed, 87 insertions(+), 986 deletions(-)
 delete mode 100644 .bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d
 delete mode 100644 .bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d
 create mode 100644 src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java

diff --git a/.bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d b/.bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d
deleted file mode 100644
index fb33f5d..0000000
--- a/.bpmn/src/main/resources/processes/ServiceCreationProcess.bpmn2d
+++ /dev/null
@@ -1,947 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" active="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="ServiceCreationProcess" snapToGrid="true" version="0.13.0">
-  <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="815196841"/>
-    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="37" y="213">
-      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1822228644"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="55" x="711" y="203">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="55" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.7" incomingConnections="//@connections.5"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1822228644"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="23" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Automation Check"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1366647404"/>
-    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="1560" y="359">
-      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="3" transparency="0.0" width="35" height="35" style="//@styles.0"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.6"/>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="813953940"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="61" x="1040" y="70">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="61" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.12" incomingConnections="//@connections.11 //@connections.14"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="813953940"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="29" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="User Task Manual Complete Service"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="162761602"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="131" height="81" x="1094" y="243">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="131" height="81" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.16" incomingConnections="//@connections.8"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="162761602"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="131" height="49" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="NFVO Deployment Request"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1973934667"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="131" height="91" x="1094" y="475">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="131" height="91" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.17" incomingConnections="//@connections.9"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.5/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1973934667"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="131" height="59" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="External Service Provider Deployment Request"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1180799606"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="128" height="81" x="1095" y="585">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="128" height="81" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.18" incomingConnections="//@connections.10"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.6/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1180799606"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="128" height="49" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Local Service Orchestration"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1201722971"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="71" x="1355" y="341">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="71" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.6" incomingConnections="//@connections.15 //@connections.16 //@connections.17 //@connections.18 //@connections.23 //@connections.25 //@connections.27 //@connections.28"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.7/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1201722971"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="39" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Evaluate Created Services Task "/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1539158571"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="66" x="100" y="198">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="66" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.8/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1539158571"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="34" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Create Service in RESERVED"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1391140684"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="63" x="270" y="199">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="63" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2" incomingConnections="//@connections.1 //@connections.4 //@connections.21"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.9/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1391140684"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="31" y="20" style="//@styles.1" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Process Create Rules"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiservicetask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="82493526"/>
-    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="537" y="210">
-      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
-        <points y="20"/>
-        <points x="20"/>
-        <points x="40" y="20"/>
-        <points x="20" y="40"/>
-        <points y="20"/>
-      </graphicsAlgorithmChildren>
-      <points y="20"/>
-      <points x="20"/>
-      <points x="40" y="20"/>
-      <points x="20" y="40"/>
-      <points y="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.3 //@connections.5" incomingConnections="//@connections.2"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.10/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <anchors xsi:type="pi:ChopboxAnchor"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.10/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="30" y="10"/>
-        <points x="10" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="10" y="10"/>
-        <points x="30" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="115472372"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="121" height="71" x="387" y="485">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="121" height="71" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.4" incomingConnections="//@connections.19"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.11/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="115472372"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="121" height="39" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Create Service Process"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="12" height="12" x="54" y="57" id="org.activiti.designer.guimi.parallel" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="2077291140"/>
-    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="887" y="210">
-      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
-        <points y="20"/>
-        <points x="20"/>
-        <points x="40" y="20"/>
-        <points x="20" y="40"/>
-        <points y="20"/>
-      </graphicsAlgorithmChildren>
-      <points y="20"/>
-      <points x="20"/>
-      <points x="40" y="20"/>
-      <points x="20" y="40"/>
-      <points y="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.8 //@connections.9 //@connections.10 //@connections.11 //@connections.22 //@connections.24 //@connections.26 //@connections.29" incomingConnections="//@connections.7"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.12/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <anchors xsi:type="pi:ChopboxAnchor"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.12/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="30" y="10"/>
-        <points x="10" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="10" y="10"/>
-        <points x="30" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1266031123"/>
-    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="1237" y="80">
-      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
-        <points y="20"/>
-        <points x="20"/>
-        <points x="40" y="20"/>
-        <points x="20" y="40"/>
-        <points y="20"/>
-      </graphicsAlgorithmChildren>
-      <points y="20"/>
-      <points x="20"/>
-      <points x="40" y="20"/>
-      <points x="20" y="40"/>
-      <points y="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.13 //@connections.15" incomingConnections="//@connections.12"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.13/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <anchors xsi:type="pi:ChopboxAnchor"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.13/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="30" y="10"/>
-        <points x="10" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="10" y="10"/>
-        <points x="30" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1500004015"/>
-    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="1137" y="169">
-      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0">
-        <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="31" height="31" x="2" y="2" style="//@styles.0"/>
-      </graphicsAlgorithmChildren>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.14" incomingConnections="//@connections.13"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.14/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="20" height="20" x="7" y="7" id="org.activiti.designer.guievent.timer" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="2077077883"/>
-    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="537" y="326">
-      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
-        <points y="20"/>
-        <points x="20"/>
-        <points x="40" y="20"/>
-        <points x="20" y="40"/>
-        <points y="20"/>
-      </graphicsAlgorithmChildren>
-      <points y="20"/>
-      <points x="20"/>
-      <points x="40" y="20"/>
-      <points x="20" y="40"/>
-      <points y="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.19 //@connections.20" incomingConnections="//@connections.3"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.15/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <anchors xsi:type="pi:ChopboxAnchor"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.15/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="30" y="10"/>
-        <points x="10" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="10" y="10"/>
-        <points x="30" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="200356510"/>
-    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="385" y="329">
-      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0">
-        <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="31" height="31" x="2" y="2" style="//@styles.0"/>
-      </graphicsAlgorithmChildren>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.21" incomingConnections="//@connections.20"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.16/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="20" height="20" x="7" y="7" id="org.activiti.designer.guievent.timer" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1859538327"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="143" height="81" x="1095" y="710">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="143" height="81" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.23" incomingConnections="//@connections.22"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.17/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1859538327"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="143" height="49" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Service Test Orchestration"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1380140605"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="129" height="90" x="1094" y="332">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="129" height="90" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.25" incomingConnections="//@connections.24"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.18/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1380140605"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="129" height="58" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="CR Deployment Request"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1669054728"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="130" height="71" x="1094" y="820">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="130" height="71" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.27" incomingConnections="//@connections.26"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.19/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1669054728"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="130" height="39" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Generic Resource Deployment Request"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="767024104"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="121" height="71" x="1070" y="900">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="3" transparency="0.0" width="121" height="71" style="//@styles.1" cornerHeight="5" cornerWidth="5"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.28" incomingConnections="//@connections.29"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.20/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="767024104"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="121" height="46" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="Metrico Request"/>
-    </children>
-  </children>
-  <styles foreground="//@colors.2" lineWidth="20" id="EVENT">
-    <renderingStyle>
-      <adaptedGradientColoredAreas definedStyleId="bpmnEventStyle" gradientType="0">
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="250" green="251" blue="252"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="250" green="251" blue="252"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-      </adaptedGradientColoredAreas>
-    </renderingStyle>
-  </styles>
-  <styles foreground="//@colors.2" lineWidth="20" id="TASK">
-    <renderingStyle>
-      <adaptedGradientColoredAreas definedStyleId="bpmnTaskStyle" gradientType="0">
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="250" green="251" blue="252"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="255" green="255" blue="204"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-      </adaptedGradientColoredAreas>
-    </renderingStyle>
-  </styles>
-  <styles background="//@colors.2" foreground="//@colors.2" lineWidth="1" id="BPMN-POLYGON-ARROW"/>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@anchors.0" end="//@children.8/@anchors.0">
-    <properties key="independentObject" value="1154264171"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.8/@anchors.0" end="//@children.9/@anchors.0">
-    <properties key="independentObject" value="674474777"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.9/@anchors.0" end="//@children.10/@anchors.0">
-    <properties key="independentObject" value="953396352"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.10/@anchors.0" end="//@children.15/@anchors.0">
-    <properties key="independentObject" value="452838388"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="65" x="10" y="6" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="anyNotCreatedSupportingServices[!allSupportingServicesCreatedAndActive]"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.11/@anchors.0" end="//@children.9/@anchors.0">
-    <properties key="independentObject" value="1314172327"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="322" y="520"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.10/@anchors.0" end="//@children.1/@anchors.0">
-    <properties key="independentObject" value="464090216"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="-1" y="-33" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="allSupportingServicesCreatedAndActive"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.7/@anchors.0" end="//@children.2/@anchors.0">
-    <properties key="independentObject" value="1172247103"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.1/@anchors.0" end="//@children.12/@anchors.0">
-    <properties key="independentObject" value="1200400906"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.4/@anchors.0">
-    <properties key="independentObject" value="373137057"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="10" y="20" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;RFS_OSM&quot;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="283"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.5/@anchors.0">
-    <properties key="independentObject" value="1500062807"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="20" y="234" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;PARTNER&quot;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="520"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.6/@anchors.0">
-    <properties key="independentObject" value="573928657"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="10" y="334" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;AUTO&quot;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="625"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.3/@anchors.0">
-    <properties key="independentObject" value="2122667562"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="10" y="-79" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;MANUALLY&quot;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="100"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.3/@anchors.0" end="//@children.13/@anchors.0">
-    <properties key="independentObject" value="1662918832"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.13/@anchors.0" end="//@children.14/@anchors.0">
-    <properties key="independentObject" value="853148196"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="4" y="19" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="!serviceHandledManually"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1256" y="186"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.14/@anchors.0" end="//@children.3/@anchors.0">
-    <properties key="independentObject" value="1646542006"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1092" y="186"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.13/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="1330428417"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="12" y="-30" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="serviceHandledManually"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1407" y="100"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.4/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="2011653167"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1407" y="283"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.5/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="899440452"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1407" y="520"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.6/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="1381283938"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1407" y="625"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.15/@anchors.0" end="//@children.11/@anchors.0">
-    <properties key="independentObject" value="411143385"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="20" y="27" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="!allSupportingServicesCreated"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="557" y="519"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.15/@anchors.0" end="//@children.16/@anchors.0">
-    <properties key="independentObject" value="1711168274"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="65" x="-98" y="-56" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="allSupportingServicesCreated (but there are some not Active/Terminated)"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.16/@anchors.0" end="//@children.9/@anchors.0">
-    <properties key="independentObject" value="1531148329"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="322" y="346"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.17/@anchors.0">
-    <properties key="independentObject" value="1613365098"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="3" y="449" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;TESTSPEC&quot;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="750"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.17/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="1795927371"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1407" y="750"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.18/@anchors.0">
-    <properties key="independentObject" value="1383985042"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="34" y="94" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;RFS_CRSPEC&quot;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="377"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.18/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="271142928"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.19/@anchors.0">
-    <properties key="independentObject" value="2008707740"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="100" height="39" x="3" y="539" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value="brokeActivity==&quot;GRSPEC&quot;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="855"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.19/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="831845527"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1407" y="855"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.20/@anchors.0" end="//@children.7/@anchors.0">
-    <properties key="independentObject" value="1324951383"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value=""/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="1407" y="935"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.12/@anchors.0" end="//@children.20/@anchors.0">
-    <properties key="independentObject" value="269254567"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.0" verticalAlignment="ALIGNMENT_TOP" value=""/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="907" y="935"/>
-  </connections>
-  <colors red="227" green="238" blue="249"/>
-  <colors red="255" green="255" blue="255"/>
-  <colors/>
-  <fonts name="Arial" size="8"/>
-  <fonts name="Arial" size="8" bold="true"/>
-</pi:Diagram>
diff --git a/.bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d b/.bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d
deleted file mode 100644
index 396e2bf..0000000
--- a/.bpmn/src/main/resources/processes/TerminateScheduledServices.bpmn2d
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="TerminateScheduledServices" snapToGrid="true" version="0.13.0">
-  <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
-  <colors red="227" green="238" blue="249"/>
-  <colors red="255" green="255" blue="255"/>
-</pi:Diagram>
diff --git a/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java b/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
index 272a3ea..0f5d875 100644
--- a/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
+++ b/src/main/java/org/etsi/osl/osom/management/AutomationCheck.java
@@ -89,7 +89,7 @@ public class AutomationCheck implements JavaDelegate {
 				execution.setVariable("brokeActivity", "RFS_OSM" ); 						
 			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") &&  ( spec.findSpecCharacteristicByName( "_CR_SPEC" ) != null ) ) {
 				execution.setVariable("brokeActivity", "RFS_CRSPEC" );
-			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") &&  ( spec.findSpecCharacteristicByName( "_MT_" ) != null ) ) {
+			}  else if ( spec.getType().equals("ResourceFacingServiceSpecification") &&  ( spec.findSpecCharacteristicByName( "_MT_QUERY" ) != null ) ) {
 				 execution.setVariable("brokeActivity", "RFS_MTSPEC" );
 			} else if ( spec.getType().equals("ResourceFacingServiceSpecification") ) {
               execution.setVariable("brokeActivity", "GRSPEC" );                      
diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
new file mode 100644
index 0000000..356f8c3
--- /dev/null
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
@@ -0,0 +1,50 @@
+package org.etsi.osl.osom.management;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.sim638.model.Service;
+import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
+import org.flowable.engine.delegate.DelegateExecution;
+import org.flowable.engine.delegate.JavaDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component(value = "metricoOrchestrationCheckDeploymentService")
+public class MetricoOrchestrationCheckDeploymentService implements JavaDelegate {
+    private static final transient Log logger = LogFactory.getLog(MetricoOrchestrationCheckDeploymentService.class.getName());
+
+    @Value("${spring.application.name}")
+    private String compname;
+
+    @Autowired
+    private ServiceOrderManager serviceOrderManager;
+
+    @Override
+    public void execute(DelegateExecution execution) {
+
+        logger.info( "MetricoOrchestrationService" );
+        logger.info( execution.getVariableNames().toString() );
+
+        if ( execution.getVariable("contextServiceId") == null) {
+
+            logger.error( "Variable contextServiceId is NULL!" );
+            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
+            return;
+        }
+        Service aService = serviceOrderManager.retrieveService( (String) execution.getVariable("contextServiceId") );
+
+        if ( aService == null ) {
+            logger.info( "aService is null for contextServiceId = " +(String) execution.getVariable("contextServiceId") );
+            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
+            return;
+        }
+
+        execution.setVariable("serviceDeploymentFinished", Boolean.FALSE );
+
+        ServiceUpdate supd = new ServiceUpdate();
+        boolean propagateToSO = false;
+
+
+    }
+}
diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index 60f6395..a8e8ca2 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -2,49 +2,48 @@ package org.etsi.osl.osom.management;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecCharacteristic;
+import org.etsi.osl.tmf.scm633.model.ServiceSpecification;
 import org.etsi.osl.tmf.sim638.model.Service;
-import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
+import org.etsi.osl.tmf.so641.model.ServiceOrder;
 import org.flowable.engine.delegate.DelegateExecution;
 import org.flowable.engine.delegate.JavaDelegate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
-@Component(value = "metricoOrchestrationService")
+@Component(value = "metricoOrchestrationService") //bean name
 public class MetricoOrchestrationService implements JavaDelegate {
-    private static final transient Log logger = LogFactory.getLog(MetricoOrchestrationService.class.getName());
 
-    @Value("${spring.application.name}")
-    private String compname;
+	private static final transient Log logger = LogFactory.getLog(NFVOrchestrationService.class.getName());
 
-    @Autowired
-    private ServiceOrderManager serviceOrderManager;
+
+	@Value("${spring.application.name}")
+	private String compname;
+	
+	
+	@Autowired
+	private ServiceOrderManager serviceOrderManager;
+	
 
     @Override
     public void execute(DelegateExecution execution) {
-
-        logger.info( "MetricoOrchestrationService" );
-        logger.info( execution.getVariableNames().toString() );
-
-        if ( execution.getVariable("contextServiceId") == null) {
-
-            logger.error( "Variable contextServiceId is NULL!" );
-            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
-            return;
-        }
-        Service aService = serviceOrderManager.retrieveService( (String) execution.getVariable("contextServiceId") );
-
-        if ( aService == null ) {
-            logger.info( "aService is null for contextServiceId = " +(String) execution.getVariable("contextServiceId") );
-            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
-            return;
-        }
-
-        execution.setVariable("serviceDeploymentFinished", Boolean.FALSE );
-
-        ServiceUpdate supd = new ServiceUpdate();
-        boolean propagateToSO = false;
-
-
+		ServiceOrder sorder = serviceOrderManager.retrieveServiceOrder( execution.getVariable("orderid").toString() );
+		Service aService = serviceOrderManager.retrieveService( (String) execution.getVariable("contextServiceId") );
+		logger.info("Service name:" + aService.getName() );
+		logger.info("Service state:" + aService.getState()  );			
+		logger.info("Request to TMF628 for Service: " + aService.getId() );
+		
+		//we need to retrieve here the Service Spec of this service that we send to the NFVO
+		
+		ServiceSpecification spec = serviceOrderManager.retrieveServiceSpec( aService.getServiceSpecificationRef().getId() );
+		
+		if ( spec!=null ) {			
+
+			ServiceSpecCharacteristic c = spec.getServiceSpecCharacteristicByName( "NSDID" );						
+
+		
+		
     }
+
 }
diff --git a/src/main/resources/processes/ServiceCreationProcess.bpmn b/src/main/resources/processes/ServiceCreationProcess.bpmn
index e296d3d..2d53ce4 100644
--- a/src/main/resources/processes/ServiceCreationProcess.bpmn
+++ b/src/main/resources/processes/ServiceCreationProcess.bpmn
@@ -87,7 +87,9 @@
     <sequenceFlow id="flow46" sourceRef="activityGenericResourceDeploymentReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
     <callActivity id="parallelMetricoReq" name="Metrico Request" activiti:async="true" calledElement="procMetricoDeploymentRequest" activiti:inheritVariables="false"></callActivity>
     <sequenceFlow id="flow47" sourceRef="parallelMetricoReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
-    <sequenceFlow id="flow48" sourceRef="exclusivegateway2" targetRef="parallelMetricoReq"></sequenceFlow>
+    <sequenceFlow id="flow48" name="brokeActivity==&quot;RFS_MTSPEC&quot;" sourceRef="exclusivegateway2" targetRef="parallelMetricoReq">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${brokeActivity=='RFS_MTSPEC'}]]></conditionExpression>
+    </sequenceFlow>
   </process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_CreateServiceProcess">
     <bpmndi:BPMNPlane bpmnElement="CreateServiceProcess" id="BPMNPlane_CreateServiceProcess">
@@ -332,6 +334,9 @@
         <omgdi:waypoint x="907.0" y="250.0"></omgdi:waypoint>
         <omgdi:waypoint x="907.0" y="935.0"></omgdi:waypoint>
         <omgdi:waypoint x="1070.0" y="935.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="39.0" width="100.0" x="950.0" y="879.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
-- 
GitLab


From aa55fdd712311ef7cb3b09272aebd842e0d43229 Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Wed, 18 Dec 2024 09:24:08 +0200
Subject: [PATCH 15/31] fix for #30

---
 .../osom/management/CROrchestrationCheckDeploymentService.java | 3 ++-
 .../osom/management/GCOrchestrationCheckDeploymentService.java | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/CROrchestrationCheckDeploymentService.java b/src/main/java/org/etsi/osl/osom/management/CROrchestrationCheckDeploymentService.java
index 8d036fe..b69a389 100644
--- a/src/main/java/org/etsi/osl/osom/management/CROrchestrationCheckDeploymentService.java
+++ b/src/main/java/org/etsi/osl/osom/management/CROrchestrationCheckDeploymentService.java
@@ -91,13 +91,14 @@ public class CROrchestrationCheckDeploymentService implements JavaDelegate {
             Service serviceResult = serviceOrderManager.updateService( aService.getId(), supd, propagateToSO );
             return;
           }
+         
           rlist.add(res);
           
         }
         @Valid
         ServiceStateType currentState = aService.getState();        
         
-	    ServiceStateType nextState = aService.findNextStateBasedOnSupportingResources(rlist);
+	    ServiceStateType nextState =  aService.findNextStateBasedOnResourceList(rlist);
 	    
 	    if (!currentState.equals(nextState)) {
 	        supd.setState( nextState );     
diff --git a/src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java
index 7f8d9a4..8f1e4d0 100644
--- a/src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java
+++ b/src/main/java/org/etsi/osl/osom/management/GCOrchestrationCheckDeploymentService.java
@@ -96,7 +96,7 @@ public class GCOrchestrationCheckDeploymentService implements JavaDelegate {
         @Valid
         ServiceStateType currentState = aService.getState();        
         
-	    ServiceStateType nextState = aService.findNextStateBasedOnSupportingResources(rlist);
+	    ServiceStateType nextState = aService.findNextStateBasedOnResourceList(rlist);
 	    
 	    if (!currentState.equals(nextState)) {
 	        supd.setState( nextState );     
-- 
GitLab


From 3a46ee9919a041f0d542d40133ae8dc6600f4eea Mon Sep 17 00:00:00 2001
From: George Tziavas <g.tziavas@ac.upatras.gr>
Date: Thu, 19 Dec 2024 14:56:00 +0200
Subject: [PATCH 16/31] Metrico Orchestration updates

---
 ...coOrchestrationCheckDeploymentService.java |  55 +++-
 .../MetricoOrchestrationService.java          | 267 ++++++++++++++++--
 src/main/resources/application.yml            |   6 +-
 3 files changed, 304 insertions(+), 24 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
index 356f8c3..08ded0b 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
@@ -1,7 +1,12 @@
 package org.etsi.osl.osom.management;
 
+import jakarta.validation.Valid;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.etsi.osl.tmf.common.model.service.Note;
+import org.etsi.osl.tmf.common.model.service.ResourceRef;
+import org.etsi.osl.tmf.common.model.service.ServiceStateType;
+import org.etsi.osl.tmf.ri639.model.Resource;
 import org.etsi.osl.tmf.sim638.model.Service;
 import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
 import org.flowable.engine.delegate.DelegateExecution;
@@ -10,20 +15,26 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.util.ArrayList;
+import java.util.List;
+
 @Component(value = "metricoOrchestrationCheckDeploymentService")
 public class MetricoOrchestrationCheckDeploymentService implements JavaDelegate {
     private static final transient Log logger = LogFactory.getLog(MetricoOrchestrationCheckDeploymentService.class.getName());
 
-    @Value("${spring.application.name}")
-    private String compname;
-
     @Autowired
     private ServiceOrderManager serviceOrderManager;
 
+
+    @Value("${spring.application.name}")
+    private String compname;
+    
     @Override
     public void execute(DelegateExecution execution) {
 
-        logger.info( "MetricoOrchestrationService" );
+        logger.info( "MetricoOrchestrationCheckDeploymentService" );
         logger.info( execution.getVariableNames().toString() );
 
         if ( execution.getVariable("contextServiceId") == null) {
@@ -41,10 +52,44 @@ public class MetricoOrchestrationCheckDeploymentService implements JavaDelegate
         }
 
         execution.setVariable("serviceDeploymentFinished", Boolean.FALSE );
-
         ServiceUpdate supd = new ServiceUpdate();
         boolean propagateToSO = false;
 
+        List<Resource> rlist = new ArrayList<Resource>();
+        for (ResourceRef rref : aService.getSupportingResource()) {
+            Resource res = serviceOrderManager.retrieveResource(rref.getId());
+
+            if (  res == null ) {
+                supd.setState( ServiceStateType.TERMINATED);
+                execution.setVariable("serviceDeploymentFinished", Boolean.TRUE);
+                Service serviceResult = serviceOrderManager.updateService( aService.getId(), supd, propagateToSO );
+                return;
+            }
+            rlist.add(res);
+        }
+        @Valid
+        ServiceStateType currentState = aService.getState();
+        ServiceStateType nextState = aService.findNextStateBasedOnSupportingResources(rlist);
 
+        if (!currentState.equals(nextState)) {
+            supd.setState( nextState );
+            Note n = new Note();
+            n.setText("Service Status Changed to: " +  nextState);
+            n.setAuthor(compname);
+            n.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+            supd.addNoteItem(n);
+            aService = serviceOrderManager.updateService( aService.getId(), supd, propagateToSO );
+        }
+
+        if ( aService!= null ) {
+            if ( aService.getState().equals(ServiceStateType.ACTIVE)
+                    || aService.getState().equals(ServiceStateType.TERMINATED)) {
+
+                logger.info("Deployment Status OK. Service state = " + aService.getState() );
+                execution.setVariable("serviceDeploymentFinished", Boolean.TRUE);
+                return;
+            }
+        }
+        logger.info("Wait For Deployment Status. ");
     }
 }
diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index a8e8ca2..4df3ee4 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -1,22 +1,52 @@
 package org.etsi.osl.osom.management;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.camel.ProducerTemplate;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.etsi.osl.tmf.scm633.model.ServiceSpecCharacteristic;
+import org.etsi.osl.tmf.common.model.service.Characteristic;
+import org.etsi.osl.tmf.common.model.service.Note;
+import org.etsi.osl.tmf.common.model.service.ResourceRef;
+import org.etsi.osl.tmf.common.model.service.ServiceStateType;
+import org.etsi.osl.tmf.pm628.model.*;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef;
+import org.etsi.osl.tmf.ri639.model.Resource;
+import org.etsi.osl.tmf.ri639.model.ResourceCreate;
 import org.etsi.osl.tmf.scm633.model.ServiceSpecification;
 import org.etsi.osl.tmf.sim638.model.Service;
+import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
 import org.etsi.osl.tmf.so641.model.ServiceOrder;
 import org.flowable.engine.delegate.DelegateExecution;
 import org.flowable.engine.delegate.JavaDelegate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.stereotype.Component;
 
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import java.util.ArrayList;
+import java.util.List;
+
 @Component(value = "metricoOrchestrationService") //bean name
 public class MetricoOrchestrationService implements JavaDelegate {
 
 	private static final transient Log logger = LogFactory.getLog(NFVOrchestrationService.class.getName());
 
+	@Autowired
+	private ProducerTemplate producerTemplate;
+	@Value("{PM_MEASUREMENT_COLLECTION_JOB_ADD}")
+	private String PM_MEASUREMENT_COLLECTION_JOB_ADD = "";
+
+	@Value("{PM_MEASUREMENT_COLLECTION_JOB_CREATED}")
+	private String PM_MEASUREMENT_COLLECTION_JOB_CREATED = "";
 
 	@Value("${spring.application.name}")
 	private String compname;
@@ -28,22 +58,223 @@ public class MetricoOrchestrationService implements JavaDelegate {
 
     @Override
     public void execute(DelegateExecution execution) {
-		ServiceOrder sorder = serviceOrderManager.retrieveServiceOrder( execution.getVariable("orderid").toString() );
-		Service aService = serviceOrderManager.retrieveService( (String) execution.getVariable("contextServiceId") );
-		logger.info("Service name:" + aService.getName() );
-		logger.info("Service state:" + aService.getState()  );			
-		logger.info("Request to TMF628 for Service: " + aService.getId() );
-		
-		//we need to retrieve here the Service Spec of this service that we send to the NFVO
-		
-		ServiceSpecification spec = serviceOrderManager.retrieveServiceSpec( aService.getServiceSpecificationRef().getId() );
-		
-		if ( spec!=null ) {			
-
-			ServiceSpecCharacteristic c = spec.getServiceSpecCharacteristicByName( "NSDID" );						
-
-		
-		
-    }
+		ServiceOrder sorder = serviceOrderManager.retrieveServiceOrder(execution.getVariable("orderid").toString());
+		ServiceUpdate su = new ServiceUpdate();// the object to update the service
+		Service aService = serviceOrderManager.retrieveService((String) execution.getVariable("contextServiceId"));
+		logger.info("Service name:" + aService.getName());
+		logger.info("Service state:" + aService.getState());
+		logger.info("Request to TMF628 for Service: " + aService.getId());
+
+
+		ServiceSpecification spec = serviceOrderManager.retrieveServiceSpec(aService.getServiceSpecificationRef().getId());
+
+		if (spec != null) {
+
+			Characteristic serviceCharacteristic;
+			MeasurementCollectionJobFVO mcjFVO = new MeasurementCollectionJobFVO();
+			mcjFVO.setProducingApplicationId(aService.getId());
+
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_CHARACTERISTIC_NAME");
+			String characteristicName = String.valueOf(serviceCharacteristic.getValue());
+			mcjFVO.setOutputFormat(characteristicName);
+
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_SERVICEUUID");
+			String cfs_id = String.valueOf(serviceCharacteristic.getValue());
+			mcjFVO.setConsumingApplicationId(cfs_id);
+
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_END_TIME");
+			String endTimeString = 	String.valueOf(serviceCharacteristic.getValue());
+			ScheduleDefinitionFVO scheduleDefinition = new ScheduleDefinitionFVO();
+			if (endTimeString != null) {
+				OffsetDateTime endTime = convertStringToOffsetDateTime(endTimeString, DateTimeFormat.ISO.DATE_TIME );
+				scheduleDefinition.setScheduleDefinitionEndTime(endTime);
+			} else{
+				OffsetDateTime endTime = OffsetDateTime.now().plusHours(1);
+				scheduleDefinition.setScheduleDefinitionEndTime(endTime);
+			}
+
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_START_TIME");
+			String startTimeString = String.valueOf(serviceCharacteristic.getValue());
+			if (endTimeString != null) {
+				OffsetDateTime startTime = convertStringToOffsetDateTime(startTimeString, DateTimeFormat.ISO.DATE_TIME );
+				scheduleDefinition.setScheduleDefinitionEndTime(startTime);
+			} else{
+				OffsetDateTime startTime = OffsetDateTime.now();
+				scheduleDefinition.setScheduleDefinitionStartTime(startTime);
+			}
+			List<ScheduleDefinitionFVO> scheduleDefinitions = new ArrayList<>();
+			scheduleDefinitions.add(scheduleDefinition);
+			mcjFVO.setScheduleDefinition(scheduleDefinitions);
+
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_RECURRING_INTERVAL");
+			String recurringIntervalString = String.valueOf(serviceCharacteristic.getValue());
+			if (recurringIntervalString != null) {
+				if (Granularity.contains(recurringIntervalString)){
+					Granularity recurringInterval = Granularity.valueOf(recurringIntervalString);
+					mcjFVO.setGranularity(recurringInterval);
+				} else {
+					logger.error("Invalid _MT_RECURRING_INTERVAL value. Valid values are:" + Granularity.getPossibleValues() + " It will be set to 1 minute.");
+					Granularity recurringInterval = Granularity.G_1M;
+					mcjFVO.setGranularity(recurringInterval);
+				}
+			} else {
+				Granularity recurringInterval = Granularity.G_1M;
+				mcjFVO.setGranularity(recurringInterval);
+			}
+
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_TYPE");
+			String monitoringType = String.valueOf(serviceCharacteristic.getValue());
+			DataAccessEndpointFVO dataAccessEndpoint = new DataAccessEndpointFVO();
+			dataAccessEndpoint.setType(monitoringType);
+
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_QUERY");
+			String monitoringQuery = String.valueOf(serviceCharacteristic.getValue());
+			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_URL");
+			String monitoringURL = String.valueOf(serviceCharacteristic.getValue());
+            try {
+                URI monitoringURI = createUri(monitoringURL, monitoringQuery);
+				dataAccessEndpoint.setUri(monitoringURI);
+            } catch (URISyntaxException e) {
+                throw new RuntimeException(e);
+            }
+
+			List<DataAccessEndpointFVO> dataAccessEndpoints = new ArrayList<>();
+			dataAccessEndpoints.add(dataAccessEndpoint);
+			mcjFVO.setDataAccessEndpoint(dataAccessEndpoints);
+
+			MeasurementCollectionJob mcj = addMeasurementCollectionJob(mcjFVO);
+
+			if  (mcj != null){
+				publishEventMeasurementCollectionJobCreated( mcj.getUuid() );
+
+				ResourceSpecificationRef resourceSpecificationRef = spec.getResourceSpecification().stream().findFirst().get();
+				Resource resourceMT = createRelatedResource( resourceSpecificationRef, sorder, aService );
+				ResourceRef resourceRef = new ResourceRef();
+
+				resourceRef.setId( resourceMT.getId() );
+				resourceRef.setName( resourceMT.getName());
+				resourceRef.setType( resourceMT.getType());
+				su.addSupportingResourceItem( resourceRef );
+				su.setState(ServiceStateType.RESERVED);
+				Note successNoteItem = new Note();
+				successNoteItem.setText(String.format("Requesting METRICO to create a new monitoring job"));
+				successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+				successNoteItem.setAuthor(compname);
+				su.addNoteItem(successNoteItem);
+				Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
+
+			} else {
+				logger.error("Measurement Collection Job was not created.");
+			}
+
+
+
+		}
+	}
+
+
+
+
+
+//	Methods created to use in this class
+	public static OffsetDateTime convertStringToOffsetDateTime(String dateTimeString, DateTimeFormat.ISO pattern) {
+		DateTimeFormatter formatter;
+		switch (pattern) {
+			case DATE:
+				formatter = DateTimeFormatter.ISO_DATE;
+				break;
+			case TIME:
+				formatter = DateTimeFormatter.ISO_TIME;
+				break;
+			case DATE_TIME:
+				formatter = DateTimeFormatter.ISO_DATE_TIME;
+				break;
+			default:
+				throw new IllegalArgumentException("Unsupported DateTimeFormat.ISO pattern");
+		}
+		try {
+			OffsetDateTime.parse(dateTimeString, formatter);
+			return OffsetDateTime.parse(dateTimeString, formatter);
+		} catch (DateTimeParseException e) {
+			logger.error(e.getMessage());
+			return null;
+		}
+
+	}
+
+	public static URI createUri(String url, String query) throws URISyntaxException {
+		return new URI(url + "?" + query);
+	}
+
+	public static <T> T toJsonObj(String content, Class<T> valueType)  throws IOException {
+		ObjectMapper mapper = new ObjectMapper();
+		mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+		return mapper.readValue( content, valueType);
+	}
+
+	public static <T> String toJsonString(T object) {
+		ObjectMapper mapper = new ObjectMapper();
+		mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+		try {
+			return mapper.writeValueAsString(object);
+		} catch (JsonProcessingException e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	public MeasurementCollectionJob addMeasurementCollectionJob(MeasurementCollectionJobFVO mcjFVO) {
+
+		logger.debug("Will create a new Measurement Collection Job");
+		try {
+			Object response = producerTemplate.
+					requestBody( PM_MEASUREMENT_COLLECTION_JOB_ADD, mcjFVO);
+			if ( !(response instanceof String)) {
+				logger.error("Measurement Collection Job object is wrong.");
+				return null;
+			}
+			logger.debug("retrieveMeasurementCollectionJobById response is: " + response);
+			MeasurementCollectionJob mcj = toJsonObj( (String)response, MeasurementCollectionJob.class);
+			return mcj;
+		}catch (Exception e) {
+			logger.error("Cannot create a new Measurement Collection Job. " + e.toString());
+		}
+		return null;
+	}
+
+	public void publishEventMeasurementCollectionJobCreated(String uuid) {
+		logger.debug("Publishing event for Measurement Collection Job Created with UUID: " + uuid);
+		try {
+			producerTemplate.sendBody(PM_MEASUREMENT_COLLECTION_JOB_CREATED, uuid);
+		} catch (Exception e) {
+			logger.error("Failed to publish event for Measurement Collection Job Created. " + e.toString());
+		}
+	}
+
+	/**
+	 *
+	 * THe resource has a temporary name.
+	 * later on the name and its characteristics are updated via cridge
+	 * @param rSpecRef
+	 * @param sOrder
+	 * @param aService
+	 * @return
+	 */
+	private Resource createRelatedResource(ResourceSpecificationRef rSpecRef, ServiceOrder sOrder, Service aService) {
+
+		ResourceCreate resCreate = new ResourceCreate();
+		resCreate.setName(   "_cr_tmpname_service_" + aService.getId() );
+		resCreate.setStartOperatingDate( aService.getStartDate() );
+		resCreate.setEndOperatingDate(aService.getEndDate());
+		ResourceSpecificationRef rSpecRefObj = new ResourceSpecificationRef() ;
+		rSpecRefObj.id(rSpecRef.getId())
+				.name( rSpecRef.getName())
+				.setType(rSpecRef.getType());
+		resCreate.setResourceSpecification(rSpecRefObj);
+		return serviceOrderManager.createResource( resCreate, sOrder, rSpecRef.getId() );
+
+
+
+	}
 
 }
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 5e09475..af1510b 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -124,4 +124,8 @@ CATALOG_GET_RESOURCESPEC_BY_NAME_CATEGORY: "jms:queue:CATALOG.GET.RESOURCESPEC_B
 #CRD ACTIONS
 CRD_DEPLOY_CR_REQ: "jms:queue:CRD.DEPLOY.CR_REQ"
 CRD_DELETE_CR_REQ: "jms:queue:CRD.DELETE.CR_REQ"
-CRD_PATCH_CR_REQ: "jms:queue:CRD.PATCH.CR_REQ"
\ No newline at end of file
+CRD_PATCH_CR_REQ: "jms:queue:CRD.PATCH.CR_REQ"
+
+#TMF628 ACTIONS
+PM_MEASUREMENT_COLLECTION_JOB_ADD:         "jms:queue:PM.MEASUREMENTCOLLECTIONJOB.ADD"
+EVENT_MEASUREMENT_COLLECTION_JOB_CREATED:  "jms:topic:EVENT.MEASUREMENTCOLLECTIONJOB.CREATED"
\ No newline at end of file
-- 
GitLab


From d1dba903cfafba6cbdb8576ca5c9cba198738d46 Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 20 Dec 2024 11:50:27 +0200
Subject: [PATCH 17/31] fix for #30

---
 .../etsi/osl/osom/management/ProcessOrderItemActionCheck.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/ProcessOrderItemActionCheck.java b/src/main/java/org/etsi/osl/osom/management/ProcessOrderItemActionCheck.java
index 0b49e90..1addb48 100644
--- a/src/main/java/org/etsi/osl/osom/management/ProcessOrderItemActionCheck.java
+++ b/src/main/java/org/etsi/osl/osom/management/ProcessOrderItemActionCheck.java
@@ -34,6 +34,7 @@ public class ProcessOrderItemActionCheck implements JavaDelegate {
 		ServiceOrder sor = serviceOrderManager.retrieveServiceOrder((String) execution.getVariable("orderid"));
 		String orderItemIdToProcess = (String) execution.getVariable("orderItemId");
 		ServiceOrderItem soi = null;
+        execution.setVariable("saction", "NONE");            
 		
 		for (ServiceOrderItem i : sor.getOrderItem()) {
 			if (i.getUuid().equals( orderItemIdToProcess )){
@@ -46,7 +47,6 @@ public class ProcessOrderItemActionCheck implements JavaDelegate {
             logger.error("In ProcessOrderItemActionCheck cannot find ServiceOrderItem orderItemIdToProcess=:" + orderItemIdToProcess);
             logger.error("In ProcessOrderItemActionCheck cannot find ServiceOrderItem sor.getUuid()=:" + sor.getUuid() );
             logger.error("In ProcessOrderItemActionCheck cannot find ServiceOrderItem sor()=:" + sor.toString() );
-            execution.setVariable("saction", "NONE");            
 			return;
 		}
 		
-- 
GitLab


From f73d330970eef07f57ee451d33d93550e84fb8bc Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Sat, 21 Dec 2024 17:33:50 +0200
Subject: [PATCH 18/31] fix for #30

---
 .../osom/management/ProcessCreateServiceRules.java |  5 +++++
 .../processes/ProcessOrderItemProcess.bpmn         | 14 +++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/ProcessCreateServiceRules.java b/src/main/java/org/etsi/osl/osom/management/ProcessCreateServiceRules.java
index 8aa8166..6ca1a25 100644
--- a/src/main/java/org/etsi/osl/osom/management/ProcessCreateServiceRules.java
+++ b/src/main/java/org/etsi/osl/osom/management/ProcessCreateServiceRules.java
@@ -67,6 +67,11 @@ public class ProcessCreateServiceRules implements JavaDelegate {
 			return;
 		}
 		
+		if ( spec == null) {
+          logger.debug("\tCannot retrieve ServiceSpec:" + contextServiceSpecId);
+		  return;
+		}
+		
 
 		/*
 		 * first find all referenced ServiceSpecs of a ServiceSpec to be created
diff --git a/src/main/resources/processes/ProcessOrderItemProcess.bpmn b/src/main/resources/processes/ProcessOrderItemProcess.bpmn
index 4f386ce..a6b6489 100644
--- a/src/main/resources/processes/ProcessOrderItemProcess.bpmn
+++ b/src/main/resources/processes/ProcessOrderItemProcess.bpmn
@@ -26,6 +26,9 @@
     <sequenceFlow id="flow30" sourceRef="stActionDELETE" targetRef="stProcesOrderItemComplete"></sequenceFlow>
     <sequenceFlow id="flow31" sourceRef="stProcesOrderItemComplete" targetRef="endevent2"></sequenceFlow>
     <sequenceFlow id="flow32" sourceRef="stActionADD" targetRef="CreateServiceProcess"></sequenceFlow>
+    <sequenceFlow id="flow33" name="saction=='NONE'" sourceRef="exclusivegateway1" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${saction=='NONE'}]]></conditionExpression>
+    </sequenceFlow>
   </process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_ProcessOrderItem">
     <bpmndi:BPMNPlane bpmnElement="ProcessOrderItem" id="BPMNPlane_ProcessOrderItem">
@@ -85,7 +88,7 @@
         <omgdi:waypoint x="320.0" y="367.0"></omgdi:waypoint>
         <omgdi:waypoint x="464.0" y="367.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="14.0" width="88.0" x="340.0" y="339.0"></omgdc:Bounds>
+          <omgdc:Bounds height="14.0" width="100.0" x="340.0" y="339.0"></omgdc:Bounds>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow28" id="BPMNEdge_flow28">
@@ -111,6 +114,15 @@
         <omgdi:waypoint x="515.0" y="87.0"></omgdi:waypoint>
         <omgdi:waypoint x="560.0" y="87.0"></omgdi:waypoint>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow33" id="BPMNEdge_flow33">
+        <omgdi:waypoint x="320.0" y="197.0"></omgdi:waypoint>
+        <omgdi:waypoint x="319.0" y="467.0"></omgdi:waypoint>
+        <omgdi:waypoint x="867.0" y="467.0"></omgdi:waypoint>
+        <omgdi:waypoint x="867.0" y="191.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="14.0" width="100.0" x="335.0" y="449.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </definitions>
\ No newline at end of file
-- 
GitLab


From 1d4f8224889cfc16e27b77f4bd9fd5f272273cf2 Mon Sep 17 00:00:00 2001
From: George Tziavas <g.tziavas@ac.upatras.gr>
Date: Sat, 21 Dec 2024 20:48:26 +0200
Subject: [PATCH 19/31] 	modified:  
 src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java

---
 .../management/MetricoOrchestrationCheckDeploymentService.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
index 08ded0b..286db4b 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
@@ -30,7 +30,7 @@ public class MetricoOrchestrationCheckDeploymentService implements JavaDelegate
 
     @Value("${spring.application.name}")
     private String compname;
-    
+
     @Override
     public void execute(DelegateExecution execution) {
 
-- 
GitLab


From d2eb7370c2bbe55018681baaa091b7831f6fc18e Mon Sep 17 00:00:00 2001
From: George Tziavas <g.tziavas@ac.upatras.gr>
Date: Mon, 23 Dec 2024 13:02:22 +0200
Subject: [PATCH 20/31] 	finished:  
 src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java

---
 .../management/MetricoOrchestrationCheckDeploymentService.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
index 286db4b..8809c08 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationCheckDeploymentService.java
@@ -69,7 +69,7 @@ public class MetricoOrchestrationCheckDeploymentService implements JavaDelegate
         }
         @Valid
         ServiceStateType currentState = aService.getState();
-        ServiceStateType nextState = aService.findNextStateBasedOnSupportingResources(rlist);
+        ServiceStateType nextState = aService.findNextStateBasedOnResourceList(rlist);
 
         if (!currentState.equals(nextState)) {
             supd.setState( nextState );
-- 
GitLab


From 9dcbe8bb9f7821bc57bfd3a76260cd2e12cc4ead Mon Sep 17 00:00:00 2001
From: George Tziavas <g.tziavas@ac.upatras.gr>
Date: Mon, 23 Dec 2024 13:48:02 +0200
Subject: [PATCH 21/31] 	new file:  
 src/main/resources/processes/MetricoDeploymentReq.bpmn

---
 .../processes/MetricoDeploymentReq.bpmn       | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 src/main/resources/processes/MetricoDeploymentReq.bpmn

diff --git a/src/main/resources/processes/MetricoDeploymentReq.bpmn b/src/main/resources/processes/MetricoDeploymentReq.bpmn
new file mode 100644
index 0000000..c931982
--- /dev/null
+++ b/src/main/resources/processes/MetricoDeploymentReq.bpmn
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="procMetricoDeploymentRequest" name="Metrico Deployment Request" isExecutable="true">
+    <startEvent id="startevent1" name="Start"></startEvent>
+    <serviceTask id="stMetricoCreateTask" name="Metrico Create Task" activiti:delegateExpression="${metricoOrchestrationService}"></serviceTask>
+    <serviceTask id="stCheckMetricoServiceDeployment" name="Check METRICO Service Deployment" activiti:delegateExpression="${metricoOrchestrationCheckDeploymentService}"></serviceTask>
+    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
+    <intermediateCatchEvent id="timerintermediatecatchevent1" name="TimerCatchEvent">
+      <timerEventDefinition>
+        <timeDuration>PT30S</timeDuration>
+      </timerEventDefinition>
+    </intermediateCatchEvent>
+    <sequenceFlow id="flow3" sourceRef="stCheckMetricoServiceDeployment" targetRef="exclusivegateway1"></sequenceFlow>
+    <sequenceFlow id="flow4" sourceRef="exclusivegateway1" targetRef="timerintermediatecatchevent1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!serviceDeploymentFinished}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <sequenceFlow id="flow5" sourceRef="exclusivegateway1" targetRef="endevent1"></sequenceFlow>
+    <sequenceFlow id="flow6" sourceRef="timerintermediatecatchevent1" targetRef="stCheckMetricoServiceDeployment"></sequenceFlow>
+    <sequenceFlow id="flow7" sourceRef="stMetricoCreateTask" targetRef="stCheckMetricoServiceDeployment"></sequenceFlow>
+    <sequenceFlow id="flow8" sourceRef="startevent1" targetRef="stMetricoCreateTask"></sequenceFlow>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_procMetricoDeploymentRequest">
+    <bpmndi:BPMNPlane bpmnElement="procMetricoDeploymentRequest" id="BPMNPlane_procMetricoDeploymentRequest">
+      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="120.0" y="165.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="stMetricoCreateTask" id="BPMNShape_stMetricoCreateTask">
+        <omgdc:Bounds height="91.0" width="105.0" x="250.0" y="140.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="stCheckMetricoServiceDeployment" id="BPMNShape_stCheckMetricoServiceDeployment">
+        <omgdc:Bounds height="91.0" width="105.0" x="500.0" y="140.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
+        <omgdc:Bounds height="40.0" width="40.0" x="800.0" y="165.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="timerintermediatecatchevent1" id="BPMNShape_timerintermediatecatchevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="650.0" y="330.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="950.0" y="165.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="605.0" y="185.0"></omgdi:waypoint>
+        <omgdi:waypoint x="800.0" y="185.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
+        <omgdi:waypoint x="820.0" y="205.0"></omgdi:waypoint>
+        <omgdi:waypoint x="820.0" y="347.0"></omgdi:waypoint>
+        <omgdi:waypoint x="685.0" y="347.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="840.0" y="185.0"></omgdi:waypoint>
+        <omgdi:waypoint x="950.0" y="182.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
+        <omgdi:waypoint x="650.0" y="347.0"></omgdi:waypoint>
+        <omgdi:waypoint x="552.0" y="347.0"></omgdi:waypoint>
+        <omgdi:waypoint x="552.0" y="231.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
+        <omgdi:waypoint x="355.0" y="185.0"></omgdi:waypoint>
+        <omgdi:waypoint x="500.0" y="185.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+        <omgdi:waypoint x="155.0" y="182.0"></omgdi:waypoint>
+        <omgdi:waypoint x="250.0" y="185.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
-- 
GitLab


From 42b911247f8ff924814730b873cb533bb0ea4b68 Mon Sep 17 00:00:00 2001
From: Kostis Trantzas <ktrantzas@ece.upatras.gr>
Date: Fri, 10 Jan 2025 12:59:39 +0200
Subject: [PATCH 22/31] fix for #29:

- updates on created ResourceRef
---
 .../MetricoOrchestrationService.java          | 29 ++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index 4df3ee4..8b40bfc 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -10,10 +10,12 @@ import org.etsi.osl.tmf.common.model.service.Characteristic;
 import org.etsi.osl.tmf.common.model.service.Note;
 import org.etsi.osl.tmf.common.model.service.ResourceRef;
 import org.etsi.osl.tmf.common.model.service.ServiceStateType;
+import org.etsi.osl.tmf.common.model.Any;
 import org.etsi.osl.tmf.pm628.model.*;
 import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef;
 import org.etsi.osl.tmf.ri639.model.Resource;
 import org.etsi.osl.tmf.ri639.model.ResourceCreate;
+import org.etsi.osl.tmf.ri639.model.ResourceStatusType;
 import org.etsi.osl.tmf.scm633.model.ServiceSpecification;
 import org.etsi.osl.tmf.sim638.model.Service;
 import org.etsi.osl.tmf.sim638.model.ServiceUpdate;
@@ -145,10 +147,9 @@ public class MetricoOrchestrationService implements JavaDelegate {
 			MeasurementCollectionJob mcj = addMeasurementCollectionJob(mcjFVO);
 
 			if  (mcj != null){
-				publishEventMeasurementCollectionJobCreated( mcj.getUuid() );
 
 				ResourceSpecificationRef resourceSpecificationRef = spec.getResourceSpecification().stream().findFirst().get();
-				Resource resourceMT = createRelatedResource( resourceSpecificationRef, sorder, aService );
+				Resource resourceMT = createRelatedResource( resourceSpecificationRef, sorder, aService, mcj );
 				ResourceRef resourceRef = new ResourceRef();
 
 				resourceRef.setId( resourceMT.getId() );
@@ -163,6 +164,8 @@ public class MetricoOrchestrationService implements JavaDelegate {
 				su.addNoteItem(successNoteItem);
 				Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
 
+				publishEventMeasurementCollectionJobCreated( mcj.getUuid() );
+
 			} else {
 				logger.error("Measurement Collection Job was not created.");
 			}
@@ -253,28 +256,40 @@ public class MetricoOrchestrationService implements JavaDelegate {
 
 	/**
 	 *
-	 * THe resource has a temporary name.
-	 * later on the name and its characteristics are updated via cridge
+	 * The resource maps the created MCJ
 	 * @param rSpecRef
 	 * @param sOrder
 	 * @param aService
 	 * @return
 	 */
-	private Resource createRelatedResource(ResourceSpecificationRef rSpecRef, ServiceOrder sOrder, Service aService) {
+	private Resource createRelatedResource(ResourceSpecificationRef rSpecRef, ServiceOrder sOrder, Service aService, MeasurementCollectionJob mcj) {
 
 		ResourceCreate resCreate = new ResourceCreate();
-		resCreate.setName(   "_cr_tmpname_service_" + aService.getId() );
+		resCreate.setName(   rSpecRef.getName() + "-" + aService.getId() );
 		resCreate.setStartOperatingDate( aService.getStartDate() );
 		resCreate.setEndOperatingDate(aService.getEndDate());
+		resCreate.setResourceStatus (ResourceStatusType.RESERVED);
+
 		ResourceSpecificationRef rSpecRefObj = new ResourceSpecificationRef() ;
 		rSpecRefObj.id(rSpecRef.getId())
 				.name( rSpecRef.getName())
 				.setType(rSpecRef.getType());
 		resCreate.setResourceSpecification(rSpecRefObj);
-		return serviceOrderManager.createResource( resCreate, sOrder, rSpecRef.getId() );
+
+		org.etsi.osl.tmf.ri639.model.Characteristic resCharacteristicItem =  new org.etsi.osl.tmf.ri639.model.Characteristic();
+		resCharacteristicItem.setName( "_MT_MCJ_REF" );
+		resCharacteristicItem.setValueType( "TEXT" );
+		Any val = new Any();
+		val.setValue( mcj.getUuid() );
+		val.setAlias( mcj.getUuid() );
+		resCharacteristicItem.setValue( val );
+		resCreate.addResourceCharacteristicItem(  resCharacteristicItem );
 
 
+		// 1) need to copy the characteristics of the Resource Specification (use this instead of @param rSpecRef) and populate them with value from the aService (see GCOrchestrationService)
+		// 2) also need to populate the characteristic _MT_MCJ_REF with the UUID of the created MCJ / pass it as @param mcj
 
+		return serviceOrderManager.createResource( resCreate, sOrder, rSpecRef.getId() );
 	}
 
 }
-- 
GitLab


From be41d677fb84701222d071bdb35eb933eae22a7a Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 10 Jan 2025 13:23:52 +0200
Subject: [PATCH 23/31] remove PM_MEASUREMENT_COLLECTION_JOB_CREATED event

---
 .../management/MetricoOrchestrationService.java     | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index 8b40bfc..c2d7297 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -47,9 +47,6 @@ public class MetricoOrchestrationService implements JavaDelegate {
 	@Value("{PM_MEASUREMENT_COLLECTION_JOB_ADD}")
 	private String PM_MEASUREMENT_COLLECTION_JOB_ADD = "";
 
-	@Value("{PM_MEASUREMENT_COLLECTION_JOB_CREATED}")
-	private String PM_MEASUREMENT_COLLECTION_JOB_CREATED = "";
-
 	@Value("${spring.application.name}")
 	private String compname;
 	
@@ -164,8 +161,6 @@ public class MetricoOrchestrationService implements JavaDelegate {
 				su.addNoteItem(successNoteItem);
 				Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
 
-				publishEventMeasurementCollectionJobCreated( mcj.getUuid() );
-
 			} else {
 				logger.error("Measurement Collection Job was not created.");
 			}
@@ -245,14 +240,6 @@ public class MetricoOrchestrationService implements JavaDelegate {
 		return null;
 	}
 
-	public void publishEventMeasurementCollectionJobCreated(String uuid) {
-		logger.debug("Publishing event for Measurement Collection Job Created with UUID: " + uuid);
-		try {
-			producerTemplate.sendBody(PM_MEASUREMENT_COLLECTION_JOB_CREATED, uuid);
-		} catch (Exception e) {
-			logger.error("Failed to publish event for Measurement Collection Job Created. " + e.toString());
-		}
-	}
 
 	/**
 	 *
-- 
GitLab


From 99437cf9cb6177455b7cc2dd63e9ea0e78bfb77f Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Fri, 10 Jan 2025 13:25:29 +0200
Subject: [PATCH 24/31] remove event

---
 src/main/resources/application.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index af1510b..55f42c5 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -127,5 +127,4 @@ CRD_DELETE_CR_REQ: "jms:queue:CRD.DELETE.CR_REQ"
 CRD_PATCH_CR_REQ: "jms:queue:CRD.PATCH.CR_REQ"
 
 #TMF628 ACTIONS
-PM_MEASUREMENT_COLLECTION_JOB_ADD:         "jms:queue:PM.MEASUREMENTCOLLECTIONJOB.ADD"
-EVENT_MEASUREMENT_COLLECTION_JOB_CREATED:  "jms:topic:EVENT.MEASUREMENTCOLLECTIONJOB.CREATED"
\ No newline at end of file
+PM_MEASUREMENT_COLLECTION_JOB_ADD:         "jms:queue:PM.MEASUREMENTCOLLECTIONJOB.ADD"
\ No newline at end of file
-- 
GitLab


From b248db9f426d428c34a7164ae32a5848ab30e288 Mon Sep 17 00:00:00 2001
From: trantzas <ktrantzas@ece.upatras.gr>
Date: Fri, 10 Jan 2025 16:10:46 +0000
Subject: [PATCH 25/31] Metrico Deployment Request process need to inherit
 variables

---
 src/main/resources/processes/ServiceCreationProcess.bpmn | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/resources/processes/ServiceCreationProcess.bpmn b/src/main/resources/processes/ServiceCreationProcess.bpmn
index 2d53ce4..c2b30e7 100644
--- a/src/main/resources/processes/ServiceCreationProcess.bpmn
+++ b/src/main/resources/processes/ServiceCreationProcess.bpmn
@@ -85,7 +85,7 @@
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${brokeActivity=='GRSPEC'}]]></conditionExpression>
     </sequenceFlow>
     <sequenceFlow id="flow46" sourceRef="activityGenericResourceDeploymentReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
-    <callActivity id="parallelMetricoReq" name="Metrico Request" activiti:async="true" calledElement="procMetricoDeploymentRequest" activiti:inheritVariables="false"></callActivity>
+    <callActivity id="parallelMetricoReq" name="Metrico Request" activiti:async="true" calledElement="procMetricoDeploymentRequest" activiti:inheritVariables="true"></callActivity>
     <sequenceFlow id="flow47" sourceRef="parallelMetricoReq" targetRef="servicetaskCheckForCreatedServices"></sequenceFlow>
     <sequenceFlow id="flow48" name="brokeActivity==&quot;RFS_MTSPEC&quot;" sourceRef="exclusivegateway2" targetRef="parallelMetricoReq">
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${brokeActivity=='RFS_MTSPEC'}]]></conditionExpression>
-- 
GitLab


From 9a9bf05978a4dab761e54302d2b44ed554d03822 Mon Sep 17 00:00:00 2001
From: Kostis Trantzas <ktrantzas@ece.upatras.gr>
Date: Fri, 10 Jan 2025 18:43:59 +0200
Subject: [PATCH 26/31] fix for #29:

- Fixed the setting of ScheduleDefinitionEndTime from reading the startTimeString
---
 .../etsi/osl/osom/management/MetricoOrchestrationService.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index c2d7297..2c6cd2e 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -94,9 +94,9 @@ public class MetricoOrchestrationService implements JavaDelegate {
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_START_TIME");
 			String startTimeString = String.valueOf(serviceCharacteristic.getValue());
-			if (endTimeString != null) {
+			if (startTimeString != null) {
 				OffsetDateTime startTime = convertStringToOffsetDateTime(startTimeString, DateTimeFormat.ISO.DATE_TIME );
-				scheduleDefinition.setScheduleDefinitionEndTime(startTime);
+				scheduleDefinition.setScheduleDefinitionStartTime(startTime);
 			} else{
 				OffsetDateTime startTime = OffsetDateTime.now();
 				scheduleDefinition.setScheduleDefinitionStartTime(startTime);
-- 
GitLab


From 9077c21828669a0013ff00f25803182f5c9cf490 Mon Sep 17 00:00:00 2001
From: Kostis Trantzas <ktrantzas@ece.upatras.gr>
Date: Fri, 10 Jan 2025 19:04:22 +0200
Subject: [PATCH 27/31] fix for #29:

- In the creation of MCJ, changed dataAccessEndpoint.setType(monitoringType) to dataAccessEndpoint.setApiType(monitoringType) to match what the mapper expects at METRICO
---
 .../etsi/osl/osom/management/MetricoOrchestrationService.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index 2c6cd2e..32661e7 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -124,7 +124,7 @@ public class MetricoOrchestrationService implements JavaDelegate {
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_TYPE");
 			String monitoringType = String.valueOf(serviceCharacteristic.getValue());
 			DataAccessEndpointFVO dataAccessEndpoint = new DataAccessEndpointFVO();
-			dataAccessEndpoint.setType(monitoringType);
+			dataAccessEndpoint.setApiType(monitoringType);
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_QUERY");
 			String monitoringQuery = String.valueOf(serviceCharacteristic.getValue());
-- 
GitLab


From 3e2d403a6a504905916ff36147486e30b9281230 Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Sat, 11 Jan 2025 18:51:35 +0200
Subject: [PATCH 28/31] fixes for metrico events

---
 .../MetricoOrchestrationService.java          | 58 +++++++------------
 .../osom/management/ServiceOrderManager.java  | 29 +++++++++-
 2 files changed, 49 insertions(+), 38 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index 32661e7..ca3fcbf 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -40,13 +40,10 @@ import java.util.List;
 @Component(value = "metricoOrchestrationService") //bean name
 public class MetricoOrchestrationService implements JavaDelegate {
 
-	private static final transient Log logger = LogFactory.getLog(NFVOrchestrationService.class.getName());
-
-	@Autowired
-	private ProducerTemplate producerTemplate;
-	@Value("{PM_MEASUREMENT_COLLECTION_JOB_ADD}")
-	private String PM_MEASUREMENT_COLLECTION_JOB_ADD = "";
+	private static final transient Log logger = LogFactory.getLog(MetricoOrchestrationService.class.getName());
 
+	
+	
 	@Value("${spring.application.name}")
 	private String compname;
 	
@@ -71,20 +68,23 @@ public class MetricoOrchestrationService implements JavaDelegate {
 
 			Characteristic serviceCharacteristic;
 			MeasurementCollectionJobFVO mcjFVO = new MeasurementCollectionJobFVO();
+            mcjFVO.setCreationTime( OffsetDateTime.now());
+            mcjFVO.setLastModifiedTime( OffsetDateTime.now());
+
 			mcjFVO.setProducingApplicationId(aService.getId());
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_CHARACTERISTIC_NAME");
-			String characteristicName = String.valueOf(serviceCharacteristic.getValue());
+			String characteristicName = String.valueOf(serviceCharacteristic.getValue().getValue());
 			mcjFVO.setOutputFormat(characteristicName);
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_SERVICEUUID");
-			String cfs_id = String.valueOf(serviceCharacteristic.getValue());
+			String cfs_id = String.valueOf(serviceCharacteristic.getValue().getValue());
 			mcjFVO.setConsumingApplicationId(cfs_id);
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_END_TIME");
-			String endTimeString = 	String.valueOf(serviceCharacteristic.getValue());
+			String endTimeString = 	String.valueOf(serviceCharacteristic.getValue().getValue());
 			ScheduleDefinitionFVO scheduleDefinition = new ScheduleDefinitionFVO();
-			if (endTimeString != null) {
+			if (endTimeString != null && !endTimeString.equals("")) {
 				OffsetDateTime endTime = convertStringToOffsetDateTime(endTimeString, DateTimeFormat.ISO.DATE_TIME );
 				scheduleDefinition.setScheduleDefinitionEndTime(endTime);
 			} else{
@@ -93,8 +93,8 @@ public class MetricoOrchestrationService implements JavaDelegate {
 			}
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_START_TIME");
-			String startTimeString = String.valueOf(serviceCharacteristic.getValue());
-			if (startTimeString != null) {
+			String startTimeString = String.valueOf(serviceCharacteristic.getValue().getValue());
+			if (startTimeString != null&& !startTimeString.equals("")) {
 				OffsetDateTime startTime = convertStringToOffsetDateTime(startTimeString, DateTimeFormat.ISO.DATE_TIME );
 				scheduleDefinition.setScheduleDefinitionStartTime(startTime);
 			} else{
@@ -106,10 +106,10 @@ public class MetricoOrchestrationService implements JavaDelegate {
 			mcjFVO.setScheduleDefinition(scheduleDefinitions);
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_RECURRING_INTERVAL");
-			String recurringIntervalString = String.valueOf(serviceCharacteristic.getValue());
+			String recurringIntervalString = String.valueOf(serviceCharacteristic.getValue().getValue());
 			if (recurringIntervalString != null) {
 				if (Granularity.contains(recurringIntervalString)){
-					Granularity recurringInterval = Granularity.valueOf(recurringIntervalString);
+					Granularity recurringInterval = Granularity.valueOf(recurringIntervalString.toUpperCase());
 					mcjFVO.setGranularity(recurringInterval);
 				} else {
 					logger.error("Invalid _MT_RECURRING_INTERVAL value. Valid values are:" + Granularity.getPossibleValues() + " It will be set to 1 minute.");
@@ -122,14 +122,14 @@ public class MetricoOrchestrationService implements JavaDelegate {
 			}
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_TYPE");
-			String monitoringType = String.valueOf(serviceCharacteristic.getValue());
+			String monitoringType = String.valueOf(serviceCharacteristic.getValue().getValue());
 			DataAccessEndpointFVO dataAccessEndpoint = new DataAccessEndpointFVO();
 			dataAccessEndpoint.setApiType(monitoringType);
 
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_QUERY");
-			String monitoringQuery = String.valueOf(serviceCharacteristic.getValue());
+			String monitoringQuery = String.valueOf(serviceCharacteristic.getValue().getValue());
 			serviceCharacteristic = aService.getServiceCharacteristicByName("_MT_URL");
-			String monitoringURL = String.valueOf(serviceCharacteristic.getValue());
+			String monitoringURL = String.valueOf(serviceCharacteristic.getValue().getValue());
             try {
                 URI monitoringURI = createUri(monitoringURL, monitoringQuery);
 				dataAccessEndpoint.setUri(monitoringURI);
@@ -141,7 +141,7 @@ public class MetricoOrchestrationService implements JavaDelegate {
 			dataAccessEndpoints.add(dataAccessEndpoint);
 			mcjFVO.setDataAccessEndpoint(dataAccessEndpoints);
 
-			MeasurementCollectionJob mcj = addMeasurementCollectionJob(mcjFVO);
+			MeasurementCollectionJob mcj = serviceOrderManager.addMeasurementCollectionJob(mcjFVO);
 
 			if  (mcj != null){
 
@@ -159,12 +159,14 @@ public class MetricoOrchestrationService implements JavaDelegate {
 				successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
 				successNoteItem.setAuthor(compname);
 				su.addNoteItem(successNoteItem);
-				Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
 
 			} else {
 				logger.error("Measurement Collection Job was not created.");
+                su.setState(ServiceStateType.TERMINATED);
 			}
 
+            Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
+
 
 
 		}
@@ -221,24 +223,6 @@ public class MetricoOrchestrationService implements JavaDelegate {
 		}
 	}
 
-	public MeasurementCollectionJob addMeasurementCollectionJob(MeasurementCollectionJobFVO mcjFVO) {
-
-		logger.debug("Will create a new Measurement Collection Job");
-		try {
-			Object response = producerTemplate.
-					requestBody( PM_MEASUREMENT_COLLECTION_JOB_ADD, mcjFVO);
-			if ( !(response instanceof String)) {
-				logger.error("Measurement Collection Job object is wrong.");
-				return null;
-			}
-			logger.debug("retrieveMeasurementCollectionJobById response is: " + response);
-			MeasurementCollectionJob mcj = toJsonObj( (String)response, MeasurementCollectionJob.class);
-			return mcj;
-		}catch (Exception e) {
-			logger.error("Cannot create a new Measurement Collection Job. " + e.toString());
-		}
-		return null;
-	}
 
 
 	/**
diff --git a/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java b/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
index 4d79409..54bc509 100644
--- a/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
+++ b/src/main/java/org/etsi/osl/osom/management/ServiceOrderManager.java
@@ -35,6 +35,8 @@ import org.etsi.osl.model.nfv.DeploymentDescriptor;
 import org.etsi.osl.model.nfv.NetworkServiceDescriptor;
 import org.etsi.osl.model.nfv.ScaleDescriptor;
 import org.etsi.osl.osom.serviceactions.NSActionRequestPayload;
+import org.etsi.osl.tmf.pm628.model.MeasurementCollectionJob;
+import org.etsi.osl.tmf.pm628.model.MeasurementCollectionJobFVO;
 import org.etsi.osl.tmf.pm632.model.Organization;
 import org.etsi.osl.tmf.rcm634.model.LogicalResourceSpecification;
 import org.etsi.osl.tmf.rcm634.model.ResourceSpecification;
@@ -194,7 +196,11 @@ public class ServiceOrderManager {
 
     @Value("${CATALOG_GET_RESOURCESPEC_BY_ID}")
     private String CATALOG_GET_RESOURCESPEC_BY_ID = "";
-	
+
+    @Value("${PM_MEASUREMENT_COLLECTION_JOB_ADD}")
+    private String PM_MEASUREMENT_COLLECTION_JOB_ADD = "";
+
+    
 	@Transactional
 	public void processOrder(ServiceOrder serviceOrder) {
 
@@ -1141,6 +1147,27 @@ public class ServiceOrderManager {
       return null;
   }
   
+  
+  public MeasurementCollectionJob addMeasurementCollectionJob(MeasurementCollectionJobFVO mcjFVO) {
+
+    logger.debug("Will create a new Measurement Collection Job");
+    try {
+        Object response = template.
+                requestBody( PM_MEASUREMENT_COLLECTION_JOB_ADD, toJsonString(mcjFVO));
+        if ( !(response instanceof String)) {
+            logger.error("Measurement Collection Job object is wrong.");
+            return null;
+        }
+        logger.debug("retrieveMeasurementCollectionJobById response is: " + response);
+        MeasurementCollectionJob mcj = toJsonObj( (String)response, MeasurementCollectionJob.class);
+        return mcj;
+    }catch (Exception e) {
+        logger.error("Cannot create a new Measurement Collection Job. " + e.toString());
+    }
+    return null;
+}
+
+  
 
 
 
-- 
GitLab


From 6e99fe6aeeb84f40aeb46ed210495ac580aa004b Mon Sep 17 00:00:00 2001
From: Kostis Trantzas <ktrantzas@ece.upatras.gr>
Date: Sat, 11 Jan 2025 19:11:47 +0200
Subject: [PATCH 29/31] Changing the default values for recurringInterval from
 G_1M (month) to G_1MN (minute) in MetricoOrchestrationService.java

---
 .../etsi/osl/osom/management/MetricoOrchestrationService.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index ca3fcbf..5aeac40 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -113,11 +113,11 @@ public class MetricoOrchestrationService implements JavaDelegate {
 					mcjFVO.setGranularity(recurringInterval);
 				} else {
 					logger.error("Invalid _MT_RECURRING_INTERVAL value. Valid values are:" + Granularity.getPossibleValues() + " It will be set to 1 minute.");
-					Granularity recurringInterval = Granularity.G_1M;
+					Granularity recurringInterval = Granularity.G_1MN;
 					mcjFVO.setGranularity(recurringInterval);
 				}
 			} else {
-				Granularity recurringInterval = Granularity.G_1M;
+				Granularity recurringInterval = Granularity.G_1MN;
 				mcjFVO.setGranularity(recurringInterval);
 			}
 
-- 
GitLab


From 1c81297e419cce6468c957728093aea2662d33fc Mon Sep 17 00:00:00 2001
From: Christos Tranoris <tranoris@ece.upatras.gr>
Date: Sun, 12 Jan 2025 09:49:52 +0200
Subject: [PATCH 30/31] fix for creation order

---
 .../MetricoOrchestrationService.java          | 67 +++++++++++--------
 1 file changed, 39 insertions(+), 28 deletions(-)

diff --git a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
index ca3fcbf..bc3a075 100644
--- a/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
+++ b/src/main/java/org/etsi/osl/osom/management/MetricoOrchestrationService.java
@@ -141,32 +141,43 @@ public class MetricoOrchestrationService implements JavaDelegate {
 			dataAccessEndpoints.add(dataAccessEndpoint);
 			mcjFVO.setDataAccessEndpoint(dataAccessEndpoints);
 
-			MeasurementCollectionJob mcj = serviceOrderManager.addMeasurementCollectionJob(mcjFVO);
-
-			if  (mcj != null){
-
-				ResourceSpecificationRef resourceSpecificationRef = spec.getResourceSpecification().stream().findFirst().get();
-				Resource resourceMT = createRelatedResource( resourceSpecificationRef, sorder, aService, mcj );
-				ResourceRef resourceRef = new ResourceRef();
-
-				resourceRef.setId( resourceMT.getId() );
-				resourceRef.setName( resourceMT.getName());
-				resourceRef.setType( resourceMT.getType());
-				su.addSupportingResourceItem( resourceRef );
-				su.setState(ServiceStateType.RESERVED);
-				Note successNoteItem = new Note();
-				successNoteItem.setText(String.format("Requesting METRICO to create a new monitoring job"));
-				successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
-				successNoteItem.setAuthor(compname);
-				su.addNoteItem(successNoteItem);
-
-			} else {
-				logger.error("Measurement Collection Job was not created.");
-                su.setState(ServiceStateType.TERMINATED);
-			}
-
-            Service supd = serviceOrderManager.updateService(aService.getId(), su, false);
+			ResourceSpecificationRef resourceSpecificationRef = spec.getResourceSpecification().stream().findFirst().get();
+			Resource resourceMT = createRelatedResource( resourceSpecificationRef, sorder, aService );
+			ResourceRef resourceRef = new ResourceRef();
+
+			resourceRef.setId( resourceMT.getId() );
+			resourceRef.setName( resourceMT.getName());
+			resourceRef.setType( resourceMT.getType());
+			su.addSupportingResourceItem( resourceRef );
+			su.setState(ServiceStateType.RESERVED);
+			Note successNoteItem = new Note();
+			successNoteItem.setText(String.format("Requesting METRICO to create a new monitoring job"));
+			successNoteItem.setDate(OffsetDateTime.now(ZoneOffset.UTC).toString());
+			successNoteItem.setAuthor(compname);
+			su.addNoteItem(successNoteItem);
+			
+            Service supd = serviceOrderManager.updateService(aService.getId(), su, false);//we nned first to create this in the db
+
+            su = new ServiceUpdate();// the object to update the service
+            MeasurementCollectionJob mcj = serviceOrderManager.addMeasurementCollectionJob(mcjFVO);
+            if  (mcj != null){
+              logger.info("Measurement Collection Job was not created.");
+
+              serviceCharacteristic = new Characteristic();              
+              serviceCharacteristic.setName( "_MT_MCJ_REFID" );
+              serviceCharacteristic.setValueType( "TEXT" );
+              Any val = new Any();
+              val.setValue( mcj.getUuid() );
+              val.setAlias( "" );              
+              serviceCharacteristic.setValue(val);
+              su.addServiceCharacteristicItem(serviceCharacteristic);
+              
+            } else {
+              logger.error("Measurement Collection Job was not created.");
+              su.setState(ServiceStateType.TERMINATED);
+            }
 
+            supd = serviceOrderManager.updateService(aService.getId(), su, false);//we nned first to create this in the db
 
 
 		}
@@ -233,7 +244,7 @@ public class MetricoOrchestrationService implements JavaDelegate {
 	 * @param aService
 	 * @return
 	 */
-	private Resource createRelatedResource(ResourceSpecificationRef rSpecRef, ServiceOrder sOrder, Service aService, MeasurementCollectionJob mcj) {
+	private Resource createRelatedResource(ResourceSpecificationRef rSpecRef, ServiceOrder sOrder, Service aService) {
 
 		ResourceCreate resCreate = new ResourceCreate();
 		resCreate.setName(   rSpecRef.getName() + "-" + aService.getId() );
@@ -251,8 +262,8 @@ public class MetricoOrchestrationService implements JavaDelegate {
 		resCharacteristicItem.setName( "_MT_MCJ_REF" );
 		resCharacteristicItem.setValueType( "TEXT" );
 		Any val = new Any();
-		val.setValue( mcj.getUuid() );
-		val.setAlias( mcj.getUuid() );
+		val.setValue( "PENDING" );
+		val.setAlias( "PENDING" );
 		resCharacteristicItem.setValue( val );
 		resCreate.addResourceCharacteristicItem(  resCharacteristicItem );
 
-- 
GitLab


From dacd070f6117705188971a9fdfa87fb953f2dc66 Mon Sep 17 00:00:00 2001
From: trantzas <ktrantzas@ece.upatras.gr>
Date: Tue, 14 Jan 2025 13:36:31 +0000
Subject: [PATCH 31/31] Preparing the 2024Q4_RC:

- Remove -SNAPSHOT from parent's version at pom.xml
- Remove -SNAPSHOT from Dockerfile's jar references
---
 Dockerfile | 6 +++---
 pom.xml    | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index c861b12..4709a01 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,7 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk
 MAINTAINER openslice.io
 RUN mkdir /opt/shareclasses
 RUN mkdir -p /opt/openslice/lib/
-COPY target/org.etsi.osl.osom-1.0.1-SNAPSHOT.jar /opt/openslice/lib/
-COPY target/org.etsi.osl.osom-1.0.1-SNAPSHOT-exec.jar /opt/openslice/lib/
+COPY target/org.etsi.osl.osom-1.1.0.jar /opt/openslice/lib/
+COPY target/org.etsi.osl.osom-1.1.0-exec.jar /opt/openslice/lib/
 COPY . /opt/openslice/lib/
-CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses","-jar", "/opt/openslice/lib/org.etsi.osl.osom-1.0.1-SNAPSHOT-exec.jar"]
\ No newline at end of file
+CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses","-jar", "/opt/openslice/lib/org.etsi.osl.osom-1.1.0-exec.jar"]
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 949684c..ead5841 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.etsi.osl</groupId>
 		<artifactId>org.etsi.osl.main</artifactId>
-		<version>2024Q4-SNAPSHOT</version>
+		<version>2024Q4</version>
 		<relativePath>../org.etsi.osl.main</relativePath>
 	</parent>
 
-- 
GitLab