Hi everyone.
I’m trying to set some default values for the multilevel promotion flow
For this four values I have no problem.
execution.setVariable('StructureManufacturing', true);
execution.setVariable('RoutingManufacturing', true);
execution.setVariable('StructureStatus', 'Buildable');
execution.setVariable('RoutingStatus', 'Buildable');
But for the date I receive an error.
When I use this statement :
var now = new java.util.Date();
execution.setVariable('EffectiveDate', now);
I receive following error
The Camunda Attribute EffectiveDate has a type of DATE but the provided value does not match that type.
When I use this statement :
var sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
var today = sdf.format(new java.util.Date());
execution.setVariable("EffectiveDate", today);
I receive following error
This error happens when the server cannot serialize the data to be sent to the client.
What is correct way to set a default value to field of type date?