# Wm6 Template migration Failed Segment Delimiter cannot be null

**URL:** <https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [June 24, 2003, 11:58pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664 "2003-06-24T23:58:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg.mitchell.23005](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@greg.mitchell.23005](https://techcommunity.softwareag.com/u/greg.mitchell.23005)\
**Post date:** [June 24, 2003, 11:58pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/1 "2003-06-24T23:58:14Z")

</div>

I’m attempting to upgrade our EDI process (which isn’t in production yet) to 6.0.1, in order to take advantage of the new generateFA service, among other things.

Anyway, I’m following the instructions to convert my existing flat file templates to Flat File Schemas (as outlined on page 101 of the Integration Platform Guide 6.0.1) and have run into a snag.

I get the following error: “Failed: Segment Delimiter cannot be null” when trying to “migrate” (step 7/8 on p 102) my fixed length flat file templates.

The templates worked fine for translating the fixed length data into a record via wm.b2b.edi:convertToValues, and translating the record structure to a fixed length file via wm.b2b.edi:convertToString under 4.6.

any suggestions? The relevant parts of my template are:  
\<?xml\> (should be a version=“1.0” in there - forum strips it)  
\<positional\_flat\_file\_template\>  
\<segment-delimiter\>  
\<fixed\>10\</fixed\>  
\<keyword/\>  
\<offset/\>  
\</segment-delimiter\>  
\<field-delimiter\>  
\<fixed/\>  
\<keyword/\>  
\<offset/\>  
\</field-delimiter\>  
\<sub-field-delimiter\>  
\<fixed/\>  
\<keyword/\>  
\<offset/\>  
\</sub-field-delimiter\>

---

<div class="post-metadata">

**Author:** ![greg.mitchell.23005](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@greg.mitchell.23005](https://techcommunity.softwareag.com/u/greg.mitchell.23005)\
**Post date:** [June 25, 2003, 12:11am UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/2 "2003-06-25T00:11:38Z")

</div>

Never mind - the issue was with how I “Put” the templates into the package (step 3a) - I was mapping a level too high. Once I realized that, everything worked mostly smoothly.

Thanks wmUsers - typing out the problem helped me solve it 😉

Hopefully I can save someone else the trouble of figuring it out somewhere down the line.

---

<div class="post-metadata">

**Author:** ![mrajanet](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mrajanet](https://techcommunity.softwareag.com/u/mrajanet)\
**Post date:** [June 25, 2003, 2:11am UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/3 "2003-06-25T02:11:37Z")

</div>

Suggestion -

Did you think of moving out of the EDI templates. webMethods have started using SEF files and Flatfile Schemas and apparently is a replacement for the templates which we used to define it manually in Pre-6.0 version. Ofcourse, the services convertToValues and convertToString support templates but I see in their sample files, that they are using Flatfile Schemas generated out of EDI SEF files.

---

<div class="post-metadata">

**Author:** ![min.zhong.34138](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@min.zhong.34138](https://techcommunity.softwareag.com/u/min.zhong.34138)\
**Post date:** [June 26, 2003, 2:00am UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/4 "2003-06-26T02:00:56Z")

</div>

Hi, Greg

Could you show us how you “Put” the templates into the package (the actual flow if you will)?

We are having problem to use the migrate tool to convert our flat file template created in version 4.6.

If the template was put by the flow in Maping2HigherLevel attachment, When we migrate it, we get error “Segment Delimiter cannot be null”.

If the template was put by the flow in Maping2LowerLevel attachment, When we migrate it, we get error “java.lang.NullPointerException”.

Any suggestion will be appreciated.  
Thank you very much

Min

![](http://www.wmusers.com/wmusers/icons/attachment_icon.gif)Maping2HigherLevel  
[Map2HigherLevel.htm](http://www.wmusers.com/wmusers/messages/117/Map2HigherLevel-15345.htm) (0.3 k)

![](http://www.wmusers.com/wmusers/icons/attachment_icon.gif)Maping2LowerLevel  
[Map2LowerLevel.htm](http://www.wmusers.com/wmusers/messages/117/Map2LowerLevel-15346.htm) (0.3 k)

---

<div class="post-metadata">

**Author:** ![greg.mitchell.23005](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@greg.mitchell.23005](https://techcommunity.softwareag.com/u/greg.mitchell.23005)\
**Post date:** [June 28, 2003, 1:01am UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/5 "2003-06-28T01:01:17Z")

</div>

Wow - I didn’t think to check back in this thread (since my problem was solved)

Anyway, Min - to further explain what I did wrong, then what I did to fix it…

In order to load a template, what I had been doing was:  
pub.file:getFile  
pub.web:stringToDocument  
pub.web:documentToRecord

Mapping documentToRecord’s boundNode to a record called “EDITemplate”

I set up those steps as a service called “pcsGetTemplate” which took parameters to specify which file I wanted to load etc.

Then, to store the template into the template manager, I did the following:  
pcsGetTemplate  
wm.b2b.edi.templateMgr:putTemplate

The trick was to see what putTemplate was expecting, by calling  
wm.b2b.edi.templateMgr:getTemplate and comparing the pipeline with the result of pcsGetTemplate.

After performing a “pcsGetTemplate” successfully, the pipeline contained a record called “EDITemplate” which contained a subrecord called “positional\_flat\_file\_template” which is the top level in my template xml document above. wm.b2b.edi.templateMgr:getTemplate was just returning a template object, without the extra level.

To get it to work, I mapped EDITemplate.positional\_flat\_file\_template to the templateObject parameter of wm.b2b.edi.templateMgr:putTemplate

This has allowed me to migrate my templates over to 6.0.1

A couple of warnings though - first, the Flat File Schema that is generated by the migration tool does not bring over ordinality (ie, it treats everything as a single occuring record) To fix that, go through your template xml file, looking for all occurences of “,” in the loops, and set the occurences of that record to “Unlimited”

Also, the schema will contain all the individual records at the top level. Basically, it doesn’t do a very good job of parsing out the meaning of the Loops section of the template.

There are other subtle differences that I’m slowly working my way through too.

Hope this helped.

---

<div class="post-metadata">

**Author:** ![min.zhong.34138](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@min.zhong.34138](https://techcommunity.softwareag.com/u/min.zhong.34138)\
**Post date:** [July 8, 2003, 3:41am UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/6 "2003-07-08T03:41:36Z")

</div>

Hi, Greg

Thank you very much for the reply. I tried to put our template the way you described here but when I use the migrate tool in WmEDI package, I still got NullPointerException.

I just wonder if the template itself have problems. Could you take a look at our template and see if you can convert it with the migration tool?

Thanks again for your help!

![](http://www.wmusers.com/wmusers/icons/attachment_icon.gif)Flat File Template  
[TemplateForFreightBill\_v4.xml](http://www.wmusers.com/wmusers/messages/117/TemplateForFreightBill_v4-15466.unk) (4.7 k)

---

<div class="post-metadata">

**Author:** ![greg.mitchell.23005](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@greg.mitchell.23005](https://techcommunity.softwareag.com/u/greg.mitchell.23005)\
**Post date:** [July 8, 2003, 7:54pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/7 "2003-07-08T19:54:12Z")

</div>

Well, I’ve never used a record with no ID before, so I’m not sure how it works… One quick thing that I noticed is that your loop doesn’t have any segments - \<seg-id\>recordWithNoID\</seg-id\> should be inside your Loop tags.

I’ll give it a quick run through my setup and see if it works or not.

---

<div class="post-metadata">

**Author:** ![greg.mitchell.23005](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@greg.mitchell.23005](https://techcommunity.softwareag.com/u/greg.mitchell.23005)\
**Post date:** [July 8, 2003, 8:06pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/8 "2003-07-08T20:06:15Z")

</div>

That seemed to import just fine after I added in the \<seg-id\> tags (note that it has to be upper case, but the message board nicely converts it to lower case for me.)

Good luck, and let me know how you do with it.

---

<div class="post-metadata">

**Author:** ![min.zhong.34138](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@min.zhong.34138](https://techcommunity.softwareag.com/u/min.zhong.34138)\
**Post date:** [July 8, 2003, 8:39pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/9 "2003-07-08T20:39:40Z")

</div>

Thank you very much. It worked.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [September 17, 2003, 10:50pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/10 "2003-09-17T22:50:46Z")

</div>

Just one thing guys!

We donot see putTemplate service in our wmEDI package. Is there something that we are missing? Or is this a restricted service?  
Can you help us locate the service so that we can use it for migrating templates from 4.6 to 6.01

Thanks !

---

<div class="post-metadata">

**Author:** ![greg.mitchell.23005](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@greg.mitchell.23005](https://techcommunity.softwareag.com/u/greg.mitchell.23005)\
**Post date:** [September 17, 2003, 11:18pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/11 "2003-09-17T23:18:52Z")

</div>

putTemplate is 4.6 only - they’ve removed it from 6.0.1 so that people won’t use templates anymore, and will migrate to flatfile schemas.

---

<div class="post-metadata">

**Author:** ![pam\_hullander.21157](https://avatars.discourse-cdn.com/v4/letter/p/6bbea6/32.png) [@pam\_hullander.21157](https://techcommunity.softwareag.com/u/pam_hullander.21157)\
**Post date:** [May 13, 2004, 1:31am UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/12 "2004-05-13T01:31:20Z")

</div>

I am running the template migration against a positional file and getting the error below; template is shown below also. I have successfully been able to migrate templates where specific lengths of fields are defined.

ERROR:  
EDIFFSchema.FlatFile\_CargillNATLSKleinschmidt.V2:TFFTemplateCLM\_HEADER  
Failed: No fields defined

TEMPLATE:  
\<?xml\>  
\<fftemplate\>  
\<field-delimiter\>  
\<fixed\>32\</fixed\>  
\<keyword/\>  
\<offset/\>  
\</field-delimiter\>  
\<sub-field-delimiter\>  
\<fixed/\>  
\<keyword/\>  
\<offset/\>  
\</sub-field-delimiter\>  
\<segment-delimiter\>  
\<fixed\>10\</fixed\>  
\<keyword/\>  
\<offset/\>  
\</segment-delimiter\>  
\<segment\>  
\<field\>  
\<field\>  
\<field\>  
\<field\>  
\<field\>  
\<field\>  
\<field\>  
\<field\>  
\</segment\>

\<segment/\>

\<loop\>  
\<seg-id\>#CLMDATA\</seg-id\>  
\</loop\>

\<loop/\>

\</fftemplate\>

* * *

com.wm.app.b2b.server.ServiceException: No fields defined  
at wm.b2b.edi.parse.migration.SegmentHolder$ASegment.\<init\>(SegmentHolder.java:239)  
at wm.b2b.edi.parse.migration.SegmentHolder.\<init\>(SegmentHolder.java:47)  
at wm.b2b.edi.parse.migration.MigrateTemplate.\<init\>(MigrateTemplate.java:94)  
at wm.b2b.edi.migration.migrateTemplate(migration.java:582)  
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  
at java.lang.reflect.Method.invoke(Method.java:324)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:04pm UTC](https://techcommunity.softwareag.com/t/wm6-template-migration-failed-segment-delimiter-cannot-be-null/107664/13 "2021-04-02T15:04:53Z")

</div>


