createSystem(SAFeSWL_Architecture arch_desc,
                     IDictionary <string, Instantiator.ComponentFunctorApplicationType> contracts,
                     IDictionary <string, Instantiator.UnitMappingType[]> unit_mapping,
                     ref IList <string> platforms)
        {
            string app_name = null;
            string application_component_name = null;
            string workflow_component_name    = null;;
            IList <Tuple <string, string, EnvironmentPortType, string> > bindings_application = null;
            IList <Tuple <string, string, EnvironmentPortType, string> > bindings_workflow    = null;
            IList <Tuple <string, Tuple <string, string, int>[]> >       bindings_system      = null;
            IList <Tuple <string, Tuple <string, string, int>[]> >       bindings_task        = null;

            LoaderSystem.readArchitecture(arch_desc,
                                          ref app_name,
                                          ref application_component_name,
                                          ref workflow_component_name,
                                          ref bindings_application,
                                          ref bindings_workflow,
                                          ref bindings_system,
                                          ref bindings_task,
                                          ref platforms);

            // Take the configuration files of components of the system.
            Tuple <Tuple <ComponentType, ComponentType>,
                   Tuple <ComponentType, ComponentType>,
                   Tuple <ComponentType, ComponentType> > system = null;              //LoaderSystem.createSystemComponent (app_name, application_component_name, workflow_component_name, contracts, unit_mapping, bindings_application, bindings_workflow, bindings_system, bindings_task, platforms);

            return(system);
        }
        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();
        }