Commit be6efda9 authored by George Tziavas's avatar George Tziavas
Browse files

added one more action to service creation process

parent 03269732
Loading
Loading
Loading
Loading
+0 −947

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −6
Original line number Diff line number Diff line
<?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>
+1 −1
Original line number Diff line number Diff line
@@ -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" );                      
+50 −0
Original line number Diff line number Diff line
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;


    }
}
+30 −31
Original line number Diff line number Diff line
@@ -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());

	private static final transient Log logger = LogFactory.getLog(NFVOrchestrationService.class.getName());


	@Value("${spring.application.name}")
	private String compname;
	
	
	@Autowired
	private ServiceOrderManager serviceOrderManager;
	

    @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() );
		
        logger.info( "MetricoOrchestrationService" );
        logger.info( execution.getVariableNames().toString() );

        if ( execution.getVariable("contextServiceId") == null) {
		//we need to retrieve here the Service Spec of this service that we send to the NFVO
		
            logger.error( "Variable contextServiceId is NULL!" );
            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
            return;
        }
        Service aService = serviceOrderManager.retrieveService( (String) execution.getVariable("contextServiceId") );
		ServiceSpecification spec = serviceOrderManager.retrieveServiceSpec( aService.getServiceSpecificationRef().getId() );
		
        if ( aService == null ) {
            logger.info( "aService is null for contextServiceId = " +(String) execution.getVariable("contextServiceId") );
            execution.setVariable("serviceDeploymentFinished", Boolean.TRUE );
            return;
        }
		if ( spec!=null ) {			

        execution.setVariable("serviceDeploymentFinished", Boolean.FALSE );
			ServiceSpecCharacteristic c = spec.getServiceSpecCharacteristicByName( "NSDID" );						

        ServiceUpdate supd = new ServiceUpdate();
        boolean propagateToSO = false;
		
		
    }

}
Loading