예제 #1
0
        public JToken GetEffectiveInput(JToken input, OptionalString inputPath, JObject payload, JObject context)
        {
            if (!inputPath.IsSet)
            {
                inputPath.Value = ROOT_MEMBER_OBJECT;
            }

            return(TransformPayloadTemplate(ExtractTokenFromJsonPath(input, inputPath.Value), payload, context));
        }
예제 #2
0
        public SyncableStringArray(Guid id, string[] items)
        {
            SendingIndexes = false;
            ID             = id;

            Items = new OptionalString[items.Length];
            for (int i = 0; i < items.Length; i++)
            {
                Items[i] = new OptionalString(items[i]);
            }

            Indexes = null;
        }
예제 #3
0
        public JToken GetEffectiveOutput(JToken input, JToken result, OptionalString outputPath, OptionalString resultPath)
        {
            if (!outputPath.IsSet)
            {
                outputPath.Value = ROOT_MEMBER_OBJECT;
            }
            else if (!outputPath.HasValue)
            {
                //If the value of OutputPath is null, that means the input and result are discarded,
                //and the effective output from the state is an empty JSON object, {}
                return(new JObject());
            }

            if (!resultPath.IsSet)
            {
                resultPath.Value = ROOT_MEMBER_OBJECT;
            }
            return(ExtractTokenFromJsonPath(HandleResultPath(input, result, resultPath.Value), outputPath.Value));
        }