Why getAvailabelActions() not returning any actions??
Hi,
We have RAM 7.2, have RTC life cycle set up for the new submitted assets. We need to change or move the asset state from its current state to the next state programmatically or using RAM api; but when we used getAvailabelActions() for the asset, the method return no actions, any idea? 2 more facts: 1) I am set to be the collaborators and also the LifeCycle Managers, also the owner of the asset 2) The asset does indeed has two more "next state" option on the web client, I see the 2 actions options and I am also able to change state of this asset thru the web client. Or may be getAvailabelActions() was not the right method to call to change state? If so please advice. JR |
12 answers
Hello,
Can you please specify the exact version of your server (7.2.0.0, 7.2.0.1, 7.2.0.2) and client? Regards, Srimanth Hi, |
Hi,
We have V7.2.0.1 Build: RAM720-N20091211_2001. I am not sure what you meant by "client"? I simply used the client library I download from the same RAM server. Hello, Hi, |
One way there might not be any actions is if the data is not coming from the server. Can you please try to view the data using a browser by formatting this link and see what response you get.
http:///ram.ws/internal/assets///availableActions and see if you get any data back. Replace , , for your server. You should also hit a authentication dialog. |
Yes, it did return 2 actions.
I am surprise you asked me to do this, didn't you read my fact 2 in my first post? I already stated that I did see 2 actions thru the web client hence could you please tell me what is the different between the url you wanted to try and what I am seeing thru the web client? Please do response soon... this is rather urgent One way there might not be any actions is if the data is not coming from the server. Can you please try to view the data using a browser by formatting this link and see what response you get. |
srimanthwrote: He didn't ask you to go to the web client. He asked you to use the given URL. This URL is not to the web client. This is an internal URL used by the java RAM client. -- Rich Kulp Rational Asset Manager developer |
Rick,
No, I didn't say he asked me to go to the web client, I said on web client I did see 2 actions with the intention to ensure RAM team that there indeed actions hence not something I made out. Okay now that you have clarified his/your intention and I already gave you the result, can you pleas tell me what's next? Anything else you need from me to try or provide? JR srimanthwrote: He didn't ask you to go to the web client. He asked you to use the given URL. This URL is not to the web client. This is an internal URL used by the java RAM client. -- Rich Kulp Rational Asset Manager developer |
I am unable to reproduce this problem locally with a user who is either an owner/lifecycle manager/collaborator on RAM 7.2.0.1.
RAMAsset.getAvailableActions() in 7.2.0.1 gets the data from http:///ram.ws/internal/assets///availableActions.xml and deserializes it into Java - there is no other magic. Any java.lang.Exception is thrown as a RAMRuntimeException. The fact that you dont see any exceptions is whats confusing. Please correct me if I have gotten any facts wrong... you are on RAM 7.2.0.1 and when you visit http:///ram.ws/internal/assets///availableActions and http:///ram.ws/internal/assets///availableActions.xml you get the states as a feed when you login as the user who failed on the client. To dig a little deeper it would be helpful if we could either access your server, or maybe we could give you a JAR with more logging enabled to see whats going on. Please let me know which is a convenient option for you. Regards, Srimanth |
The answers to your questions are yes, yes. Not sure what you meant by
"failed on the client", it only "failed" to return any actions. Okay, I added you as the consumer, producer reviewer in one of our testing community. The workflow that I used is Migrated workflow that came with RAM installation. If you need to create a new asset the please use "Test Workflow type" type in the "Testing Community" community. The asset id of the particular asset that I have been testing is {2A530F28-5CFF-BAD3-D432-0A97ED10240C} (1.0 version). I will send you our server name thru email I am unable to reproduce this problem locally with a user who is either an owner/lifecycle manager/collaborator on RAM 7.2.0.1. |
Thank you for the information. I targetted the given server using the client provided on the extensions page, and it worked. I got the two actions via RAMAsset.getAvailableActions(). My code is below which printed both states.
It might be something to do with your user or environment. Please ping me via chat when online and I can see whats going on. RAMSession session = new RAMSession("http://server:9080/ram.ws", "user", "password"); |
Update: After debugging on the system it turns out that the XML>Java deserializer is unable to initialize properly and does throw an exception which is logged using Log4J - except Log4J is not setup to dump to sysout/syserr. Hence the silent failure.
The exception is : javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:151) at javax.xml.bind.ContextFinder.find(ContextFinder.java:299) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) at com.ibm.ram.internal.jaxb.util.JAXButil.getJAXBContext(JAXButil.java:97) at com.ibm.ram.internal.jaxb.util.JAXButil.getXMLunMarshaller(JAXButil.java:88) at com.ibm.ram.internal.client.RESTCacheManager.primGetResourceObject(RESTCacheManager.java:349) at com.ibm.ram.internal.client.RESTCacheManager.getResource(RESTCacheManager.java:140) at com.ibm.ram.internal.client.RESTCacheManager.getResource(RESTCacheManager.java:124) at com.ibm.ram.internal.client.RestClientService.doGet(RestClientService.java:55) at com.ibm.ram.internal.client.RESTClient.getUser(RESTClient.java:106) at com.ibm.ram.internal.client.RESTClient.<init>(RESTClient.java:76) at com.ibm.ram.internal.client.RAMClient.getRestClient(RAMClient.java:526) at com.ibm.ram.client.RAMSession.getRESTClient(RAMSession.java:4964) at com.ibm.ram.client.RAMAsset.getLifecycle(RAMAsset.java:346) at com.ibm.ram.client.RAMAsset.isInLifecycle(RAMAsset.java:361) at com.ibm.ram.client.RAMAsset.getState(RAMAsset.java:3677) at SimpleTest.main(SimpleTest.java:36) Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:639) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:605) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:116) ... 17 more |
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.