diff --git a/dotnet/src/extensions/Azure/Handlers/QueueHandler/QueueTriggerHandler.cs b/dotnet/src/extensions/Azure/Handlers/QueueHandler/QueueTriggerHandler.cs index 01ae92cdc..83a2398e4 100644 --- a/dotnet/src/extensions/Azure/Handlers/QueueHandler/QueueTriggerHandler.cs +++ b/dotnet/src/extensions/Azure/Handlers/QueueHandler/QueueTriggerHandler.cs @@ -130,61 +130,62 @@ private void ProcessMessage(FunctionContext context, ILogger log, QueueMessage q { //Initialization - Type EventMessagesType = parameters[0].ParameterType; //SdtEventMessages - GxUserType EventMessages = (GxUserType)Activator.CreateInstance(EventMessagesType, new object[] { gxcontext }); // instance of SdtEventMessages + Type eventMessagesType = parameters[0].ParameterType; //SdtEventMessages + GxUserType EventMessages = (GxUserType)Activator.CreateInstance(eventMessagesType, new object[] { gxcontext }); // instance of SdtEventMessages - IList EventMessage = (IList)ClassLoader.GetPropValue(EventMessages, "gxTpr_Eventmessage");//instance of GXBaseCollection - Type EventMessageItemType = EventMessage.GetType().GetGenericArguments()[0];//SdtEventMessage + IList eventMessage = (IList)ClassLoader.GetPropValue(EventMessages, "gxTpr_Eventmessage");//instance of GXBaseCollection + Type EventMessageItemType = eventMessage.GetType().GetGenericArguments()[0];//SdtEventMessage - GxUserType EventMessageItem = (GxUserType)Activator.CreateInstance(EventMessageItemType, new object[] { gxcontext }); // instance of SdtEventMessage - IList CustomPayload = (IList)ClassLoader.GetPropValue(EventMessageItem, "gxTpr_Eventmessagecustompayload");//instance of GXBaseCollection + GxUserType eventMessageItem = (GxUserType)Activator.CreateInstance(EventMessageItemType, new object[] { gxcontext }); // instance of SdtEventMessage - Type CustomPayloadItemType = CustomPayload.GetType().GetGenericArguments()[0];//SdtEventCustomPayload_CustomPayloadItem + IList eventMessageProperties = (IList)ClassLoader.GetPropValue(eventMessageItem, "gxTpr_Eventmessageproperties");//instance of GXBaseCollection + Type eventMessPropsItemType = eventMessageProperties.GetType().GetGenericArguments()[0];//SdtEventMessageProperty - //Payload + //Event message properties - GxUserType CustomPayloadItem; + GxUserType eventMessageProperty; foreach (var messageProp in queueMessage.MessageProperties) { - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, messageProp.key, messageProp.value, gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, messageProp.key, messageProp.value, gxcontext); + eventMessageProperties.Add(eventMessageProperty); } //Body - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, "Body", queueMessage.Body, gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, "Body", queueMessage.Body, gxcontext); + eventMessageProperties.Add(eventMessageProperty); //Event - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessageid", queueMessage.Id); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagedata", queueMessage.Body); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageid", queueMessage.Id); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessagedata", queueMessage.Body); QueueMessage.MessageProperty InsertionTimeProp = queueMessage.MessageProperties.Find(x => x.key == "InsertionTime"); if (InsertionTimeProp != null) { DateTime InsertionTime; if (DateTime.TryParse(InsertionTimeProp.value, out InsertionTime)) - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagedate", InsertionTime.ToUniversalTime()); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessagedate", InsertionTime.ToUniversalTime()); } - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagesourcetype", EventSourceType.QueueMessage); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessageversion", string.Empty); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagecustompayload", CustomPayload); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessagesourcetype", EventSourceType.QueueMessage); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageversion", string.Empty); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageproperties", eventMessageProperties); //List of Events - EventMessage.Add(EventMessageItem); + eventMessage.Add(eventMessageItem); parametersdata = new object[] { EventMessages, null }; } try { method.Invoke(objgxproc, parametersdata); GxUserType EventMessageResponse = parametersdata[1] as GxUserType;//SdtEventMessageResponse - bool result = (bool)ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Handled"); + bool result = (bool)ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Handlefailure"); + //Error handling - if (result == false) //Must retry if possible. + if (result == true) //Must retry if possible. { exMessage = string.Format("{0} {1}", FunctionExceptionType.AppError, ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Errormessage")); throw new Exception(exMessage); @@ -219,14 +220,15 @@ private void ProcessMessage(FunctionContext context, ILogger log, QueueMessage q throw new Exception(exMessage); } } - private GxUserType CreateCustomPayloadItem(Type customPayloadItemType, string propertyId, object propertyValue, GxContext gxContext) + + private GxUserType CreateEventMessageProperty(Type eventMessPropsItemType, string propertyId, object propertyValue, GxContext gxContext) { - GxUserType CustomPayloadItem = (GxUserType)Activator.CreateInstance(customPayloadItemType, new object[] { gxContext }); - ClassLoader.SetPropValue(CustomPayloadItem, "gxTpr_Propertyid", propertyId); - ClassLoader.SetPropValue(CustomPayloadItem, "gxTpr_Propertyvalue", propertyValue); - return CustomPayloadItem; - + GxUserType eventMessageProperty = (GxUserType)Activator.CreateInstance(eventMessPropsItemType, new object[] { gxContext }); // instance of SdtEventMessageProperty + ClassLoader.SetPropValue(eventMessageProperty, "gxTpr_Propertyid", propertyId); + ClassLoader.SetPropValue(eventMessageProperty, "gxTpr_Propertyvalue", propertyValue); + return eventMessageProperty; } + [DataContract] internal class QueueMessage { diff --git a/dotnet/src/extensions/Azure/Handlers/ServiceBusHandler/ServiceBusTriggerHandler.cs b/dotnet/src/extensions/Azure/Handlers/ServiceBusHandler/ServiceBusTriggerHandler.cs index 96685ff76..dcaa8c1da 100644 --- a/dotnet/src/extensions/Azure/Handlers/ServiceBusHandler/ServiceBusTriggerHandler.cs +++ b/dotnet/src/extensions/Azure/Handlers/ServiceBusHandler/ServiceBusTriggerHandler.cs @@ -43,13 +43,12 @@ public void Run(string myQueueItem, FunctionContext context) throw; } } - private GxUserType CreateCustomPayloadItem(Type customPayloadItemType, string propertyId, object propertyValue, GxContext gxContext) + private GxUserType CreateEventMessageProperty(Type eventMessPropsItemType, string propertyId, object propertyValue, GxContext gxContext) { - GxUserType CustomPayloadItem = (GxUserType)Activator.CreateInstance(customPayloadItemType, new object[] { gxContext }); - ClassLoader.SetPropValue(CustomPayloadItem, "gxTpr_Propertyid", propertyId); - ClassLoader.SetPropValue(CustomPayloadItem, "gxTpr_Propertyvalue", propertyValue); - return CustomPayloadItem; - + GxUserType eventMessageProperty = (GxUserType)Activator.CreateInstance(eventMessPropsItemType, new object[] { gxContext }); // instance of SdtEventMessageProperty + ClassLoader.SetPropValue(eventMessageProperty, "gxTpr_Propertyid", propertyId); + ClassLoader.SetPropValue(eventMessageProperty, "gxTpr_Propertyvalue", propertyValue); + return eventMessageProperty; } private Message SetupMessage(FunctionContext context, string item) { @@ -155,41 +154,41 @@ private void ProcessMessage(FunctionContext context, ILogger log, Message messag { //Initialization - Type EventMessagesType = parameters[0].ParameterType; //SdtEventMessages - GxUserType EventMessages = (GxUserType)Activator.CreateInstance(EventMessagesType, new object[] { gxcontext }); // instance of SdtEventMessages + Type eventMessagesType = parameters[0].ParameterType; //SdtEventMessages + GxUserType eventMessages = (GxUserType)Activator.CreateInstance(eventMessagesType, new object[] { gxcontext }); // instance of SdtEventMessages - IList EventMessage = (IList)ClassLoader.GetPropValue(EventMessages, "gxTpr_Eventmessage");//instance of GXBaseCollection - Type EventMessageItemType = EventMessage.GetType().GetGenericArguments()[0];//SdtEventMessage + IList eventMessage = (IList)ClassLoader.GetPropValue(eventMessages, "gxTpr_Eventmessage");//instance of GXBaseCollection + Type eventMessageItemType = eventMessage.GetType().GetGenericArguments()[0];//SdtEventMessage - GxUserType EventMessageItem = (GxUserType)Activator.CreateInstance(EventMessageItemType, new object[] { gxcontext }); // instance of SdtEventMessage - IList CustomPayload = (IList)ClassLoader.GetPropValue(EventMessageItem, "gxTpr_Eventmessagecustompayload");//instance of GXBaseCollection + GxUserType eventMessageItem = (GxUserType)Activator.CreateInstance(eventMessageItemType, new object[] { gxcontext }); // instance of SdtEventMessage - Type CustomPayloadItemType = CustomPayload.GetType().GetGenericArguments()[0];//SdtEventCustomPayload_CustomPayloadItem + IList eventMessageProperties = (IList)ClassLoader.GetPropValue(eventMessageItem, "gxTpr_Eventmessageproperties");//instance of GXBaseCollection + Type eventMessPropsItemType = eventMessageProperties.GetType().GetGenericArguments()[0];//SdtEventMessageProperty //Payload - GxUserType CustomPayloadItem; + GxUserType eventMessageProperty; foreach (var messageProp in message.MessageProperties) { if ((messageProp.key != "UserProperties") & (messageProp.key != "SystemProperties")) { - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, messageProp.key, Convert.ToString(messageProp.value), gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, messageProp.key, Convert.ToString(messageProp.value), gxcontext); + eventMessageProperties.Add(eventMessageProperty); } } //Body - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, "Body", message.Body, gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, "Body", message.Body, gxcontext); + eventMessageProperties.Add(eventMessageProperty); //user Properties if (message.UserProperties.Count > 0) { foreach (string key in message.UserProperties.Keys) { - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, key, JSONHelper.Serialize(message.UserProperties[key]), gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, key, JSONHelper.Serialize(message.UserProperties[key]), gxcontext); + eventMessageProperties.Add(eventMessageProperty); } } @@ -202,28 +201,28 @@ private void ProcessMessage(FunctionContext context, ILogger log, Message messag foreach (var prop in sysProps) if (prop.GetIndexParameters().Length == 0) { - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, prop.Name, Convert.ToString(prop.GetValue(message.SystemProperties)), gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, prop.Name, Convert.ToString(prop.GetValue(message.SystemProperties)), gxcontext); + eventMessageProperties.Add(eventMessageProperty); } } //Event - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessageid", message.MessageId); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageid", message.MessageId); Message.MessageProperty enqueuedTimeUtcProp = message.MessageProperties.Find(x => x.key == "EnqueuedTimeUtc"); if (enqueuedTimeUtcProp != null) { DateTime enqueuedTimeUtc; if (DateTime.TryParse(enqueuedTimeUtcProp.value, out enqueuedTimeUtc)) - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagedate", enqueuedTimeUtc); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessagedate", enqueuedTimeUtc); } - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagesourcetype", EventSourceType.ServiceBusMessage); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessageversion", string.Empty); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagecustompayload", CustomPayload); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessagesourcetype", EventSourceType.ServiceBusMessage); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageversion", string.Empty); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageproperties", eventMessageProperties); //List of Events - EventMessage.Add(EventMessageItem); - parametersdata = new object[] { EventMessages, null }; + eventMessage.Add(eventMessageItem); + parametersdata = new object[] { eventMessages, null }; } try { @@ -232,7 +231,7 @@ private void ProcessMessage(FunctionContext context, ILogger log, Message messag //Error handling - if ((bool)ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Handled") == false) //Must retry + if ((bool)ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Handlefailure") == true) //Must retry { exMessage = string.Format("{0} {1}", FunctionExceptionType.AppError, ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Errormessage")); throw new Exception(exMessage); diff --git a/dotnet/src/extensions/Azure/Handlers/TimerHandler/TimerTriggerHandler.cs b/dotnet/src/extensions/Azure/Handlers/TimerHandler/TimerTriggerHandler.cs index 40378cedb..65dcaf923 100644 --- a/dotnet/src/extensions/Azure/Handlers/TimerHandler/TimerTriggerHandler.cs +++ b/dotnet/src/extensions/Azure/Handlers/TimerHandler/TimerTriggerHandler.cs @@ -94,53 +94,53 @@ private void ProcessMessage(FunctionContext context, ILogger log, MyInfo TimerIn { //Initialization - Type EventMessagesType = parameters[0].ParameterType; //SdtEventMessages - GxUserType EventMessages = (GxUserType)Activator.CreateInstance(EventMessagesType, new object[] { gxcontext }); // instance of SdtEventMessages + Type eventMessagesType = parameters[0].ParameterType; //SdtEventMessages + GxUserType eventMessages = (GxUserType)Activator.CreateInstance(eventMessagesType, new object[] { gxcontext }); // instance of SdtEventMessages - IList EventMessage = (IList)ClassLoader.GetPropValue(EventMessages, "gxTpr_Eventmessage");//instance of GXBaseCollection - Type EventMessageItemType = EventMessage.GetType().GetGenericArguments()[0];//SdtEventMessage + IList eventMessage = (IList)ClassLoader.GetPropValue(eventMessages, "gxTpr_Eventmessage");//instance of GXBaseCollection + Type eventMessageItemType = eventMessage.GetType().GetGenericArguments()[0];//SdtEventMessage - GxUserType EventMessageItem = (GxUserType)Activator.CreateInstance(EventMessageItemType, new object[] { gxcontext }); // instance of SdtEventMessage - IList CustomPayload = (IList)ClassLoader.GetPropValue(EventMessageItem, "gxTpr_Eventmessagecustompayload");//instance of GXBaseCollection + GxUserType eventMessageItem = (GxUserType)Activator.CreateInstance(eventMessageItemType, new object[] { gxcontext }); // instance of SdtEventMessage - Type CustomPayloadItemType = CustomPayload.GetType().GetGenericArguments()[0];//SdtEventCustomPayload_CustomPayloadItem + IList eventMessageProperties = (IList)ClassLoader.GetPropValue(eventMessageItem, "gxTpr_Eventmessageproperties");//instance of GXBaseCollection + Type eventMessPropsItemType = eventMessageProperties.GetType().GetGenericArguments()[0];//SdtEventMessageProperty //Payload - GxUserType CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, "ScheduleStatusNext", TimerInfo.ScheduleStatus.Next.ToUniversalTime().ToString(), gxcontext); - CustomPayload.Add(CustomPayloadItem); + GxUserType eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, "ScheduleStatusNext", TimerInfo.ScheduleStatus.Next.ToUniversalTime().ToString(), gxcontext); + eventMessageProperties.Add(eventMessageProperty); - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, "ScheduleStatusLast", TimerInfo.ScheduleStatus.Last.ToUniversalTime().ToString(), gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, "ScheduleStatusLast", TimerInfo.ScheduleStatus.Last.ToUniversalTime().ToString(), gxcontext); + eventMessageProperties.Add(eventMessageProperty); - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, "ScheduleStatusLastUpdated", TimerInfo.ScheduleStatus.LastUpdated.ToUniversalTime().ToString(), gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, "ScheduleStatusLastUpdated", TimerInfo.ScheduleStatus.LastUpdated.ToUniversalTime().ToString(), gxcontext); + eventMessageProperties.Add(eventMessageProperty); - CustomPayloadItem = CreateCustomPayloadItem(CustomPayloadItemType, "IsPastDue", TimerInfo.IsPastDue.ToString(), gxcontext); - CustomPayload.Add(CustomPayloadItem); + eventMessageProperty = CreateEventMessageProperty(eventMessPropsItemType, "IsPastDue", TimerInfo.IsPastDue.ToString(), gxcontext); + eventMessageProperties.Add(eventMessageProperty); //Event - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessageid", messageId.ToString()); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagesourcetype", EventSourceType.Timer); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagedate", DateTime.UtcNow); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessageversion", string.Empty); - ClassLoader.SetPropValue(EventMessageItem, "gxTpr_Eventmessagecustompayload", CustomPayload); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageid", messageId.ToString()); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessagesourcetype", EventSourceType.Timer); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessagedate", DateTime.UtcNow); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageversion", string.Empty); + ClassLoader.SetPropValue(eventMessageItem, "gxTpr_Eventmessageproperties", eventMessageProperties); //List of Events - EventMessage.Add(EventMessageItem); - parametersdata = new object[] { EventMessages, null }; + eventMessage.Add(eventMessageItem); + parametersdata = new object[] { eventMessages, null }; } try { method.Invoke(objgxproc, parametersdata); GxUserType EventMessageResponse = parametersdata[1] as GxUserType;//SdtEventMessageResponse - bool result = (bool)ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Handled"); + bool result = (bool)ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Handlefailure"); //Error handling - if (result == false) //Must retry + if (result == true) //Must retry { exMessage = string.Format("{0} {1}", FunctionExceptionType.AppError, ClassLoader.GetPropValue(EventMessageResponse, "gxTpr_Errormessage")); throw new Exception(exMessage); @@ -175,13 +175,12 @@ private void ProcessMessage(FunctionContext context, ILogger log, MyInfo TimerIn throw new Exception(exMessage); } } - private GxUserType CreateCustomPayloadItem(Type customPayloadItemType, string propertyId, object propertyValue, GxContext gxContext) + private GxUserType CreateEventMessageProperty(Type eventMessPropsItemType, string propertyId, object propertyValue, GxContext gxContext) { - GxUserType CustomPayloadItem = (GxUserType)Activator.CreateInstance(customPayloadItemType, new object[] { gxContext }); - ClassLoader.SetPropValue(CustomPayloadItem, "gxTpr_Propertyid", propertyId); - ClassLoader.SetPropValue(CustomPayloadItem, "gxTpr_Propertyvalue", propertyValue); - return CustomPayloadItem; - + GxUserType eventMessageProperty = (GxUserType)Activator.CreateInstance(eventMessPropsItemType, new object[] { gxContext }); // instance of SdtEventMessageProperty + ClassLoader.SetPropValue(eventMessageProperty, "gxTpr_Propertyid", propertyId); + ClassLoader.SetPropValue(eventMessageProperty, "gxTpr_Propertyvalue", propertyValue); + return eventMessageProperty; } } public class MyInfo diff --git a/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventCustomPayload_CustomPayloadItem.cs b/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventCustomPayload_CustomPayloadItem.cs deleted file mode 100644 index 734fd3f5d..000000000 --- a/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventCustomPayload_CustomPayloadItem.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - File: type_SdtEventCustomPayload_CustomPayloadItem - Description: EventCustomPayload - Author: Nemo 🐠 for C# (.NET Core) version 17.0.4.150138 - Program type: Callable routine - Main DBMS: -*/ -using System; -using System.Collections; -using GeneXus.Utils; -using GeneXus.Application; -using System.Xml.Serialization; -namespace GeneXus.Programs.genexusserverlessapi -{ - [XmlRoot(ElementName="CustomPayloadItem")] - [XmlType(TypeName="CustomPayloadItem" , Namespace="ServerlessAPI" )] - [Serializable] - public class SdtEventCustomPayload_CustomPayloadItem : GxUserType - { - public SdtEventCustomPayload_CustomPayloadItem( ) - { - /* Constructor for serialization */ - gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = ""; - - gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = ""; - - } - - public SdtEventCustomPayload_CustomPayloadItem(IGxContext context) - { - this.context = context; - initialize(); - } - - #region Json - private static Hashtable mapper; - public override string JsonMap(string value) - { - if (mapper == null) - { - mapper = new Hashtable(); - } - return (string)mapper[value]; ; - } - - public override void ToJSON() - { - ToJSON(true) ; - return; - } - - public override void ToJSON(bool includeState) - { - AddObjectProperty("PropertyId", gxTpr_Propertyid, false); - - - AddObjectProperty("PropertyValue", gxTpr_Propertyvalue, false); - - return; - } - #endregion - - #region Properties - - [SoapElement(ElementName="PropertyId")] - [XmlElement(ElementName="PropertyId")] - public string gxTpr_Propertyid - { - get { - return gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid; - } - set { - gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = value; - SetDirty("Propertyid"); - } - } - - - - - [SoapElement(ElementName="PropertyValue")] - [XmlElement(ElementName="PropertyValue")] - public string gxTpr_Propertyvalue - { - get { - return gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue; - } - set { - gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = value; - SetDirty("Propertyvalue"); - } - } - - - - - public override bool ShouldSerializeSdtJson() - { - - return true; - } - - #endregion - - #region Initialization - - public void initialize( ) - { - gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = ""; - gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = ""; - return ; - } - - - - #endregion - - #region Declaration - - protected string gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid; - - - protected string gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue; - - - - #endregion - } - -} \ No newline at end of file diff --git a/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessage.cs b/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessage.cs index 82e203141..e8b11740e 100644 --- a/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessage.cs +++ b/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessage.cs @@ -89,12 +89,16 @@ public override void ToJSON(bool includeState) AddObjectProperty("EventMessageData", gxTpr_Eventmessagedata, false); - AddObjectProperty("EventMessageVersion", gxTpr_Eventmessageversion, false); - - if (gxTv_SdtEventMessage_Eventmessagecustompayload != null) + if (gxTv_SdtEventMessage_Eventmessageproperties != null) { - AddObjectProperty("EventMessageCustomPayload", gxTv_SdtEventMessage_Eventmessagecustompayload, false); + AddObjectProperty("EventMessageProperties", gxTv_SdtEventMessage_Eventmessageproperties, false); } + + + + AddObjectProperty("EventMessageVersion", gxTpr_Eventmessageversion, false); + + return; } #endregion @@ -174,91 +178,77 @@ public string gxTpr_Eventmessagedata } - - - [SoapElement(ElementName="EventMessageVersion")] - [XmlElement(ElementName="EventMessageVersion")] - public string gxTpr_Eventmessageversion - { - get { - return gxTv_SdtEventMessage_Eventmessageversion; - } - set { - gxTv_SdtEventMessage_Eventmessageversion = value; - SetDirty("Eventmessageversion"); - } - } - - - - - [SoapElement(ElementName="EventMessageCustomPayload" )] - [XmlArray(ElementName="EventMessageCustomPayload" )] - [XmlArrayItemAttribute(ElementName="CustomPayloadItem" , IsNullable=false )] - public GXBaseCollection gxTpr_Eventmessagecustompayload_GXBaseCollection + [SoapElement(ElementName="EventMessageProperties" )] + [XmlArray(ElementName="EventMessageProperties" )] + [XmlArrayItemAttribute(ElementName="EventMessageProperty" , IsNullable=false )] + public GXBaseCollection gxTpr_Eventmessageproperties_GXBaseCollection { get { - if ( gxTv_SdtEventMessage_Eventmessagecustompayload == null ) + if ( gxTv_SdtEventMessage_Eventmessageproperties == null ) { - gxTv_SdtEventMessage_Eventmessagecustompayload = new GXBaseCollection( context, "EventCustomPayload", ""); + gxTv_SdtEventMessage_Eventmessageproperties = new GXBaseCollection( context, "EventMessageProperty", ""); } - return gxTv_SdtEventMessage_Eventmessagecustompayload; + return gxTv_SdtEventMessage_Eventmessageproperties; } set { - if ( gxTv_SdtEventMessage_Eventmessagecustompayload == null ) - { - gxTv_SdtEventMessage_Eventmessagecustompayload = new GXBaseCollection( context, "EventCustomPayload", ""); - } - gxTv_SdtEventMessage_Eventmessagecustompayload_N = 0; - - gxTv_SdtEventMessage_Eventmessagecustompayload = value; + gxTv_SdtEventMessage_Eventmessageproperties_N = false; + gxTv_SdtEventMessage_Eventmessageproperties = value; } } [XmlIgnore] - public GXBaseCollection gxTpr_Eventmessagecustompayload + public GXBaseCollection gxTpr_Eventmessageproperties { get { - if ( gxTv_SdtEventMessage_Eventmessagecustompayload == null ) + if ( gxTv_SdtEventMessage_Eventmessageproperties == null ) { - gxTv_SdtEventMessage_Eventmessagecustompayload = new GXBaseCollection( context, "EventCustomPayload", ""); + gxTv_SdtEventMessage_Eventmessageproperties = new GXBaseCollection( context, "EventMessageProperty", ""); } - gxTv_SdtEventMessage_Eventmessagecustompayload_N = 0; - - return gxTv_SdtEventMessage_Eventmessagecustompayload ; + gxTv_SdtEventMessage_Eventmessageproperties_N = false; + return gxTv_SdtEventMessage_Eventmessageproperties ; } set { - gxTv_SdtEventMessage_Eventmessagecustompayload_N = 0; - - gxTv_SdtEventMessage_Eventmessagecustompayload = value; - SetDirty("Eventmessagecustompayload"); + gxTv_SdtEventMessage_Eventmessageproperties_N = false; + gxTv_SdtEventMessage_Eventmessageproperties = value; + SetDirty("Eventmessageproperties"); } } - public void gxTv_SdtEventMessage_Eventmessagecustompayload_SetNull() + public void gxTv_SdtEventMessage_Eventmessageproperties_SetNull() { - gxTv_SdtEventMessage_Eventmessagecustompayload_N = 1; + gxTv_SdtEventMessage_Eventmessageproperties_N = true; + gxTv_SdtEventMessage_Eventmessageproperties = null; + } + + public bool gxTv_SdtEventMessage_Eventmessageproperties_IsNull() + { + return gxTv_SdtEventMessage_Eventmessageproperties == null; + } + public bool ShouldSerializegxTpr_Eventmessageproperties_GXBaseCollection_Json() + { + return gxTv_SdtEventMessage_Eventmessageproperties != null && gxTv_SdtEventMessage_Eventmessageproperties.Count > 0; - gxTv_SdtEventMessage_Eventmessagecustompayload = null; - return ; } - public bool gxTv_SdtEventMessage_Eventmessagecustompayload_IsNull() + + [SoapElement(ElementName="EventMessageVersion")] + [XmlElement(ElementName="EventMessageVersion")] + public string gxTpr_Eventmessageversion { - if (gxTv_SdtEventMessage_Eventmessagecustompayload == null) - { - return true ; + get { + return gxTv_SdtEventMessage_Eventmessageversion; + } + set { + gxTv_SdtEventMessage_Eventmessageversion = value; + SetDirty("Eventmessageversion"); } - return false ; } - public bool ShouldSerializegxTpr_Eventmessagecustompayload_GXBaseCollection_Json() - { - return gxTv_SdtEventMessage_Eventmessagecustompayload != null && gxTv_SdtEventMessage_Eventmessagecustompayload.Count > 0; - } + + public override bool ShouldSerializeSdtJson() { @@ -275,9 +265,10 @@ public void initialize( ) gxTv_SdtEventMessage_Eventmessagedate = (DateTime)(DateTime.MinValue); gxTv_SdtEventMessage_Eventmessagesourcetype = ""; gxTv_SdtEventMessage_Eventmessagedata = ""; + gxTv_SdtEventMessage_Eventmessageproperties_N = true; gxTv_SdtEventMessage_Eventmessageversion = ""; - gxTv_SdtEventMessage_Eventmessagecustompayload_N = 1; + datetime_STZ = (DateTime)(DateTime.MinValue); sDateCnv = ""; @@ -306,11 +297,13 @@ public void initialize( ) protected string gxTv_SdtEventMessage_Eventmessagedata; + protected bool gxTv_SdtEventMessage_Eventmessageproperties_N; + protected GXBaseCollection gxTv_SdtEventMessage_Eventmessageproperties = null; protected string gxTv_SdtEventMessage_Eventmessageversion; - protected short gxTv_SdtEventMessage_Eventmessagecustompayload_N; - protected GXBaseCollection gxTv_SdtEventMessage_Eventmessagecustompayload = null; + + #endregion diff --git a/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessageProperty.cs b/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessageProperty.cs new file mode 100644 index 000000000..f04498b0b --- /dev/null +++ b/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessageProperty.cs @@ -0,0 +1,200 @@ +/* + File: type_SdtEventMessageProperty + Description: EventMessageProperty + Author: Nemo 🐠 for C# (.NET) version 18.0.3.169293 + Program type: Callable routine + Main DBMS: +*/ +using System; +using System.Collections; +using GeneXus.Utils; +using GeneXus.Resources; +using GeneXus.Application; +using GeneXus.Metadata; +using GeneXus.Cryptography; +using GeneXus.Encryption; +using GeneXus.Http.Client; +using GeneXus.Http.Server; +using System.Reflection; +using System.Xml.Serialization; +using System.Runtime.Serialization; + +using GeneXus.Programs; +namespace GeneXus.Programs.genexusserverlessapi +{ + [XmlRoot(ElementName="EventMessageProperty")] + [XmlType(TypeName="EventMessageProperty" , Namespace="ServerlessAPI" )] + [Serializable] + public class SdtEventMessageProperty : GxUserType + { + public SdtEventMessageProperty( ) + { + /* Constructor for serialization */ + gxTv_SdtEventMessageProperty_Propertyid = ""; + + gxTv_SdtEventMessageProperty_Propertyvalue = ""; + + } + + public SdtEventMessageProperty(IGxContext context) + { + this.context = context; + initialize(); + } + + #region Json + private static Hashtable mapper; + public override string JsonMap(string value) + { + if (mapper == null) + { + mapper = new Hashtable(); + } + return (string)mapper[value]; ; + } + + public override void ToJSON() + { + ToJSON(true) ; + return; + } + + public override void ToJSON(bool includeState) + { + AddObjectProperty("PropertyId", gxTpr_Propertyid, false); + + + AddObjectProperty("PropertyValue", gxTpr_Propertyvalue, false); + + return; + } + #endregion + + #region Properties + + [SoapElement(ElementName="PropertyId")] + [XmlElement(ElementName="PropertyId")] + public string gxTpr_Propertyid + { + get { + return gxTv_SdtEventMessageProperty_Propertyid; + } + set { + gxTv_SdtEventMessageProperty_Propertyid = value; + SetDirty("Propertyid"); + } + } + + + + + [SoapElement(ElementName="PropertyValue")] + [XmlElement(ElementName="PropertyValue")] + public string gxTpr_Propertyvalue + { + get { + return gxTv_SdtEventMessageProperty_Propertyvalue; + } + set { + gxTv_SdtEventMessageProperty_Propertyvalue = value; + SetDirty("Propertyvalue"); + } + } + + + + public override bool ShouldSerializeSdtJson() + { + return true; + } + + + + #endregion + + #region Initialization + + public void initialize( ) + { + gxTv_SdtEventMessageProperty_Propertyid = ""; + gxTv_SdtEventMessageProperty_Propertyvalue = ""; + return ; + } + + + + #endregion + + #region Declaration + + protected string gxTv_SdtEventMessageProperty_Propertyid; + + + protected string gxTv_SdtEventMessageProperty_Propertyvalue; + + + + #endregion + } + #region Rest interface + [GxUnWrappedJson()] + [DataContract(Name=@"EventMessageProperty", Namespace="ServerlessAPI")] + public class SdtEventMessageProperty_RESTInterface : GxGenericCollectionItem, System.Web.SessionState.IRequiresSessionState + { + public SdtEventMessageProperty_RESTInterface( ) : base() + { + } + + public SdtEventMessageProperty_RESTInterface( SdtEventMessageProperty psdt ) : base(psdt) + { + } + + #region Rest Properties + [DataMember(Name="PropertyId", Order=0)] + public string gxTpr_Propertyid + { + get { + return StringUtil.RTrim( sdt.gxTpr_Propertyid); + + } + set { + sdt.gxTpr_Propertyid = value; + } + } + + [DataMember(Name="PropertyValue", Order=1)] + public string gxTpr_Propertyvalue + { + get { + return StringUtil.RTrim( sdt.gxTpr_Propertyvalue); + + } + set { + sdt.gxTpr_Propertyvalue = value; + } + } + + + #endregion + + public SdtEventMessageProperty sdt + { + get { + return (SdtEventMessageProperty)Sdt; + } + set { + Sdt = value; + } + } + + [OnDeserializing] + void checkSdt( StreamingContext ctx ) + { + if ( sdt == null ) + { + sdt = new SdtEventMessageProperty() ; + } + } + } + #endregion +} \ No newline at end of file diff --git a/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessageResponse.cs b/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessageResponse.cs index cabe46c59..984b053cf 100644 --- a/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessageResponse.cs +++ b/dotnet/src/extensions/Azure/test/GeneXus.Programs.Common/type_SdtEventMessageResponse.cs @@ -53,7 +53,7 @@ public override void ToJSON() public override void ToJSON(bool includeState) { - AddObjectProperty("Handled", gxTpr_Handled, false); + AddObjectProperty("HandleFailure", gxTpr_Handlefailure, false); AddObjectProperty("ErrorMessage", gxTpr_Errormessage, false); @@ -64,18 +64,16 @@ public override void ToJSON(bool includeState) #region Properties - [SoapElement(ElementName = "Handled")] - [XmlElement(ElementName = "Handled")] - public bool gxTpr_Handled + [SoapElement(ElementName="HandleFailure")] + [XmlElement(ElementName="HandleFailure")] + public bool gxTpr_Handlefailure { - get - { - return gxTv_SdtEventMessageResponse_Handled; + get { + return gxTv_SdtEventMessageResponse_Handlefailure; } - set - { - gxTv_SdtEventMessageResponse_Handled = value; - SetDirty("Handled"); + set { + gxTv_SdtEventMessageResponse_Handlefailure = value; + SetDirty("Handlefailure"); } } @@ -122,8 +120,8 @@ public void initialize() #region Declaration - protected bool gxTv_SdtEventMessageResponse_Handled; - + protected bool gxTv_SdtEventMessageResponse_Handlefailure; + protected string gxTv_SdtEventMessageResponse_Errormessage; @@ -145,17 +143,15 @@ public SdtEventMessageResponse_RESTInterface(SdtEventMessageResponse psdt) : bas } #region Rest Properties - [DataMember(Name = "Handled", Order = 0)] - public bool gxTpr_Handled + [DataMember(Name="HandleFailure", Order=0)] + public bool gxTpr_Handlefailure { - get - { - return sdt.gxTpr_Handled; + get { + return sdt.gxTpr_Handlefailure; } - set - { - sdt.gxTpr_Handled = value; + set { + sdt.gxTpr_Handlefailure = value; } } [DataMember(Name = "ErrorMessage", Order = 0)] diff --git a/dotnet/src/extensions/Azure/test/amyprocedurehandler/amyprochandler.cs b/dotnet/src/extensions/Azure/test/amyprocedurehandler/amyprochandler.cs index 89593c89b..9bbdd665c 100644 --- a/dotnet/src/extensions/Azure/test/amyprocedurehandler/amyprochandler.cs +++ b/dotnet/src/extensions/Azure/test/amyprocedurehandler/amyprochandler.cs @@ -28,7 +28,7 @@ public void execute(genexusserverlessapi.SdtEventMessages aP0_EventMessages, out genexusserverlessapi.SdtEventMessageResponse aP1_ExternalEventMessageResponse) { aP1_ExternalEventMessageResponse = new GeneXus.Programs.genexusserverlessapi.SdtEventMessageResponse(context); - aP1_ExternalEventMessageResponse.gxTpr_Handled = true; + aP1_ExternalEventMessageResponse.gxTpr_Handlefailure = false; } public override void initialize()