Detect Schema Changes

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
qwright
Posts: 6
Joined: Mon Nov 30, 2015 3:50 pm

Detect Schema Changes

Post by qwright » Fri Sep 08, 2017 12:53 pm

Hi!

I was wondering if there was a way that we could manually detect in code that there is a new version of the current LongRange schema and the schema needs refreshed? Alternatively, is there some way we could set up our schemas to force the clients to automatically refresh when changes are detected?

I know that LongRange occasionally detects this behind the scenes and prompts the user to refresh the schema but we have several users in our facility that do not allow the refresh to happen. This causes issues when we decide to replace an old program with a brand new program and the user refuses to refresh the schema to force them to be up to date with current processes.

Code: Select all

* If the schema needs refreshed, force the refresh
If (#COM_OWNER.?????)
  #COM_OWNER.Set_OP_ClientCommand Clientcmd('REFRESHSCHEMA') Event('/FORM.ONLOAD')
Endif
I recently stumbled across the code to force a schema refresh but we don't necessarily want to do this all of the time. It would be nice if we could just automatically detect that there was a change and force the refresh if the user did not opt to do so when they first loaded LongRange. We're looking to remove the option to skip the refresh from our end users.

Thanks!

tsupartono
Posts: 283
Joined: Tue Apr 17, 2012 7:21 pm

Re: Detect Schema Changes

Post by tsupartono » Sun Sep 10, 2017 2:46 am

The schema upgrade process requires that all forms be closed and open 5250 sessions terminated, so instead of doing the upgrade automatically, we give the user an option to do the upgrade at a convenient time (e.g. we don't want to close user's forms when they are in the process of filling them out).
To cater for your situation, we can enhance LongRange with an option to force schema upgrade after xx minutes (e.g. 5 minutes) of the end-user
receiving a warning. This will give them time to complete what they are doing, but does not give them the choice to indefinitely delay the upgrade.
Does that sound good to you?
If so, please contact LANSA Support to open an enhancement request.

qwright
Posts: 6
Joined: Mon Nov 30, 2015 3:50 pm

Re: Detect Schema Changes

Post by qwright » Thu Sep 14, 2017 12:01 pm

I'm not sure that my intent is quite clear here, so let me try again...

We typically do our schema updates during off hours when no one should be in the system, so closing users out of a form shouldn't be a huge issue to us. Our system includes log-in functionality that checks for a valid log in every time a LongRange program is run, so this would be an ideal time to perform a forced schema refresh.

Why?

More often than I would like to admit, a user will start up their LongRange device, open LongRange, receive the schema change notification, opt NOT to refresh the schema at that time (even though they really should), and proceed to whatever program they need to use (which first calls our log-in application and requires that they log in before they can do anything).

At the time the log-in application is called, I would like to detect if the schema is up to date before the user has had the opportunity to do anything (hopefully using the same logic that caused the prompt to appear just moments before). If the user did not refresh the schema when prompted, our log-in application would detect that and force the refresh right then and there. Otherwise, if they actually DID opt to refresh the schema previously, we won't force them to do it again for no reason.

Is there a way that we can manually detect if a schema needs updated? It seems like since there is already a possibly way to force a schema update in LongRange code, we should probably have the ability to DETECT if a refresh is even NEEDED before we force them to refresh. Is that possible?

Thanks!

tsupartono
Posts: 283
Joined: Tue Apr 17, 2012 7:21 pm

Re: Detect Schema Changes

Post by tsupartono » Thu Sep 14, 2017 4:43 pm

What about a flag (that your RDML code can set) that indicates that the user can't skip an update.

The idea is to set this flag on your login screen only - but off on any other screens.

So the flow would be like this:
LR checks if there is a newer version of the schema (this will be done automatically without you having to explicitly request for this).
If there is no newer version on the server, nothing happens.
If there is a newer version, LR checks the flag - if it's set, then the user is forced to update the schema.
Since on your login screen, the flag is set, the user will be forced to update the schema if there is a newer version (a dialog box will appear letting the user know that the application is about to update).

Let us know what you think.

qwright
Posts: 6
Joined: Mon Nov 30, 2015 3:50 pm

Re: Detect Schema Changes

Post by qwright » Thu Oct 05, 2017 9:54 am

Sorry for my delayed response! This month has been a bit crazy.

That sounds like it would take what I'm looking to do and move it all to the back end... Kind of like setting the IsNewForm flag in a LongRange program and having it automatically clear everything rather than manually removing all visual objects and resetting values. The only possible downside that I can think of is that it removes any potential ability to perform any other logic or add any custom messages before refreshing the schema. (I'm not sure that would even work anyway.)

I think you're proposing a reasonable solution. It's not quite as visible and flexible as I typically prefer in a development environment but it does sound like it would get the job done!

Thanks!

tsupartono
Posts: 283
Joined: Tue Apr 17, 2012 7:21 pm

Re: Detect Schema Changes

Post by tsupartono » Sun Oct 08, 2017 6:13 pm

This feature is currently being implemented.
LANSA Support will be in contact with you to arrange testing before the features get officially included in LongRange.

Post Reply