This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: Hello i want to display a message dialog
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
09:11 AM
Hello i want to display a message dialog
Hello,
I have a requirement in which i need to check the database which user is using and check if database contains the required databases and i want to display this panel when i am using typical install.
So this is what i did:
I added a panel in the pre install task saying" DB configuration is done properly"
to which i added a custom rule (my own for connecting to database and checking if it contains the required databases) and i again added one more rule
by "AND" operator in the rule list.
Basically i want to display the panel only when both my customrule is true and chosen_install_set is typical .Similarily if the database does not contain the required databases , i am displaying a panel which says "Database is not configured properly" when the chosen_install_set is typical and my custom rule for database improper is true.
To my surprise even when i am inputting correct information it is showing the
DB wrong configured panel.
Can anyone tell me why?
I have a requirement in which i need to check the database which user is using and check if database contains the required databases and i want to display this panel when i am using typical install.
So this is what i did:
I added a panel in the pre install task saying" DB configuration is done properly"
to which i added a custom rule (my own for connecting to database and checking if it contains the required databases) and i again added one more rule
by "AND" operator in the rule list.
Basically i want to display the panel only when both my customrule is true and chosen_install_set is typical .Similarily if the database does not contain the required databases , i am displaying a panel which says "Database is not configured properly" when the chosen_install_set is typical and my custom rule for database improper is true.
To my surprise even when i am inputting correct information it is showing the
DB wrong configured panel.
Can anyone tell me why?
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
09:33 AM
I would say your rules are not correct. Since it sounds like the the "bad" panel is being displayed, your rule to for chosen_install_set=typical is working fine. (Unless these panels are being displayed if you are not choosing typical).
Then I would double check your custom rule to make sure it returns true when you want it to.
Otherwise, I suggest posting your project so it is easier for others to help.
Then I would double check your custom rule to make sure it returns true when you want it to.
Otherwise, I suggest posting your project so it is easier for others to help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
10:28 AM
Ok. I have a couple of suggestions.
1. Only write this rule once and set an IA variable if it is true/false instead of writing a "True" one and a "False" one. This will avoid duplication of custom code.
2. When you call ruleProxy.setVariable(), don't put the variable name inside the $$.
3. In your CustomRuleFalse code, do this..
4. In your CustomRuleFalse, you have some System.out.println statements with ruleProxy.substitute("$USER_INPUT_RESULT_1"). Make sure you have $ on BOTH sides of the variable name. $USER_INPUT_RESULT_1$
5. Use the debug output to your console. You should see your System.out.println() statements being output. This will help debugging and finding out your problems.
6. Use pV7721's suggestion of using better named variables instead of USER_INPUT_RESULT_x. It will be much, much easier to maintain your code.
7. Also, post your project (iap_xml) file (zipped from what I've read here). If you are not allowed to post your project, post a sample project that only does what you are posting about. You may find that when creating that sample project, you will find your mistakes.
1. Only write this rule once and set an IA variable if it is true/false instead of writing a "True" one and a "False" one. This will avoid duplication of custom code.
2. When you call ruleProxy.setVariable(), don't put the variable name inside the $$.
Bad: ruleProxy.setVariable("$SOME_VAR$", "value");
Good: ruleProxy.setVariable("SOME_VAR", "value");
3. In your CustomRuleFalse code, do this..
String emptyString = ruleProxy.substitute("$NULL$");
ruleProxy.setVariable("USER_INPUT_RESULT_0", emptyString);
4. In your CustomRuleFalse, you have some System.out.println statements with ruleProxy.substitute("$USER_INPUT_RESULT_1"). Make sure you have $ on BOTH sides of the variable name. $USER_INPUT_RESULT_1$
5. Use the debug output to your console. You should see your System.out.println() statements being output. This will help debugging and finding out your problems.
6. Use pV7721's suggestion of using better named variables instead of USER_INPUT_RESULT_x. It will be much, much easier to maintain your code.
7. Also, post your project (iap_xml) file (zipped from what I've read here). If you are not allowed to post your project, post a sample project that only does what you are posting about. You may find that when creating that sample project, you will find your mistakes.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
01:49 PM
purcellk24 wrote:
2. When you call ruleProxy.setVariable(), don't put the variable name inside the $$.Bad: ruleProxy.setVariable("$SOME_VAR$", "value");
Good: ruleProxy.setVariable("SOME_VAR", "value");
The bad code is working isn't it?
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
02:02 PM
Well, I have never had good luck with setVariable("$VAR_NAME$", value); so I make it a practice to make sure there are no $$ in the set Variable. Even in the ide. If it does work, then ignore what I said.
Some of the actual bad code in the example posted here have setVariable("$VAR_NAME", value) and is missing the second $. That is bad.
Some of the actual bad code in the example posted here have setVariable("$VAR_NAME", value) and is missing the second $. That is bad.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
05:26 PM
Yes they work. I normally use a Constants interface where I set static final variables and explain their usage and as I use them for retrieval and setting i need to have the $$.
Best Regards,
Yves
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
11:55 PM
hello,
as it has been said to me instead of duplicating the custom rule action once for true result and once again for the false result,i got to know that i can set some installanywhere variable accordindly for true result and for false result in the same install anywhere action.
But as far as i know an action with a custom rule will evaluate only if the evaluate() method returns true.
So in the try block what shall i set and catch block what shall i set,it would be a pleasure if you can give some suggestions.
James Decosta
as it has been said to me instead of duplicating the custom rule action once for true result and once again for the false result,i got to know that i can set some installanywhere variable accordindly for true result and for false result in the same install anywhere action.
But as far as i know an action with a custom rule will evaluate only if the evaluate() method returns true.
So in the try block what shall i set and catch block what shall i set,it would be a pleasure if you can give some suggestions.
James Decosta
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)