What I am trying to do is to send Custom Context Header “ContextHeader” over Rest API call and then grab changed one.
When I am not sending “ContextHeader” everything is fine. However when “ContextHeader” is added I am receiving error from BPM processing.
Call with “ContextHeader”
curl --location --request GET ‘https://MyServer\MyInstance/api/v1/Ice.BO.UD01Svc/UD01s?$filter=Key1%20eq%20%2701.01.2017%2000:00:00%27&Company=%27MyCompany%27’
–header ‘ContextHeader: {“Context”:{“BpmData”:[{“Password”:“”,“ButtonValue”:0,“Character01”:“testing”,“Character02”:“”,“Character03”:“”,“Character04”:“”,“Character05”:“”,“Character06”:“”,“Character07”:“”,“Character08”:“”,“Character09”:“”,“Character10”:“”,“Character11”:“”,“Character12”:“”,“Character13”:“”,“Character14”:“”,“Character15”:“”,“Character16”:“”,“Character17”:“”,“Character18”:“”,“Character19”:“”,“Character20”:“”,“Number01”:0.0,“Number02”:0.0,“Number03”:0.0,“Number04”:0.0,“Number05”:0.0,“Number06”:0.0,“Number07”:0.0,“Number08”:0.0,“Number09”:0.0,“Number10”:0.0,“Number11”:0.0,“Number12”:0.0,“Number13”:0.0,“Number14”:0.0,“Number15”:0.0,“Number16”:0.0,“Number17”:0.0,“Number18”:0.0,“Number19”:0.0,“Number20”:0.0,“Date01”:null,“Date02”:null,“Date03”:null,“Date04”:null,“Date05”:null,“Date06”:null,“Date07”:null,“Date08”:null,“Date09”:null,“Date10”:null,“Checkbox01”:false,“Checkbox02”:false,“Checkbox03”:false,“Checkbox04”:false,“Checkbox05”:false,“Checkbox06”:false,“Checkbox07”:false,“Checkbox08”:false,“Checkbox09”:false,“Checkbox10”:false,“ShortChar01”:“”,“ShortChar02”:“”,“ShortChar03”:“”,“ShortChar04”:“”,“ShortChar05”:“”,“ShortChar06”:“”,“ShortChar07”:“”,“ShortChar08”:“”,“ShortChar09”:“”,“ShortChar10”:“”,“SysRowID”:“66e9ceee-7168-4fe8-8698-fa8d53a60456”,“RowMod”:“”,“SpecifiedProperties”:“”,“UserDefinedColumns”:{}}],“CallStack”:[],“CallState”:[],“Client”:[{“ClientType”:“”,“ProcessId”:“”,“AssemblyName”:“”,“CustomizationId”:“”,“CurrentUserId”:“MyUser”,“CurrentCompany”:“MyCompany”,“CurrentPlant”:“MfgSys”,“CGCCode”:“”,“SysRowID”:“da8e443b-2603-4b7c-b572-dc9655e10f2e”,“RowMod”:“”,“SpecifiedProperties”:“/wE=”,“UserDefinedColumns”:{}}],“ClientHandler”:[],“InfoMessage”:[],“ExtensionTables”:[]}}’
–header ‘Authorization: Basic cjemVwYW5nOkdlcm1hbiE3OQ==’
BPM Code to check BPMCallContext
variant 1
var rBpmData =
(
from a in this.callContextBpmData.Table.Cast()
where
a.Character01 == “testing”
select a
).FirstOrDefault();
variant 2
if (string.Equals(this.callContextBpmData.Character01, “testing”, StringComparison.OrdinalIgnoreCase))
{
this.callContextBpmData.Character01 = “processed”; //error is coming from here
}
return;
In both cases I have an error:
for variant 1
“Program”: “System.Core.dll”,
“Method”: “Cast”,
“LineNumber”: 0,
“ColumnNumber”: 0,
“Message”: “BPM runtime caught an unexpected exception of ‘ArgumentNullException’ type.\r\nSee more info in the Inner Exception section of Exception Details.”,
“TraceStack”: " at System.Linq.Enumerable.Cast[TResult](IEnumerable source)\r\n at Epicor.Customization.Bpm.BOB7DD542C70CF4F6B8C36D0CE94EA1A05.GetRowsPreProcessingDirective_UpdateFields_AF658F2527FF4DCEA1751C0F4A14B1C8.A001_CustomCodeAction() in GetRows.Pre.UpdateFields.cs:line 90\r\n at Epicor.Customization.Bpm.BOB7DD542C70CF4F6B8C36D0CE94EA1A05.GetRowsPreProcessingDirective_UpdateFields_AF658F2527FF4DCEA1751C0F4A14B1C8.ExecuteCore() in GetRows.Pre.UpdateFields.cs:line 54\r\n at Epicor.Customization.Bpm.DirectiveBase`3.Execute(TParam parameters) in C:\_Releases\ICE\ICE3.2.300.14\Source\Server\Internal\Lib\Epicor.Customization.BPM\DirectiveBase.Generic.cs:line 147\r\n",
for variant 2
“Program”: “Epicor.ServiceModel.dll”,
“Method”: “SetBit”,
“LineNumber”: 319,
“ColumnNumber”: 13,
“Message”: “BPM runtime caught an unexpected exception of ‘IndexOutOfRangeException’ type.\r\nSee more info in the Inner Exception section of Exception Details.”,
“TraceStack”: " at Ice.IceRow.SetBit(Byte[] bytes, Int32 index, Boolean value) in C:\_Releases\ICE\ICE3.2.300.14\Source\Shared\Framework\Epicor.ServiceModel\Ice\Tableset\IceRow.cs:line 319\r\n at Epicor.Customization.Bpm.BO30DC5C9612204F549EC7A39DC756A78F.GetRowsPreProcessingDirective_UpdateFields_AF658F2527FF4DCEA1751C0F4A14B1C8.A001_CustomCodeAction() in GetRows.Pre.UpdateFields.cs:line 88\r\n at Epicor.Customization.Bpm.BO30DC5C9612204F549EC7A39DC756A78F.GetRowsPreProcessingDirective_UpdateFields_AF658F2527FF4DCEA1751C0F4A14B1C8.ExecuteCore() in GetRows.Pre.UpdateFields.cs:line 54\r\n at Epicor.Customization.Bpm.DirectiveBase`3.Execute(TParam parameters) in C:\_Releases\ICE\ICE3.2.300.14\Source\Server\Internal\Lib\Epicor.Customization.BPM\DirectiveBase.Generic.cs:line 147\r\n",
“Properties”: {
“OriginalExceptionType”: “IndexOutOfRangeException”
Is this a bug in rest API? or I am doing something wrong?
I am using v1 in Epicor 10.2.300.14