It's all about the answers!

Ask a question

How do I use a Java-defined "condition" attribute customization?


Eric Salberta (133) | asked Jun 19 '15, 12:31 p.m.
With some help from this forum and IBM Tech support, I am now able to define a couple of "conditions" in a Java Plug-in project, export them, move the "update site" to the server, and get them to install.  The server log shows that the extension is being installed, resolved, and started.

However, I can't seem to use the resulting conditions.  I am trying to follow the example in this article to create a "Read-Only Attribute for Condition" precondition and set it to use my newly imported condition.  However, the article only shows how to do so for a Javascript condition.  I need the equivalent procedure for a Java condition, but I have not been able to find that information.  How does one use a Java extension "condition" as the condition for this type of precondition?  A "script-based condition" prompts you to enter Javascript, and there is no obvious way to choose any other type.

If it matters, this is using version 4.0.3 RTC server over Tomcat.

Thanks for any light that anyone can shed,
Eric Salberta

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Jun 19 '15, 6:27 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Plase see https://rsjazz.wordpress.com/2015/06/19/a-custom-condition-to-make-attributes-required-or-read-only-by-role/ and https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ for a bit more information.

If you don't see your extension you
  1. Failed with deplyment e.g. wrong identifiers
  2. Did not deploy on server and client

Comments
Eric Salberta commented Jun 19 '15, 9:16 p.m.

Ralph Schoon:  Thank you very much for this answer.  It may be just what I needed, and in any case the first document that you cite is a blessing from heaven.  I will test it this weekend, and if it works, we will count this one closed.  Thanks.


Ralph Schoon commented Jun 22 '15, 11:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Welcome. Just accept the answer if you got it working, please.


Eric Salberta commented Jun 23 '15, 4:06 p.m.

Ralph Schoon:

I am not able to download the sample code due to Dropbox being disfavored at my workplace for security reasons.  However, by following the text, I am able to "hand-roll" the first 3 projects: the "condition" project itself, the "feature" project, and the "update-site" project, and build them.  I am able to place the resulting "update-site" on the server in the "sites" folder, create an "IfOwner_updateSite.ini" file for the "provision_profiles" area, tell the server to reload, and reload the server.  The "Provision Status" pane on the "admin?internal=true" page indicates that my bundle is being installed, resolved, and started.

    Unfortunately, the "Component Status" pane does not show any sign of my conditions.  I'm assuming that something in that fourth project ("com.ibm....providers.serverdeploy") is missing from what I am doing.  Is there a way that I can "hand-roll" one of those for my "condition" project?

Thanks very much,
Eric


Ralph Schoon commented Jun 24 '15, 2:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I am sorry, but I would suggest to
1. Follow the links in the post and set up your development environment with Jetty and do the Extensions Workshop to understand how to debug this
2. Download the code from a different site and e-mail it to yourself

There are so many things that can go wrong - beginning with the Java Version that is reqired, typos etc. that can go wrong. There is no way to debug this in a forum.

The serverdeploy project is most likely not the reason for the problem. It is not even needed, it is just a vessel to make preparing for deploying the extension more mechanical and remove sources of errors due to typos or other issues.

Your answer


Register or to post your answer.