Promoted Events (OpenInsight Specific)
At 02 MAR 1999 05:22:34PM Brian Wick wrote:
Not having success with promoted events. Do I use copy entity ?
I have tried to use the editor as well. In the editor do I use the SYSREPOSEVENTEXES or SYSREPOSEVENTS or both ?
Example: Am I copying UT1*CREATE*UT1_PROCESS. to UT1*CREATE. Am I copying @UT1*CREATE*UT1_PROCESS to @UT1*CREATE
Do I need the second asterisk ('*') ?
Do I need to include to period ('.') ?
Is there a particular time I need to resync the database ?
Any suggestions are welcome. …tx Brian
At 02 MAR 1999 11:46PM Don Bakke wrote:
Brian,
My best single suggestion is for you to read up on the best source I know of for understanding promoted events: Sprezzatura's Electronic Newsletter. I don't remember which specific issue has the article but it's worth the effort to find it. Their website is www.sprezzatura.com.
Outside of that, here are some basics you should check out:
1. First confirm that the event has been "enforced". This is done by running the EVENTDESIGNER window. You can launch this from the Application Manager outliner. Every event that needs to be promoted should have the enforced flag set to "Yes".
2. After this, exit OI and go back in. OI checks to see which events are enforced only during start up.
3. Create your promoted event in the System Editor just like a regular function. It doesn't technically matter what you name this function since you will copy it (and rename it) to the SYSREPOSEVENTEXES table. The important issue is that you have the same number of parameters as the actual event you are promoting. That being said, we do name our functions similar to the way it will be renamed in SYSREPOSEVENTEXES to make it easier to know what this function was meant for.
4. Learn the correct event naming convention for the event you are promoting and the level you are promoting it to. This can be confusing so it is always helpful to have some working examples and just refer to them. Here are a few to give you a head start -
/* This promoted event is triggered before the form performs its own CLEAR event */
MYAPP*CLEAR.WINDOW.OIWIN*
/* This promoted event is triggered after the form performs its own CLEAR event */
MYAPP*CLEAR..OIWIN*
/* This promoted event is triggered after the control performs its own LOSTFOCUS event */
MYAPP*LOSTFOCUS..OIWIN*
/* This promoted event is triggered after the control performs its own GOTFOCUS event */
MYAPP*GOTFOCUS..OIWIN*
5. In our functions we also store the exact COPY_ROW command that needs to be entered in the System Editor's Exec line to copy the function's object code into the SYSREPOSEVENTEXES table so we don't have to keep guessing. We just simply copy and paste. Here is an example based on the first event listed above -
RUN COPY_ROW "SYSOBJ", "$MYAPP_CLOSE_WINDOW_OIWIN*MYAPP", "SYSREPOSEVENTEXES", "MYAPP*CLOSE.WINDOW.OIWIN*", "2"
6. Finally, all old windows need to be recompiled in order for the promoted event to be referenced. All new windows will automatically reference existing promoted events.
7. Changing a promoted event doesn't require a recompile of your windows, but it does require that you re-run the COPY_ROW command.
Hope this helps you.
dbakke@srpcs.com