public static void invokeDeploySystem(SAFeSWL_Architecture arch_desc,
                                              string arch_ref,
                                              object platform_address,
                                              ComponentType c_appplication_abstract,
                                              ComponentType c_application_concrete,
                                              ComponentType c_workflow_abstract,
                                              ComponentType c_workflow_concrete,
                                              ComponentType c_system_abstract,
                                              ComponentType c_system_concrete)
        {
            try
            {
                IPlatformServices platform_access = null;
                if (platform_address is string)
                {
                    // Deploy the components of the system.
                    ServiceUtils.PlatformServices.PlatformServices platform_access_ = new ServiceUtils.PlatformServices.PlatformServices((string)platform_address);
                    platform_access_.Timeout = int.MaxValue;
                    platform_access          = (IPlatformServices)platform_access_;
                }
                else if (platform_address is IPlatformServices)
                {
                    platform_access = (IPlatformServices)platform_address;
                }

                string application_abstract = LoaderApp.serialize <ComponentType>(c_appplication_abstract);
                string application_concrete = LoaderApp.serialize <ComponentType>(c_application_concrete);
                string workflow_abstract    = LoaderApp.serialize <ComponentType>(c_workflow_abstract);
                string workflow_concrete    = LoaderApp.serialize <ComponentType>(c_workflow_concrete);
                string system_abstract      = LoaderApp.serialize <ComponentType>(c_system_abstract);
                string system_concrete      = LoaderApp.serialize <ComponentType>(c_system_concrete);

                Console.Error.WriteLine(platform_access.deploy(application_abstract));
                Console.Error.WriteLine(platform_access.deploy(workflow_abstract));
                Console.Error.WriteLine(platform_access.deploy(system_abstract));

                Console.Error.WriteLine(platform_access.deploy(application_concrete));
                Console.Error.WriteLine(platform_access.deploy(workflow_concrete));
                Console.Error.WriteLine(platform_access.deploy(system_concrete));
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
                Console.Error.WriteLine(e.StackTrace);
                if (e.InnerException != null)
                {
                    Console.Error.WriteLine(e.InnerException.Message);
                    Console.Error.WriteLine(e.InnerException.StackTrace);
                }
            }

            //return 0;
        }
        public static void invokeDeployComponent(object platform_address, string component)
        {
            IPlatformServices platform_access = null;

            if (platform_address is string)
            {
                // Deploy the components of the system.
                ServiceUtils.PlatformServices.PlatformServices platform_access_ = new ServiceUtils.PlatformServices.PlatformServices((string)platform_address);
                platform_access_.Timeout = int.MaxValue;
                platform_access          = (IPlatformServices)platform_access_;
            }
            else if (platform_address is IPlatformServices)
            {
                platform_access = (IPlatformServices)platform_address;
            }

            platform_access.deploy(component);
        }
        public static void invokeDeployContracts(SAFeSWL_Architecture arch_desc,
                                                 string arch_ref,
                                                 IDictionary <string, Instantiator.ComponentFunctorApplicationType> contracts,
                                                 object platform_address)
        {
            br.ufc.pargo.hpe.backend.DGAC.database.Connector.openConnection();

            IPlatformServices platform_access = null;

            if (platform_address is string)
            {
                // Deploy the components of the system.
                ServiceUtils.PlatformServices.PlatformServices platform_access_ = new ServiceUtils.PlatformServices.PlatformServices((string)platform_address);
                platform_access_.Timeout = int.MaxValue;
                platform_access          = (IPlatformServices)platform_access_;
            }
            else if (platform_address is IPlatformServices)
            {
                platform_access = (IPlatformServices)platform_address;
            }

            IDictionary <string, int[]> cs = LoaderSystem.componentsInPlatform(arch_desc, arch_ref);

            foreach (string c in cs.Keys)
            {
                if (contracts.ContainsKey(c))
                {
                    AbstractComponentFunctorApplication acfaRef = BackEnd.loadACFAFromInstantiator(contracts[c]);

                    string[] config_dependencies = calculateDependenciesOf(acfaRef.Id_functor_app);

                    foreach (string cRef in config_dependencies)
                    {
                        string config_filename = Constants.PATH_TEMP_WORKER + cRef + ".hpe";
                        string config_contents = File.ReadAllText(config_filename);

                        platform_access.deploy(config_contents);
                    }
                }
            }
            br.ufc.pargo.hpe.backend.DGAC.database.Connector.closeConnection();
        }