Ejemplo n.º 1
0
        public override void RunCommand(object sender)
        {
            var engine      = (IAutomationEngineInstance)sender;
            var vAssetName  = v_AssetName.ConvertUserVariableToString(engine);
            var vAppendText = v_AppendText.ConvertUserVariableToString(engine);

            var client = AuthMethods.GetAuthToken();
            var asset  = AssetMethods.GetAsset(client, vAssetName, "Text");

            if (asset == null)
            {
                throw new DataException($"No Asset was found for '{vAssetName}' with type 'Text'");
            }

            AssetMethods.AppendAsset(client, asset.Id, vAppendText);
        }
Ejemplo n.º 2
0
        public async override Task RunCommand(object sender)
        {
            var engine     = (IAutomationEngineInstance)sender;
            var vAssetName = (string)await v_AssetName.EvaluateCode(engine);

            var vAppendText = (string)await v_AppendText.EvaluateCode(engine);

            var userInfo = ServerSessionVariableMethods.GetUserInfo(engine);
            var asset    = AssetMethods.GetAsset(userInfo, vAssetName, "Text");

            if (asset == null)
            {
                throw new DataException($"No Asset was found for '{vAssetName}' with type 'Text'");
            }

            AssetMethods.AppendAsset(userInfo, asset.Id, vAppendText);
        }