Book a Demo

Author Topic: Custom Script fragments not working in 13.5.1352  (Read 9546 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Custom Script fragments not working in 13.5.1352
« on: March 27, 2018, 03:07:36 am »
Hi all,


We recently upgraded from 11.1 to 13.5.

I have a document generation script which worked fine for three years before the upgrade, and now doesn't.

In the project (SQL Server repository), there is a simple project browser script that calls the main document generation script which resides in an MDG Technology. The generation script makes a number of calls to DocumentGenerator.DocumentElement(), specifying various elements and a few dozen different templates. The templates reside in the same MDG Technology.

Some templates include fragments. Custom SQL fragments work as expected every time. Custom Script fragments, however, do not.
(Note: these are the only two types of fragment I'm using. There are no Template Selector fragments or Document Script fragments. If you are unaware of the difference between these, please refrain from posting "helpful" suggestions.)

The first time I run the document generation script, all custom script fragments produce the desired result.
On subsequent runs, the custom script fragments produce nothing.
After a restart of the client, the document generation again works once, then I have to restart again, etc.

When testing, I am changing nothing between runs. The behaviour is consistent: all custom script fragments fail after the first run, none of them fail on the first run, and custom SQL fragments never fail.

If I select the same element in the project browser and hit F8 to invoke the regular document generator, and specify the "parent" template which contains the references to the fragments, this partial generation works every time. But it does not clear the error: when going through the document generation script, custom script fragments fail consistently every time after the very first.

I have tried regenerating the MDG Technology: no effect.

What the hell is going on?


/Uffe
My theories are always correct, just apply them to the right reality.

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Custom Script fragments not working in 13.5.1352
« Reply #1 on: March 27, 2018, 08:40:32 am »
In one version of EA (not sure which), i've noticed that my scripts that are part of my MDG were not picked up in the script fragment, I have to recreate that script locally (or import as reference data again) to allow the script fragment to pick that.

Not sure if this is the case , but it may be worth to try and see if the custom script is picked up in the fragment

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #2 on: March 27, 2018, 07:42:11 pm »
EA does tend to get confused when working with Custom Script template fragments in MDG Technology development, but the problem here isn't that the scripts have been dropped from the template fragments. If that were the case, the generation would fail every time when run from the script, and also when run from the dialog. Here it works every time when run from the dialog, but only the first time when run from the script.

The MDG Technology file generated by 11.1 performed correctly in 11.1, but fails in 13.5.
I've tried regenerating the MDG Technology file in 13.5, and it also fails.

I suspect that something gets cached incorrectly.

/Uffe
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #3 on: March 27, 2018, 10:04:34 pm »
I've pared this down to a minimal set of templates and scripts, and can confirm that EA does indeed not work properly.

Reported.

/Uffe
My theories are always correct, just apply them to the right reality.

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Custom Script fragments not working in 13.5.1352
« Reply #4 on: March 28, 2018, 09:01:12 am »
Thanks for the note. (saves me from repeating similar efforts)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #5 on: March 29, 2018, 01:50:00 am »
This is in fact an old bug which I first reported back in May 2013. Slight difference in that back then 'custom script' fragments never worked when invoked through the API, and this time around they do work once per session.
It was fixed and worked in 11.1, but somewhere along the line it reared its zombie head again. Well, it's Easter after all.

The issue number was 13055290.

/U
My theories are always correct, just apply them to the right reality.

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Custom Script fragments not working in 13.5.1352
« Reply #6 on: March 29, 2018, 08:12:02 am »
Thanks for the note. I've always retorted to quick fixes (like copying locally, etc) when things doesn't happen my way. This information is useful :)

Nizam

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #7 on: March 29, 2018, 10:53:23 am »
This is in fact an old bug which I first reported back in May 2013. Slight difference in that back then 'custom script' fragments never worked when invoked through the API, and this time around they do work once per session.
It was fixed and worked in 11.1, but somewhere along the line it reared its zombie head again. Well, it's Easter after all.

The issue number was 13055290.

/U
Don't forget that (in at least English speaking countries) this year Easter Sunday is ALSO "April Fool's Day".  ;D

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #8 on: April 19, 2018, 07:00:23 pm »
Issue confirmed (again), new number 18038572.

/U
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #9 on: April 19, 2018, 07:04:58 pm »
... which would seem to indicate that in the last five years there have been 4,983,282 issues.

That's got to be more than 10 per SLOC. Impressive in its own way. ;D
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #10 on: April 19, 2018, 07:37:06 pm »
Funny. Just five minutes ago I also wondered about the difference in the bug number.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #11 on: April 20, 2018, 08:33:56 am »
There haven't been 4,983,282 issues reported...

May 2013 - 2013/05 - 13055290
March 2018 - 2018/03 - 18038572

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Custom Script fragments not working in 13.5.1352
« Reply #12 on: April 20, 2018, 04:08:23 pm »
Aww.... Killjoy.  :'(
My theories are always correct, just apply them to the right reality.