Context evaluation failed on Date value

Workflow call with context mapping fails when trying to map Date value as XPath concat(substring-before(/row/@Date , 'T'), 'T23:59:59')
The @Date value in XML looks like this <row Date="2021-09-19T06:24:25.0000000+02:00" ..... . The XPath returns 2021-09-19T23:59:59, which looks like correct date format.
It worked in Flash version. Any suggestion what’s wrong?
Thank you.

WF log:

2021-09-19 20:47:10,717 [Workflow 77b721d0-1e9d-4d23-9714-ee9f19e51588] ERROR Origam.Workflow.WorkflowEngine - Context evaluation failed for 'TTD_Delivery_OnFarmerUpdated/ProcessInTransaction/02_UpdateOldFarmerLOP/DateTo'
Origam.OrigamException: Context evaluation failed for 'TTD_Delivery_OnFarmerUpdated/ProcessInTransaction/02_UpdateOldFarmerLOP/DateTo'
 ---> Origam.OrigamException: Context evaluation failed for 'TTD_Delivery_OnFarmerUpdated/ProcessInTransaction/02_UpdateOldFarmerLOP/DateTo'
 ---> System.FormatException: String 'T23:59:59' was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExactMultiple(ReadOnlySpan`1 s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
   at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
   at Origam.Rule.RuleEngine.EvaluateContext(String xpath, Object context, OrigamDataType dataType, AbstractDataStructure targetStructure) in D:\a\1\s\origam-source\Origam.Rule\RuleEngine.cs:line 2650
   at Origam.Workflow.Tasks.WorkflowCallEngineTask.OnExecute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\WorkflowCallEngineTask.cs:line 97
   --- End of inner exception stack trace ---
   at Origam.Workflow.Tasks.WorkflowCallEngineTask.OnExecute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\WorkflowCallEngineTask.cs:line 113
   at Origam.Workflow.Tasks.WorkflowCallEngineTask.Execute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\WorkflowCallEngineTask.cs:line 54
   --- End of inner exception stack trace ---

The log says that the date is:

which is indeed NOT a correct date format. How do you know the context contains /row/... structure? Maybe it would be better to enable rule engine logging so you know exactly what goes in. Simple data type context store’s value would be /ROOT/value.

I know the context is /row/... because it is in workflow trace. There is no record in Rule debug log, this is not a rule, but I can see other rules using same context and the input data looks like Input data: <row Date="2021-09-19T10:05:44.0000000+02:00" DistanceBruttoWeightNoImputed="1181.8800000000" ..... So there is no /ROOT/value.
When I try to manually evaluate the XPath over the Input data, it returns correct Date.

image

@washi’s idea bring me to right way. The issue is in data passing from StateMachine to Workflow context. The StateMachine is passing one whole record (not only one value) in format <row ..... and not in source datastructure format like <ROOT><Invoice Date="2021-09-19T10:05:44" ... /></ROOT>. The target context is defined as Datastructure <ROOT><Invoice...... So the source data format mismatch target format and the target context is empty.
As a workaround you can use _any datastructure for target context.
But it makes sense for me, if the source data passing format matches the source datastructure format and not /row/@....

Has it worked before? Can I see how the context mapping looks like?

Yes, it worked on Flash. We can make a Skype session so I can show the context mapping.

Just paste a screenshot of the mapping please. Should be enough.

StateMachine mapping

WF context store