C# 将收集数据传递给K2 custom service broker方法
我有两个K2 SmartObjects:SmartObjectA获取对象列表。SmartObjectB是一个自定义SmartObject,它以SmartObjectA(基本智能对象)返回的列表作为输入参数执行自定义创建方法 在CustomServiceBroker的代码隐藏中,我需要反序列化列表值C# 将收集数据传递给K2 custom service broker方法,c#,xml,k2,C#,Xml,K2,我有两个K2 SmartObjects:SmartObjectA获取对象列表。SmartObjectB是一个自定义SmartObject,它以SmartObjectA(基本智能对象)返回的列表作为输入参数执行自定义创建方法 在CustomServiceBroker的代码隐藏中,我需要反序列化列表值 如何将K2中接收到的列表作为create方法的输入参数传递?我正在使用多值属性并将SmartObjectA属性分配给它 K2使用什么格式序列化多值,如何检查输入值格式,以便正确映射列表 SmartOb
Name - SOType.Text,
ID - SOType.Number,
Date - SOType.Date,
Description - SOType.Text
SmartObject B-要使用SmartObjectA列表填充的属性:
[Property("LineItems", SoType.MultiValue, "LineItems", "The line items.")]
public string LineItems
{
get
{
return _lineItems;
}
set { _lineItems = value; }
}
SmartObjectB的输入属性和创建方法:
[SourceCode.SmartObjects.Services.ServiceSDK.Attributes.Method("Create",
MethodType.Create,
"Create",
"Description",
new string[] { "CustomerId", "Date", "DueDate" },
new string[] { "CustomerId", "Date", "DueDate", "LineItems" },
new string[] { "TaxInvoiceId" })]
public TaxInvoice Create()
{
try
{
..deserialize here
}
}
既然已经有了2个不同的SimObjts,为什么不考虑构建一个复合SimoToMtudio.
使用复合smartobject,实际上不需要构建自定义service broker请向我们展示一些代码custom service broker从K2获取接收到的数据,并使用它向外部会计系统发送REST请求