@@ -38,9 +38,9 @@ public ActionType Type
38
38
get
39
39
{
40
40
if ( this . Function != null )
41
- return ActionType . FunctionCall ;
41
+ return ActionType . Function ;
42
42
else
43
- return ActionType . EventTrigger ;
43
+ return ActionType . Trigger ;
44
44
}
45
45
}
46
46
@@ -75,31 +75,11 @@ public FunctionReference Function
75
75
}
76
76
set
77
77
{
78
- if ( value != null )
79
- {
80
- this . _Function = value ;
81
- this . FunctionToken = JToken . FromObject ( value ) ;
82
- }
83
- }
84
- }
85
-
86
- /// <summary>
87
- /// Gets the reference of the function to invoke
88
- /// </summary>
89
- [ Newtonsoft . Json . JsonIgnore ]
90
- [ System . Text . Json . Serialization . JsonIgnore ]
91
- [ YamlIgnore ]
92
- public string FunctionReference
93
- {
94
- get
95
- {
96
- if ( this . Function != null )
97
- return this . Function . Name ;
98
- else if ( this . FunctionReference != null
99
- && this . FunctionToken . Type == JTokenType . String )
100
- return this . FunctionToken . ToObject < string > ( ) ;
78
+ this . _Function = value ;
79
+ if ( this . _Function == null )
80
+ this . FunctionToken = null ;
101
81
else
102
- return null ;
82
+ this . FunctionToken = JToken . FromObject ( this . _Function ) ;
103
83
}
104
84
}
105
85
@@ -129,11 +109,50 @@ public EventReference Event
129
109
}
130
110
set
131
111
{
132
- if ( value != null )
112
+ this . _Event = value ;
113
+ if ( this . _Event == null )
114
+ this . EventToken = null ;
115
+ else
116
+ this . EventToken = JToken . FromObject ( this . _Event ) ;
117
+ }
118
+ }
119
+
120
+ /// <summary>
121
+ /// Gets/sets a <see cref="JToken"/> that references a subflow to run
122
+ /// </summary>
123
+ [ Newtonsoft . Json . JsonProperty ( PropertyName = "subflowRef" ) ]
124
+ [ System . Text . Json . Serialization . JsonPropertyName ( "subflowRef" ) ]
125
+ [ YamlMember ( Alias = "subflowRef" ) ]
126
+ protected virtual JToken SubflowToken { get ; set ; }
127
+
128
+ private SubflowReference _Subflow ;
129
+ /// <summary>
130
+ /// Gets the object used to configure the reference of the subflow to run
131
+ /// </summary>
132
+ [ Newtonsoft . Json . JsonIgnore ]
133
+ [ System . Text . Json . Serialization . JsonIgnore ]
134
+ [ YamlIgnore ]
135
+ public SubflowReference Subflow
136
+ {
137
+ get
138
+ {
139
+ if ( this . _Subflow == null
140
+ && this . SubflowToken != null )
133
141
{
134
- this . _Event = value ;
135
- this . EventToken = JToken . FromObject ( value ) ;
142
+ if ( this . SubflowToken ? . Type == JTokenType . Object )
143
+ this . _Subflow = this . SubflowToken . ToObject < SubflowReference > ( ) ;
144
+ else if ( this . SubflowToken ? . Type == JTokenType . String )
145
+ this . _Subflow = SubflowReference . Parse ( this . SubflowToken . ToObject < string > ( ) ) ;
136
146
}
147
+ return this . _Subflow ;
148
+ }
149
+ set
150
+ {
151
+ this . _Subflow = value ;
152
+ if ( this . _Subflow == null )
153
+ this . SubflowToken = null ;
154
+ else
155
+ this . SubflowToken = JToken . FromObject ( this . _Subflow ) ;
137
156
}
138
157
}
139
158
0 commit comments