Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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

0 votes



One answer

Permanent link
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

0 votes

Comments

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.

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

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

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 log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 457

Question asked: Jun 19 '15, 12:31 p.m.

Question was seen: 2,712 times

Last updated: Jun 24 '15, 2:11 a.m.

Confirmation Cancel Confirm