Exemple #1
0
        protected override void Execute(CodeActivityContext context)
        {
            string systemname = SystemName.Get(context);
            string path       = Path.Get(context);
            string actionname = ActionName.Get(context);
            var    parameters = Parameters.Get(context);

            // object[] parameters = Parameters.Get(context);
            //var _params = new List<object>();
            //Dictionary<string, object> arguments = (from argument in Arguments
            //                                        where argument.Value.Direction != ArgumentDirection.Out
            //                                        select argument).ToDictionary((KeyValuePair<string, Argument> argument) => argument.Key, (KeyValuePair<string, Argument> argument) => argument.Value.Get(context));
            //foreach (var a in arguments)
            //{
            //    _params.Add(a.Value);
            //}
            // var data = new SAPInvokeMethod(systemname, path, actionname, _params.ToArray());
            object[] _parameters = null;
            if (!string.IsNullOrEmpty(parameters))
            {
                _parameters = JsonConvert.DeserializeObject <object[]>(parameters);
            }
            var data    = new SAPInvokeMethod(systemname, path, actionname, _parameters);
            var message = new SAPEvent("invokemethod");

            message.Set(data);
            var result = SAPhook.Instance.SendMessage(message, TimeSpan.FromMinutes(10));
        }
Exemple #2
0
        protected override void Execute(CodeActivityContext context)
        {
            string systemname = SystemName.Get(context);
            string path       = Path.Get(context);
            string actionname = ActionName.Get(context);

            object[] _parameters = null;
            var      data        = new SAPInvokeMethod(systemname, path, actionname, _parameters);
            var      message     = new SAPEvent("getproperty");

            message.Set(data);
            var reply = SAPhook.Instance.SendMessage(message, TimeSpan.FromSeconds(PluginConfig.bridge_timeout_seconds));

            data = reply.Get <SAPInvokeMethod>();
            Result.Set(context, data.Result);
        }
Exemple #3
0
        public object InvokeMethod(string SystemName, string Id, string ActionName, object[] Parameters, TimeSpan Timeout)
        {
            if (Parameters == null)
            {
                Parameters = new object[] { }
            }
            ;
            var data    = new SAPInvokeMethod(SystemName, Id, ActionName, Parameters);
            var message = new SAPEvent("invokemethod");

            message.Set(data);
            var reply = SAPhook.Instance.SendMessage(message, Timeout);

            data = reply.Get <SAPInvokeMethod>();
            return(data.Result);
        }
    }