You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have an asp netcore 3.1 application that connects to the vanilla docker camunda image. We are solely using external workers that are implemented with the Camunda.Worker library.
I want to pass complex object to a running instance, form my aspnet api project, however whatever I tried I am getting the error:
Type Object not in [Json]
the code I am using for starting a process instance with complex variables:
pseudo code:
publicclassComplObject{publicstringprop1{get;set;}}varmyObjectVariable=newComplObject{prop1="abc"}varprocessParams=newStartProcessInstance{BusinessKey="my business key",SkipIoMappings=false,Variables=newDictionary<string,VariableValue>{"myComplexObject",VariableValue.FromObject(myObjectVariable)}};Camunda.ProcessDefinitions[someId].StartProcessInstance(processParams);
Later when I try to obtain the variable from a worker, I am getting the above-mentioned error Type Object not in [Json]
I saw lots of tests in Camunda.Worker project and being only in the context of Camunda.Worker I have no problems using the methods like .AsJson.AsString.
I think there is something around Camunda.Api.Client.VariableValue and Camunda.Worker.Variable classes that I am missing.
the only workaround so far for me is to pass an instance of Camunda.Worker.Variable to the Camunda.Api.Client.VariableValue.FromObject method, explicitly stating the ValueType.Json. However later on, when I want to obtain the typed variables from a worker, I need to do this extra hacky code:
Hello, I have an asp netcore 3.1 application that connects to the vanilla docker camunda image. We are solely using external workers that are implemented with the Camunda.Worker library.
I want to pass complex object to a running instance, form my aspnet api project, however whatever I tried I am getting the error:
Type Object not in [Json]
the code I am using for starting a process instance with complex variables:
pseudo code:
Later when I try to obtain the variable from a worker, I am getting the above-mentioned error
Type Object not in [Json]
I saw lots of tests in Camunda.Worker project and being only in the context of Camunda.Worker I have no problems using the methods like
.AsJson
.AsString
.I think there is something around
Camunda.Api.Client.VariableValue
andCamunda.Worker.Variable
classes that I am missing.the only workaround so far for me is to pass an instance of
Camunda.Worker.Variable
to theCamunda.Api.Client.VariableValue.FromObject
method, explicitly stating theValueType.Json
. However later on, when I want to obtain the typed variables from a worker, I need to do this extra hacky code:JsonConvert.DeserializeObject<Variable>(camundaVariable.Value.ToString()).AsJson<T>();
I wonder what am I doing wrong.
Please advice
The text was updated successfully, but these errors were encountered: