Skip to main content

I am creating an XML message using a Script connector:

<arc:set attr="output.filename" value="xmltriggerfile__guid()].xml" />
<arc:set attr="output.filepath" value=""filepath]" />
<arc:set attr="output.data"><?xml version="1.0" encoding="UTF-8"?>
<Schedule>
<startDateTime>;_|now()|dateadd('day',-1, 'yyyy-MM-dd 00:00:00')]</startDateTime>
<endDateTime>;_|now()|dateadd('day',-1, 'yyyy-MM-dd 23:59:59')]</endDateTime>
<Results></Results>
</Schedule>
</arc:set>

<arc:push item="output" />

 

This is then fed into a MySQL Lookup Connector which results in the following message

 

<Schedule>
<startDateTime>2024-03-11 00:00:00</startDateTime>
<endDateTime>2024-03-11 23:59:59</endDateTime>
<Results>
<TrackingEvent>
<e_updated_at>2024-03-11T00:03:25.0000+00:00</e_updated_at>
<e_shipment_id>20167856</e_shipment_id>
<s_uuid>1eedb845-66bd-6fc2-8198-825a21bcab7e</s_uuid>
<e_harmonised_status_id>134</e_harmonised_status_id>
<e_created_at>2024-03-11T00:03:25.0000+00:00</e_created_at>
<e_id>89298203</e_id>
<e_carrier_message
>Item received at inbound office of exchange</e_carrier_message>
<e_source_id>1</e_source_id>
<c_carrier_name>Jersey Post</c_carrier_name>
<e_happened_at>2024-03-10T19:48:00.0000+00:00</e_happened_at>
<e_parcel_id>20172761</e_parcel_id>
<e_country_code>US</e_country_code>
<e_sub_status>024</e_sub_status>
<e_status>120</e_status>
<e_location
>United States Postal Service facility, ISC NEW YORK NY (USPS), US</e_location>
<e_happened_at_timezone>UTC</e_happened_at_timezone>
<e_source_type>Modules\Carriers\Carrier</e_source_type>
<e_unique_sub_status>024</e_unique_sub_status>
<p_id>20172761</p_id>
<p_uuid>1eedb845-66c2-6d9c-a6b9-825a21bcab7e</p_uuid>
<p_barcode>UM296646964JE</p_barcode>
<p_tracking_number>UM296646964JE</p_tracking_number>
<h_created_at>2022-10-10T10:40:51.0000+01:00</h_created_at>
<h_id>134</h_id>
<h_code>120-024</h_code>
<h_updated_at>2022-10-10T10:40:51.0000+01:00</h_updated_at>
<h_name>Internal movement within carrier network</h_name>
<h_message>Item received at inbound office of exchange</h_message>
<h_tenant_id>1</h_tenant_id>
<h_stage>3</h_stage>
<a_uuid>91730c91-f330-43b5-afb7-98034ee0bf1d</a_uuid>
</TrackingEvent>
<TrackingEvent>
...
</TrackingEvent>
...
</Results>
</Schedule>

 

 

But my Split Connector throws an error: sxmltriggerfile_22297792350344c8a4a633c3eb4b297f.xml] Can't write content text here.”

Here’s my path

 

 

 

So not sure what this error means.

 

I’ve tried deleting the Split connector and creating it again. I’ve tried in a completely different workflow on our separate Test Instance of Arc. Same issue.

 

Could it be the way the original message has been created using a Script connector?

What you are seeing here is a recently discovered bug in the Split connector that will be addressed in the near future in an upcoming update for the software. 

 

The Split connector here is encountering an error when the input XML file has some extra leading or trailing whitespace outside of the root Schedule tag (really hard to spot in the input file). As an immediate solution, please create a Script connector that immediately precedes the Split connector, and drop in this code:

 

<arc:set attr="file.file" value="efilepath]" />
<arc:set attr="output.data">
<arc:call op="fileRead" item="file">gfile.file:data | trim]</arc:call>
</arc:set>
<arc:push item="output" />

 

Like so:

 

 

And requeue your XML from the TrimWhitespace step - if you do this, do you see the Split work as expected?


Thanks James, that worked!

 

For reference: the version is  23.4.8789.0


Reply