Пример #1
0
        /// <summary>
        /// Executes a service with the arguments indicated as two collections (types and values).
        /// </summary>
        /// <param name="agent">Agent who execute the service.</param>
        /// <param name="className">Class involved in the service.</param>
        /// <param name="serviceName">Service executed.</param>
        /// <param name="argumentTypes">Arguments types.</param>
        /// <param name="argumentsValues">Arguments values.</param>
        /// <returns>Arguments as a collection.</returns>
        public Dictionary <string, object> ExecuteService(
            Oid agent,
            string className,
            string serviceName,
            Dictionary <string, ModelType> argumentTypes,
            Dictionary <string, object> argumentsValues,
            Dictionary <string, string> argumentDomains,
            Dictionary <string, ModelType> changedItemsTypes,
            Dictionary <string, object> changedItemsValues,
            Dictionary <string, string> changedItemsDomains
            )
        {
            Dictionary <string, object> lResult = null;
            Arguments arguments = new Arguments(argumentTypes, argumentsValues, argumentDomains);

            ChangeDetectionItems changedItems = null;

            if ((changedItemsTypes != null) && (changedItemsValues != null) && (changedItemsDomains != null))
            {
                changedItems = new ChangeDetectionItems(changedItemsTypes, changedItemsValues, changedItemsDomains);
            }

            Arguments lOutPutArguments = ExecuteService(agent, className, serviceName, arguments, changedItems);

            if (lOutPutArguments != null)
            {
                lResult = lOutPutArguments.GetValues();
            }
            return(lResult);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of ChangeDectectionItems.
 /// </summary>
 /// <param name="ChangeDectectionItems">ChangeDectectionItems to be set.</param>
 public ChangeDetectionItems(ChangeDetectionItems items)
     : base(items)
 {
 }
Пример #3
0
        /// <summary>
        /// Executes a service with the arguments indicated as Arguments.
        /// </summary>
        /// <param name="agent">Agent who execute the service.</param>
        /// <param name="className">Class involved in the service.</param>
        /// <param name="service">Service to execute.</param>
        /// <param name="arguments">Arguments.</param>
        /// <returns>Arguments of the service.</returns>
        private Arguments ExecuteService(Oid agent, string className, string service, Arguments arguments, ChangeDetectionItems changeDetectinItems)
        {
            ServiceRequest lServiceRequest = new ServiceRequest(className, service, arguments);

            lServiceRequest.ChangeDetectionItems = changeDetectinItems;

            Response lResponse = ExecuteService(agent, lServiceRequest);

            if (agent == null)
            {
                agent = lResponse.Service.Oid;
            }
            return(lResponse.Service.Arguments);
        }