Globals when generating a main program from an adapter

A program I am working on requires Global to be added to it to draw system information when progressing through.

Is there an easy way to incorporate this into the code generation…regenerate process?

Currently, I am editing directly after the define data in the “text editor” and inserting my Global, but when I regenerate again I lose this added Global.

ie
DEFINE DATA
GLOBAL USING ITGDA WITH SYSTEM.USER
LOCAL
/* PARAMETERS from parsed adapter
1 #ERROR-MSG (A) DYNAMIC
1 #SEARCHREQUEST

On regenerate
DEFINE DATA LOCAL
/* PARAMETERS from parsed adapter
1 #ERROR-MSG (A) DYNAMIC

Not that I’m aware of, but imho regenerating over and over again every time the adapter changes isn’t practical anyway,
the program evolves and grows so it’s by far easier to just add the changed parameters / events manually, or C&P them.

Thanks, I understand, but as we are testing our own controls with each release, make it a little more difficult not to regenerate.

I’ll continue to populate by copying and pasting (though using the text editor is probably not the best way to work with this, switching between source).

I thought there may have been a way to edit the construct runtime to add a ‘define exit’ directly after the define data (and change the local to after this exit). The exit point would also suffice as another place to add extra comments detailing the passed adapter parameters for future programmers.

Cheers

Nothing to do with Construct, I’m afraid :wink:

This is done via the NJX “plugin”, and there’s no exit to do this, but you might want to consider requesting an enhancement.

Thr plugin architecture is open, defined, documented, so if you have recurring tasks like this you may also want to consider writing your own small plugin to do it

Cheers

   Wolfgang

One of my Work Colleagues helped to rectify this,

http://techcommunity.softwareag.com/ecosystem/documentation/naturalONE/natONE826/cgen/n1codegeneration/set-preferences-for-code-generation.htm#code-generation-preferences

Working perfectly now.

Cheers

I don’t really want to re open a thread… but after upgrading to 9.5 the fix we employed is no longer working (using a predefined custom template)

I have enabled custom templates and ensured the path is correct … but it is not using it.

Also!

Is there a way to ensure that nat:browser.end is bundled next to nat:page.end?

ie. What it is now

DECIDE ON FIRST *PAGE-EVENT
/* Values from Event handler section
  VALUE U'nat:page.end'
**SAG DEFINE EXIT EVENT-nat:page.end
    TERMINATE
    /* zzzzz This should be in the adapter generation, why not?
  VALUE  U'nat:broswer.end'
    TERMINATE
**SAG END-EXIT

What I would like the regenerate / generate Ajax main program to do

DECIDE ON FIRST *PAGE-EVENT
/* Values from Event handler section
  VALUE U'nat:page.end', U'nat:broswer.end'
**SAG DEFINE EXIT EVENT-nat:page.end, nat:broswer.end
    TERMINATE
**SAG END-EXIT