It's all about the answers!

Ask a question

Identify a project area, which allows the sharing of its process

Emiliano Iannetti (388) | asked Sep 22 '21, 11:38 a.m.
edited Sep 22 '21, 11:43 a.m.

Hi everyone, we are moving forward with the workings of the Bees on RTC and we are at an excellent point, but I cannot understand one thing, how to recognize if a projecArea, allows the sharing of its process or not. This information is very useful for us and we would like to represent it, but I am faced with two obstacles:

1) Using this method given here, unfortunately I can't get a boolean as a result and therefore can't work with it
public static boolean isProcessProvider (IProjectArea projectArea) {
return ((ProjectAreaImpl) projectArea) .isProcessProvider ();

This method I got it from here:
Another method of the same class was very useful for "allowing" sharing, but with this I can't "find" it.

2) By printing the representation of a projectArea I get this string, but I'm not like "getting" to get the value of the "internalIsProcessProvider" attribute which is true if it allows sharing and false if it does not:
Proxy of (stateId: [UUID _in0Y4g8qEeyCRKscF3z5hQ], itemId: [UUID _THXiUEUBEternaleu1e7ykQkentitory.Reamteamm: com. 43cbafa6, immutable: true) (contextId: [UUID _THXiUEUBEeu1e7ykQkgefA], modified: 2021-09-06 17: 53: 12.814, workingCopy: <unset>) (mergePredecessor: null, workingCopyPredecessor: <unset>, workingCopy: <MergePredecessor> predecessor: [UUID _gzX_wg8qEeyCRKscF3z5hQ]) (descSummary:, archived: false, name: Waterfall Principal, uniqueName: Waterfall Principal (JTS-Sentinel-Id)) (isInitialized: true, internalPublic: false, internalVisibleToMemberslication: true, internalVis : JTS-Sentinel-Id, internalIsProcessProvider: true, internalRemoteProcessProviderUrl:)
Do you have any idea about it? Thanks a lot to everyone in advance.

Accepted answer

permanent link
Ralph Schoon (62.7k33643) | answered Sep 23 '21, 9:37 a.m.

I have used a RTC 6.0.5 Eclipse Client Workspace configured for debugging the RTC SDK and Plain Java. 

The workspace has been set up by following the RTC Extensions Workshop Lab 1 - the whole lab including the new section in the latest version. In reality it is only necessary to configure the Plain Java Client Libraries as external library with the name PlainJavaApi.

I downloaded the code from . I imported the zip file as existing project into the Eclipse workspace. No errors. Compiles like a charm.

I setup test project areas and ran the application myadmin myadmin ShareProcess InheritProcess

The application succeeds showing:

I am sure I can also debug it and the method returns a boolean.

The code you have up there is modified, casts to the wrong class and I have already mentioned that. Read my suggestion, or do the Extensions Workshop lab 1 and do what I did. 

I leave it to you to identify the differences between your code and the code that is downloadable from the blog post. From my perspective the code example works perfectly and does not need any modifications. This was with RTC 6.0.5 (against a 7.0.2 server) but I am pretty sure that it works with 7.0.x Plain Java as well. I am however not willing to spend the time.

Ralph Schoon selected this answer as the correct answer

Ralph Schoon commented Sep 23 '21, 9:40 a.m. | edited Sep 23 '21, 9:40 a.m.

The code download link in the blog is in case you rushed over the blog and missed it. 

Emiliano Iannetti commented Sep 23 '21, 11:41 a.m.

I apologize immensely :'(

I had not noticed this morning, when I took the source of the class I can swear to you, that there was a cast at ProjectAreaImpl, for that I did not return, this morning when I read your answer I did not notice the difference. Now that you pointed this out to me, I managed to get everything running perfectly and I got the result I wanted. Thanks a lot again for everything. However God forbid I asked you to debug, at most I'll take care of that :D

and as version we are using 6.0.5 . 

Ralph Schoon commented Sep 24 '21, 2:20 a.m.

As a minimum, you could at least accept my answer. You didn't, but I can bring this to a conclusion myself. 

One other answer

permanent link
Ralph Schoon (62.7k33643) | answered Sep 23 '21, 3:34 a.m.
edited Sep 23 '21, 3:36 a.m.

 For all I can tell, the code can be downloaded a link is in the blog post. And the code in the ProcessProviderUtil looks like this:

     * Test if the projectArea Provides its process
     * @param projectArea
     *            Determines whether other project areas can get their process
     *            from this project area.
     * @return true if this project area allows other project areas
     *         to use its process, false if not.
    public static boolean isProcessProvider(IProjectArea projectArea) {
        return ((ProjectArea) projectArea).isProcessProvider();
The cast is to ProjectArea ( import; ) which is an internal API. Apparently that is the class that has the required method. 

Ralph Schoon commented Sep 23 '21, 3:38 a.m.

I would suggest you follow the suggestion in the article and follow Perform the RTC Extensions workshop at least Lab 1 to get a working environment that allows to see the SDK code for the PlainJava Client Libraries. 

Ralph Schoon commented Sep 23 '21, 3:41 a.m.

PS: I do not know why you use the API for this. You can just look into the project area administration. What is the purpose of using the Java API. Some kind of automation? 

Emiliano Iannetti commented Sep 23 '21, 8:54 a.m.
Hi Ralph, thanks for the quick reply. So yes, the class I use is that but the method doesn't return a boolean as declared, so are you telling me it returns a project area? So is the "declared" return of the method wrong? And then it returns null if ProjectArea does not share the process and returns the same ProjectArea if it does share it?
I also tried to "enter" the method and actually it seems that it should return a boolen, but if I run the method I get a CastException error, I also tried to modify it, but nothing because it wants a boolean, only that while executing that method, I don't understand what comes back, so it always goes into castException.
As for the use, we are automating the creation of projectArea and we have succeeded almost in everything, we just have to "take" the information I am looking for to get a complete picture of the ProjectArea. In the meantime, thank you very much. 

Your answer

Register or to post your answer.