11g Updating instance variable

How do update instance variable at runtime. e.g say my workflow instance wating at 'InProcess' HumanTask with instance variable wrkStatus='IP'..now with out executing the HT how can we update the 'wrkStatus' variable to 'IR'....?
NOTE : in 10g we can do that using global interactive with instance access....but i have no idea abt 11g :(
Rgds,
Biltu

Thanks for your reply Mariano.
But that will be before the Token reaches to my Human task....we can do that..using association.....
But my doubt is different..lets assume i have moved to my human task ..now I need to update my instace data.
e,g I enter to HumanTask1 with a req msg
<UserReq>
<Name>nam1</name>
<address>addr1</address>
</UserReq>
now I want to update address by 'addr2'.

Similar Messages

  • Update Instance Variables using PAPI

    I have a need to update Instance Variables for a bunch of instances. Can this be done using PAPI? I am writing a global function that can search the instances and update. How can I update these variables...thank you

    Hi,
    I think that the best way of changing instance variables using papi is by adding a global activity (with instance access) and pass the new variable values as arguments. Pay attention that you have to define those arguments in the activity.
    Then, you can assign those values to the instance using PBL.
    http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/papi_javadocs/fuego/papi/ProcessServiceSession.html#activityExecute(fuego.papi.Activity,%20fuego.papi.InstanceInfo,%20fuego.papi.Arguments)
    I do suggest avoiding sending interruptions to instances, because once the notification is sent (and the papi method returns successfully), the notifications will be processed in another transaction.
    Hope this helps,
    Ariel A.

  • How to update the Process-Instance Variable Using Process API in OBPM 10.3?

    Hi All,
    I have a requirement to update the the process Instance variable from another process, but I am unable to find any method to update or set variable?
    I try the same using Process API also but no luck. Please provide me the code or link to implement same.
    Thanks & Regards,
    Ankur

    Hi,
    I have followed the procedure which was updated above.
    I ahve the sample to update the variable in the another instance of the another process. it's working fine. But I have followed the same procedure in our project it's giving the below exception at notification.send() method. Please help me to resolve this. thank you.
    fuego.transaction.DatabaseException: An error occurred while accesing the database.
    Detail:SQL statement: ' SELECT INSTANCEDATA, PROCESSID, INSTID, THREADID, NAME, PARENTTHREAD, PRIORITY, CREATIONTIME, AUTHOR, PARTICIPANT, NEXTPARTICIPANT, PROCESSDEADLINE, ACTIVITYDEADLINE, RECEIVETIME, ACTIVITYNAME, NTHREADS, CTHREADS, FCTHREAD, TOTALTHREADS, STATE, SOURCEACTIVITYNAME, ROLEIN, PENDINGITEMID, LASTRESULT, ITEMDEADLINE, NCHANGES , NREMARKS, NATTACHMENTS, HASPARTFORROLE,MICROACTIVITYNAME, V_REF_NO, V_TASK_ID, V_TASK_STATUS FROM PPROCINSTANCE WHERE PROCESSID = 63 AND INSTID = 1996 AND THREADID = 0 FOR UPDATE'
    at fuego.server.persistence.jdbc.JdbcProcessInstancePersMgr.load(JdbcProcessInstancePersMgr.java:1640)
    at fuego.server.persistence.Persistence.loadInstance(Persistence.java:827)
    at fuego.server.AbstractInstanceService.readInstance(AbstractInstanceService.java:764)
    at fuego.ejbengine.EJBInstanceService.getLockedROImpl(EJBInstanceService.java:218)
    at fuego.server.AbstractInstanceService.getLockedROImpl(AbstractInstanceService.java:879)
    at fuego.server.AbstractInstanceService.getLockedImpl(AbstractInstanceService.java:730)
    at fuego.server.AbstractInstanceService.getLockedWaiting(AbstractInstanceService.java:219)
    at fuego.server.AbstractInstanceService.getLockedWaiting(AbstractInstanceService.java:199)
    at fuego.server.execution.AbstractReceiveNotificationExecutionHandler.getLockedTargetInstance(AbstractReceiveNotificationExecutionHandler.java:223)
    at fuego.server.execution.AbstractReceiveNotificationExecutionHandler.receiveNotification(AbstractReceiveNotificationExecutionHandler.java:96)
    at fuego.server.AbstractProcessBean$41.execute(AbstractProcessBean.java:2776)
    at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
    at fuego.transaction.TransactionAction.startNestedTransaction(TransactionAction.java:527)
    at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:548)
    at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
    at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
    at fuego.server.execution.DefaultEngineExecution.executeWithoutComponentImmediate(DefaultEngineExecution.java:199)
    at fuego.server.execution.EngineExecution.executeWithoutComponentImmediate(EngineExecution.java:95)
    at fuego.server.AbstractProcessBean.receiveNotification(AbstractProcessBean.java:2757)
    at fuego.server.iec.LocalIPCHandler.sendNotification(LocalIPCHandler.java:79)
    at fuego.server.execution.microactivity.DefaultSendNotificationExecutionHandler.sendNotification(DefaultSendNotificationExecutionHandler.java:103)
    at fuego.server.NotificationComponent.sendNotification(NotificationComponent.java:95)
    at fuego.server.AbstractProcessBean$49.execute(AbstractProcessBean.java:3270)
    at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
    at fuego.transaction.TransactionAction.startNestedTransaction(TransactionAction.java:527)
    at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:548)
    at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
    at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
    at fuego.server.execution.EngineExecution.executeImmediate(EngineExecution.java:66)
    at fuego.server.AbstractProcessBean.sendComponentNotification(AbstractProcessBean.java:3266)
    at fuego.server.AbstractProcessBean.sendComponentNotification(AbstractProcessBean.java:3252)
    at fuego.components.Notification.send(Notification.java:148)
    at xobject.EPCS.PAction.collateTask(PAction.xcdl:34)
    at oracle.TRReview.Default_2_0.Instance.CIL_poReview(Instance.xcdl:25)
    at oracle.TRReview.Default_2_0.Instance.CIL_poReview(Instance.xcdl)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at fuego.server.execution.EngineExecutionContext.invokeMethodAsCil(EngineExecutionContext.java:1082)
    at fuego.server.execution.EngineExecutionContext.runCil(EngineExecutionContext.java:1277)
    at fuego.server.execution.TaskExecution.invoke(TaskExecution.java:401)
    at fuego.server.execution.InteractiveNormalCilExecution.invoke(InteractiveNormalCilExecution.java:425)
    at fuego.server.execution.TaskExecution.executeCIL(TaskExecution.java:513)
    at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:697)
    at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:657)
    at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:154)
    at fuego.server.execution.microactivity.InteractiveMicroActivity.executeNormalCil(InteractiveMicroActivity.java:501)
    at fuego.server.execution.microactivity.InteractiveMicroActivity.executeItem(InteractiveMicroActivity.java:454)
    at fuego.server.execution.microactivity.InteractiveMicroActivity.execute(InteractiveMicroActivity.java:104)
    at fuego.server.AbstractProcessBean$48.execute(AbstractProcessBean.java:3204)
    at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
    at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470)
    at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:551)
    at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
    at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
    at fuego.server.execution.EngineExecution.executeImmediate(EngineExecution.java:66)
    at fuego.server.AbstractProcessBean.runTask(AbstractProcessBean.java:3208)
    at fuego.ejbengine.EJBProcessControlAdapter.runTask(EJBProcessControlAdapter.java:1162)
    at fuego.ejbengine.EJBProcessControl_1zamnl_EOImpl.runTask(EJBProcessControl_1zamnl_EOImpl.java:4463)
    at fuego.ejbengine.EJBProcessControl_1zamnl_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-02049: timeout: distributed transaction waiting for lock
    at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
    at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
    at weblogic.jdbc.oracle.OracleImplStatement.execute(Unknown Source)
    at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
    at weblogic.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
    at weblogic.jdbcx.base.BasePreparedStatementWrapper.executeQuery(Unknown Source)
    at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:128)
    at fuego.jdbc.FaultTolerantPreparedStatement.executeQuery(FaultTolerantPreparedStatement.java:598)
    at fuego.server.persistence.jdbc.JdbcProcessInstancePersMgr.load(JdbcProcessInstancePersMgr.java:1627)
    ... 69 more
    BatchOperationException fuego.papi.exception.CannotStoreNotificationException: An instance in Process '/Division#Default-2.0' could not be notified.
    Regards,
    Sudhakar.

  • Binding a JavaFX variable to a Java class instance variable

    Hi,
    I am pretty new to JavaFX but have been developing in Java for many years. I am trying to develop a JavaFX webservice client. What I am doing is creating a basic scene that displays the data values that I am polling with a Java class that extends Thread. The Java class is reading temperature and voltage from a remote server and storing the response in an instance variable. I would like to bind a JavaFx variable to the Java class instance variable so that I can display the values whenever they change.
    var conn: WebserviceConnection; // Java class that extends Thread
    var response: WebserviceResponse;
    try {
    conn = new WebserviceConnection("some_url");
    conn.start();
    Thread.sleep(10000);
    } catch (e:Exception) {
    e.printStackTrace();
    def bindTemp = bind conn.getResponse().getTemperature();
    def bindVolt = bind conn.getResponse().getVoltage();
    The WebserviceConnection class is opening a socket connection and reading some data in a separate thread. A regular socket connection is used because the server is not using HTTP.
    When I run the application, the bindTemp and bindVolt are not updated whenever new data values are received.
    Am I missing something with how bind works? Can I do what I want to do with 'bind'. I basically want to run a separate thread to retrieve data and want my UI to be updated when the data changes.
    Is there a better way to do this than the way I am trying to do it?
    Thanks for any help in advance.
    -Richard

    Hi,
    If you don't want to constantly poll for value change, you can use the observer design pattern, but you need to modify the classes that serve the values to javafx.
    Heres a simple example:
    The Thread which updates a value in every second:
    // TimeServer.java
    public class TimeServer extends Thread {
        private boolean interrupted = false;
        public ValueObject valueObject = new ValueObject();
        @Override
        public void run() {
            while (!interrupted) {
                try {
                    valueObject.setValue(Long.toString(System.currentTimeMillis()));
                    sleep(1000);
                } catch (InterruptedException ex) {
                    interrupted = true;
    }The ValueObject class which contains the values we want to bind in javafx:
    // ValueObject.java
    import java.util.Observable;
    public class ValueObject extends Observable {
        private String value;
        public String getValue() {
            return this.value;
        public void setValue(String value) {
            this.value = value;
            fireNotify();
        private void fireNotify() {
            setChanged();
            notifyObservers();
    }We also need an adapter class in JFX so we can use bind:
    // ValueObjectAdapter.fx
    import java.util.Observer;
    import java.util.Observable;
    public class ValueObjectAdapter extends Observer {
        public-read var value : String;
        public var valueObject : ValueObject
            on replace { valueObject.addObserver(this)}
        override function update(observable: Observable, arg: Object) {
             // We need to run every code in the JFX EDT
             // do not change if the update method can be called outside the Event Dispatch Thread!
             FX.deferAction(
                 function(): Void {
                    value = valueObject.getValue();
    }And finally the main JFX code which displays the canging value:
    // Main.fx
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import javafx.scene.text.Font;
    import threadbindfx.TimeServer;
    var timeServer : TimeServer;
    var valueObjectAdapter : ValueObjectAdapter = new ValueObjectAdapter();
    timeServer = new TimeServer();
    valueObjectAdapter.valueObject = timeServer.valueObject;
    timeServer.start();
    Stage {
        title: "Time Application"
        width: 250
        height: 80
        scene: Scene {
            content: Text {
                font : Font {
                    size : 24
                x : 10, y : 30
                content: bind valueObjectAdapter.value;
    }This approach uses less cpu time than constant polling, and changes aren't dependent on the polling interval.
    However this cannot be applied to code which you cannot change obviously.
    I hope this helps.

  • Stateless Bean - scope of instance variable in EJB Timer call back function

    Hi,
    I would like to know on the scope of an instance variable of a Stateless Bean object,
    when used in a EJB Timer call back.Let me explain this in more detail below.
    I have a requirement to use a EJB Timer.
    For this, I have created a stateless object since Timer creation needs to be done
    from a stateless bean. I have a member variable "count" of the stateless bean class.
    In the timer call back(ejbTimeout), I am able to use this count variable during
    each time of the call back, and the value of this variable is also updated properly.
    I have a few queries with respect to the above behaviour:
    1) Does stateless bean object not get destroyed once the Timer is created from the Bean?
    2) If the Bean object is not destroyed, then when does the bean object get destroyed?
    3) If both (1) and (2) are not true, then can anyone explain on how the above behaviour is possible?
    Thanks in advance,
    Ulrich

    Hi Ulrich,
    The ejb timer is associated with the stateless session bean component, not with a particular bean instance. There is no formal relationship between the bean instance that called createTimer() and the bean instance on which the timer callback happens. If they're the same in your test run that's just a coincidence and not something your application should be depending on.
    In the stateless session bean model, the container can create and destroy stateless session bean instances at any time. The container is free to pick any stateless session bean instance to service any client invocation or timer callback. If you need to pass context into a timer callback, one way to do it is via the timer "info" object. However, the info object is immutable so it wouldn't be a good match for a counter. You could of course always just use a database for any necessary coordinated state.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Using instance variables

    Hi,
    I am currently evaluating this tool for a specific user group. I had a question in mind :
    In a typical workflow which involves database connections (i.e. inserting data in a database and displayign data) do you think we should pass data between various activities and users using instance variables or do you think we should retrieve data from the tables every time for display etc

    I would suggest get the data from the database first time and then store it in instance variables. Whenever, you need to update any values in the database from a particular activity, make a call to database to update it with the values from instance variables.
    For displaying, use instance variables. You do not need to get fresh data from database for each activity, unless you think that data in database keeps changing for that particular records every day.
    Regards
    Right Chord

  • Instance Variable size

    Hi
    I have a question regarding size of normal instance variable.
    It has been mentioned in the Studio 5.7 doc that the total size of all the instance variable for a project should not exceed 2Mb.
    Question is that if it exceeds more than 2Mb than what would be its effects. Is there any exception thrown if size exceeds above 2Mb.
    Also how can this be prevented as actual size can only be calculated at runtime.
    Thanks in advance.

    The instance size exceeding the setting you have inside your Engine will cause errors to start appearing in the log file. The effect is that your engine's performance will degrade. Once you start getting Error messages, they are usually sent via email to the admin you specify in the Engine's settings.
    A few ways to keep the size of the instance variables down is to:
    1) change the category of large instance variables to "Separated" from "Normal". This means that they are not stored as part of then instance's BLOB stored in the PPROCINSTANCE Engine database. They are then only read from the Engine's separated instance variable table when they are needed in the activity's logic or updated only when modified in the activity. Separated instance variables are not calculated as part of the overall size of the instance.. Large binary variables not marked as Separated will quickly run you over your instance size limit.
    2) Similarly, we sometimes treat the process instance variables as a database of record. Avoid this mentaility if possible. It's often better to have an external database to store information about things going on in the process. If you rely on the Engine tables for this for very large objects they are not easily retrieved by outside applicaitons because they are stored as a single BLOB. If outside applications access the Engine's database, it's another sure fire way to further degrade engine performance. Many times it' is better to store the id of a customer in the process and then to use that id to retrieve customer insformation from the cutomer's external database table. Once an instance has reached the End activity in a process, it sits there the number of days you specified in an Engine setting. Once it exceeds this number of days in the End activity, the instance data information is either purged or moved to the archive database. Don't make this number of days in the End activity too long (default is 15) as this will increase the sized of the number of rows on the table and degrade performance.
    Hope this helps,
    Dan

  • Jdev11 complains about public instance variables, but not Jdev10

    Hi all, if I fire up Jdeveloper10 I can declare a public instance variable. (OK, stylistically maybe not a good thing, but nothing in the java 'rules' that says I shouldn't be able to do this.) However in Jdeveloper11 it complains, it underlines it in red and grumbles "should not have greater than protected access."
    Anyone know where to turn off this compiler hint?
    thanks.
    public class Thing() {
    public String bob; // complains in jdev11, ok in jdev10.

    Hi Kevin, thanks for the tip. It's taken me years just to remember where to turn on the line numbers in 'preferences' , so I would never have found that one about the instance variable checks ! Frank, thanks for the update, I agree it's useful as a stylistic hint, but I think that the Jdev floating code assist, rather than just hinting "declare this field protected" (as this will obviously fix it) would be more user-friendly if it also said "or disable under preferences - code assists." But Jdev11 is growing on me, tons of cool stuff :-)
    thanks all.

  • Parsing XML and Storing values in instance variable

    hi,
    i'm new to XML.
    here i'm trying to parse an XML and store their element data to the instance variable.
    in my main method i'm tried to print the instance variable. but it shows "" (ie it print nothing ).
    i know the reason, its becas of the the endElement() event generated and it invokes the characters() and assigns "" to the instance variable.
    my main perspective is to store the element data in instance variable.
    thanks in advance.
    praks
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    public class mysax extends DefaultHandler
         String ctelement;
         CharArrayWriter contents;
         String vname1,vrcbreg1,vaddress1,vcountry1,vtelephone1,vfax1;
         String vname,vrcbreg,vaddress,vcountry,vtelephone,vfax;
         public mysax()
              vname1 = null;
              vrcbreg1 = null;
              vaddress1 = null;
              vcountry1 = null;
              vtelephone1 = null;
              vfax1 = null;
              contents= new CharArrayWriter();
         public void doparse(String url) throws Exception
              SAXParserFactory spf = SAXParserFactory.newInstance();
    SAXParser sp = spf.newSAXParser();
    ParserAdapter pa = new ParserAdapter(sp.getParser());
    pa.setContentHandler(this);
    pa.parse(url);          
         public void startElement(String namespace,String localName,String qName,Attributes atts)
              ctelement = localName;     
         public void endElement(String uri,String localName,String qName) throws SAXException
         public void characters(char[] ch,int start, int length) throws SAXException
              try
                   if(ctelement.equals("name"))
                        vname = new String (ch,start,length);
                        System.out.println("The method "+vname1);
              }catch (Exception e)
                   System.out.println("The exception "+e);
         public static void main(String args[])
              try
              mysax ms = new mysax();
              ms.doparse(args[0]);
              System.out.println("the contents name "+ms.vname1);
              catch(Exception e)
                   System.out.println("this is exception at main" +e);
    my XML looks like
    <coyprofile_result>
    <company>     
    <name>abcTech</name>
    <rcbreg>123456789</rcbreg>
    <address>Singapore</address>
    <country>sg</country>
    <telephone>123456</telephone>
    <fax>123155</fax>
    </company>
    </coyprofile_result>

    I believe that the problem has to do with the value you assign to ctelement. You are assigning the value of localName to ctElement, however for the element: <name>...</name> the localname is empty string i.e. "", but qName equals "name". Because you are assigning empty string to ctElement, when you do the comparison in characters of ctElement to "name" it will always be false. So in startElement change it to ctElement = qName; Try it and see if it works. I have produced similar programs and it works for me.
    Hope this helps.

  • How to use an BPM Instance Variable in JSP page

    Hi All,
    I am using the JSP Presentation, but i don't know how to use an Instance variable in JSP page, that instance already declared in the process. And Can u explain the syntax that to include the JS file into jsp page
    Regards
    Vasu.
    Edited by bpmvasu at 04/03/2007 10:43 PM

    Hi Mariano,
    I'm using JSP presentation too. In "Interactive Component Call" active i'm using "Use JSP presentation", but i only can define one instance variable, i need to add more instance variables. In "Advanced" option of this task, i have the argument mapping .. but i don't understand how to use it.
    I have a instance variable called "genders" of the type String[Int] (Associative Array) and i'm mapping this instance variable in "Arguments Show In" option of the advanced option of JSP presentation. In JSP presentation i have the code:
    <select <f:fieldName att="person.gender"/>>
                   <c:forEach var="gender" begin="0" items="${genders}" varStatus="status">
                        <c:choose>
                             <c:when test="${person.gender == gender}">
                                  <option value="<c:out value="${gender}"/>" selected="true"><c:out value="${gender}"/></option>
                             </c:when>
                             <c:otherwise>
                                  <option value="<c:out value="${gender}"/>"><c:out value="${gender}"/></option>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>And in my screenflow i have the code:
    genders[0] = "Male"
    genders[1] = "Female"But when i run my application, i have the error: "The task could not be successfully executed. Reason: 'java.lang.ClassCastException: java.lang.Integer'."
    What's the problem?

  • How to change value of instance variable and local variable at run time?

    As we can change value at run time using debug mode of Eclipse. I want to do this by using a standalone prgram from where I can change the value of a variable at runtime.
    Suppose I have a class, say employee like -
    class employee {
    public String name;
    employee(String name){
    this.name = name;
    public int showSalary(){
    int salary = 10000;
    return salary;
    public String showName()
    return name;
    i want to change the value of instance variable "name" and local variable "salary" from a stand alone program?
    My standalone program will not use employee class; i mean not creating any instance or extending it. This is being used by any other calss in project.
    Can someone tell me how to change these value?
    Please help
    Regards,
    Sujeet Sharma

    This is the tutorial You should interest in. According to 'name' field of the class, it's value can be change with reflection. I'm not sure if local variable ('salary') can be changed - rather not.

  • JDev 11g update 1 base edition on windows: error building default domain

    Hi all,
    (refer to [url http://forums.oracle.com/forums/thread.jspa?messageID=3168105]here for original post)
    I'm posting this again with some more information. When downloading the Studio Edition (Base - no JDK) version of JDeveloper 11g update 1, an error occurs upon first (and each subsequent) startup of JDeveloper (error details below).
    Tests that I have done:
    1). Install using JDK 6 u 11 - JDK did not show up automatically in the installer, had to browse to find it and select it. Running using 6u11, 6u10, and 6u7 (deleting the system directory after each try) - error occurs.
    2). Install using JDK 6 u7 - JDK was automatically found by the installer. Running using 6u7, 6u11, and 6u10 (deleting the system directory after each try) - error occurs
    These errors do not occur when using the Windows installer. For information: my machine is Windows 2008 Server Standard 32-bit. An update - I just tried this on a Vista 64-bit laptop (running Sun 32-bit JDK 6u10) and did not have the problem. Ergo, this seems to be an issue with the JDK and detecting Windows 2008 as a Windows platform (or possibly with whatever mechanism JDev/WLS is using to detect the OS platform). I'll do more research on that and update if I find anything.
    One more update: I didn't find any issues reported like this related to Windows 2008, but I did one more test: install and run JDeveloper using:
    java version "1.6.0_05"                                                        
    Java(TM) SE Runtime Environment (build 1.6.0_05-b13)                           
    BEA JRockit(R) (build R27.6.0-50_o-100423-1.6.0_05-20080626-2105-windows-ia32, compiled mode)                                                                   The issue does not occur using this JDK. So to summarize, installing JDev 11g update 1 Studio edition, base installer using any of the SUN JDK's on Windows 2008 gives this problem. Using the windows installer or JRockit Mission Control JVM - no problems.
    Finally, one last update - the error is related to the JVM that is used to install, not the one used to run JDeveloper (via editing jdev.conf) - the offending JDK is in wlserver_10.3\common\bin\commEnv.cmd. Seems like a no-no to have one JDK running JDev and another running the integrated WLS, though. Quite a pity, as JDev starts up pretty slowly using JRockit Mission Control.
    JRockit Realtime seems to be a bit faster... sigh - now to remove the 72 extra JDK's on my laptop ;)
    My going forward plan: use the Windows installer. Wish I never installed Windows Server 2008.
    Now for the error details; the log shows:
    ERROR:  An error occurred while building the default domain.
    Please see this log file for more details:
    C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee.adrs\CreateDefaultDomain.logThe aforementioned log file shows:
    Default domain will be created:
    C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain
    C:\o\jdev11\wlserver_10.3\common\bin\wlst.cmd "C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee.adrs\CreateDefaultDomain.py"
    Process started
    wlst >
    wlst > CLASSPATH=c:\o\jdev11\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Java\JDK16~1.0_1\lib\tools.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic.jar;c:\o\jdev11\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\o\jdev11\WLSERV~1.3\server\lib\webservices.jar;c:\o\jdev11\modules\ORGAPA~1.5/lib/ant-all.jar;c:\o\jdev11\modules\NETSFA~1.0_1/lib/ant-contrib.jar;
    wlst >
    wlst > PATH=c:\o\jdev11\patch_wls1030\profiles\default\native;c:\o\jdev11\patch_jdev1111\profiles\default\native;c:\o\jdev11\patch_cie660\profiles\default\native;C:\o\jdev11\WLSERV~1.3\server\native\win\32;C:\o\jdev11\WLSERV~1.3\server\bin;c:\o\jdev11\modules\ORGAPA~1.5\bin;C:\Java\JDK16~1.0_1\jre\bin;C:\Java\JDK16~1.0_1\bin;c:\o\db11\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Subversion\bin;c:\o\wfc\bin;c:\o\wfc\jre\1.4.2\bin\client;c:\o\wfc\jre\1.4.2\bin;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;c:\o\odp;c:\o\odp\bin;c:\java\apache-ant-1.7.1\bin;C:\Program Files\Plazmic CDK 4.6\bin;c:\o\db11\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Subversion\bin;c:\o\wfc\bin;c:\o\wfc\jre\1.4.2\bin\client;c:\o\wfc\jre\1.4.2\bin;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;c:\o\odp;c:\o\odp\bin;C:\o\jdev11\WLSERV~1.3\server\native\win\32\oci920_8
    wlst >
    wlst > Your environment has been set.
    wlst >
    wlst > CLASSPATH=c:\o\jdev11\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Java\JDK16~1.0_1\lib\tools.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic.jar;c:\o\jdev11\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\o\jdev11\WLSERV~1.3\server\lib\webservices.jar;c:\o\jdev11\modules\ORGAPA~1.5/lib/ant-all.jar;c:\o\jdev11\modules\NETSFA~1.0_1/lib/ant-contrib.jar;;C:\o\jdev11\WLSERV~1.3\common\eval\pointbase\lib\pbembedded57.jar;C:\o\jdev11\WLSERV~1.3\common\eval\pointbase\lib\pbtools57.jar;C:\o\jdev11\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar
    wlst >
    wlst > Initializing WebLogic Scripting Tool (WLST) ...
    wlst >
    wlst > Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.
    wlst >
    wlst > Welcome to WebLogic Server Administration Scripting Shell
    wlst >
    wlst > Type help() for help on available commands
    wlst >
    wlst > Creating Default Domain
    wlst > Reading template: /C:/o/jdev11/wlserver_10.3/common/templates/domains/wls.jar
    wlst > Setting Name to 'DefaultServer'
    wlst > Setting ListenAddress to ''
    wlst > Setting ListenPort to 7101
    wlst > Setting domain password.
    wlst > Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')
    wlst > Problem invoking WLST - Traceback (innermost last):
    wlst >   File "C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee.adrs\CreateDefaultDomain.py", line 50, in ?
    wlst >   File "Lib/javaos.py", line 137, in __getitem__
    wlst >   File "Lib/UserDict.py", line 14, in __getitem__
    wlst > KeyError: DOMAIN_PASSWORD
    wlst >
    Elapsed time:  40920 msAs noted in the original post - it seems that the WebLogic scripting tool is assuming a Unix-type host.
    Best,
    John

    Hi all,
    (refer to [url http://forums.oracle.com/forums/thread.jspa?messageID=3168105]here for original post)
    I'm posting this again with some more information. When downloading the Studio Edition (Base - no JDK) version of JDeveloper 11g update 1, an error occurs upon first (and each subsequent) startup of JDeveloper (error details below).
    Tests that I have done:
    1). Install using JDK 6 u 11 - JDK did not show up automatically in the installer, had to browse to find it and select it. Running using 6u11, 6u10, and 6u7 (deleting the system directory after each try) - error occurs.
    2). Install using JDK 6 u7 - JDK was automatically found by the installer. Running using 6u7, 6u11, and 6u10 (deleting the system directory after each try) - error occurs
    These errors do not occur when using the Windows installer. For information: my machine is Windows 2008 Server Standard 32-bit. An update - I just tried this on a Vista 64-bit laptop (running Sun 32-bit JDK 6u10) and did not have the problem. Ergo, this seems to be an issue with the JDK and detecting Windows 2008 as a Windows platform (or possibly with whatever mechanism JDev/WLS is using to detect the OS platform). I'll do more research on that and update if I find anything.
    One more update: I didn't find any issues reported like this related to Windows 2008, but I did one more test: install and run JDeveloper using:
    java version "1.6.0_05"                                                        
    Java(TM) SE Runtime Environment (build 1.6.0_05-b13)                           
    BEA JRockit(R) (build R27.6.0-50_o-100423-1.6.0_05-20080626-2105-windows-ia32, compiled mode)                                                                   The issue does not occur using this JDK. So to summarize, installing JDev 11g update 1 Studio edition, base installer using any of the SUN JDK's on Windows 2008 gives this problem. Using the windows installer or JRockit Mission Control JVM - no problems.
    Finally, one last update - the error is related to the JVM that is used to install, not the one used to run JDeveloper (via editing jdev.conf) - the offending JDK is in wlserver_10.3\common\bin\commEnv.cmd. Seems like a no-no to have one JDK running JDev and another running the integrated WLS, though. Quite a pity, as JDev starts up pretty slowly using JRockit Mission Control.
    JRockit Realtime seems to be a bit faster... sigh - now to remove the 72 extra JDK's on my laptop ;)
    My going forward plan: use the Windows installer. Wish I never installed Windows Server 2008.
    Now for the error details; the log shows:
    ERROR:  An error occurred while building the default domain.
    Please see this log file for more details:
    C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee.adrs\CreateDefaultDomain.logThe aforementioned log file shows:
    Default domain will be created:
    C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain
    C:\o\jdev11\wlserver_10.3\common\bin\wlst.cmd "C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee.adrs\CreateDefaultDomain.py"
    Process started
    wlst >
    wlst > CLASSPATH=c:\o\jdev11\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Java\JDK16~1.0_1\lib\tools.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic.jar;c:\o\jdev11\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\o\jdev11\WLSERV~1.3\server\lib\webservices.jar;c:\o\jdev11\modules\ORGAPA~1.5/lib/ant-all.jar;c:\o\jdev11\modules\NETSFA~1.0_1/lib/ant-contrib.jar;
    wlst >
    wlst > PATH=c:\o\jdev11\patch_wls1030\profiles\default\native;c:\o\jdev11\patch_jdev1111\profiles\default\native;c:\o\jdev11\patch_cie660\profiles\default\native;C:\o\jdev11\WLSERV~1.3\server\native\win\32;C:\o\jdev11\WLSERV~1.3\server\bin;c:\o\jdev11\modules\ORGAPA~1.5\bin;C:\Java\JDK16~1.0_1\jre\bin;C:\Java\JDK16~1.0_1\bin;c:\o\db11\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Subversion\bin;c:\o\wfc\bin;c:\o\wfc\jre\1.4.2\bin\client;c:\o\wfc\jre\1.4.2\bin;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;c:\o\odp;c:\o\odp\bin;c:\java\apache-ant-1.7.1\bin;C:\Program Files\Plazmic CDK 4.6\bin;c:\o\db11\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Subversion\bin;c:\o\wfc\bin;c:\o\wfc\jre\1.4.2\bin\client;c:\o\wfc\jre\1.4.2\bin;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;c:\o\odp;c:\o\odp\bin;C:\o\jdev11\WLSERV~1.3\server\native\win\32\oci920_8
    wlst >
    wlst > Your environment has been set.
    wlst >
    wlst > CLASSPATH=c:\o\jdev11\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;c:\o\jdev11\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Java\JDK16~1.0_1\lib\tools.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\o\jdev11\WLSERV~1.3\server\lib\weblogic.jar;c:\o\jdev11\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\o\jdev11\WLSERV~1.3\server\lib\webservices.jar;c:\o\jdev11\modules\ORGAPA~1.5/lib/ant-all.jar;c:\o\jdev11\modules\NETSFA~1.0_1/lib/ant-contrib.jar;;C:\o\jdev11\WLSERV~1.3\common\eval\pointbase\lib\pbembedded57.jar;C:\o\jdev11\WLSERV~1.3\common\eval\pointbase\lib\pbtools57.jar;C:\o\jdev11\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar
    wlst >
    wlst > Initializing WebLogic Scripting Tool (WLST) ...
    wlst >
    wlst > Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.
    wlst >
    wlst > Welcome to WebLogic Server Administration Scripting Shell
    wlst >
    wlst > Type help() for help on available commands
    wlst >
    wlst > Creating Default Domain
    wlst > Reading template: /C:/o/jdev11/wlserver_10.3/common/templates/domains/wls.jar
    wlst > Setting Name to 'DefaultServer'
    wlst > Setting ListenAddress to ''
    wlst > Setting ListenPort to 7101
    wlst > Setting domain password.
    wlst > Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')
    wlst > Problem invoking WLST - Traceback (innermost last):
    wlst >   File "C:\o\jdev11\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee.adrs\CreateDefaultDomain.py", line 50, in ?
    wlst >   File "Lib/javaos.py", line 137, in __getitem__
    wlst >   File "Lib/UserDict.py", line 14, in __getitem__
    wlst > KeyError: DOMAIN_PASSWORD
    wlst >
    Elapsed time:  40920 msAs noted in the original post - it seems that the WebLogic scripting tool is assuming a Unix-type host.
    Best,
    John

  • Instance variable to hold the element of a tag in the xml file

    Hi I have an xml file that is handled using this parser
    <attr id="MY_NAME" >
    this parser hanled the above tag but now I want to have it handle
    <attr id="MY_NAME" desc="GOOD">
    but I need to create an instance variable to handle the desc element in the attr tag .
    Can some one help me out as this is not my file and I am having trouble to do please......
    import java.util.*;
    import java.io.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
       The SupportMatrix class provides static variables and methods to simplify
       the determination of whether or not a given attribute is supported for a
       certain object type (queue manager, channel, etc.), depending on the version
       and platform of the queue manager to which it belongs.
       The SupportMatrix class may not be instantiated. Its constructor is private.
       An instance of the class is created internally in the static initializer so
       that the XML parsing methods are available.
       A corresponding XML document, SupportMatrix.xml, is parsed to create the various
       HashMaps which contain the version/platform dependency information. A number of
       inner classes are used to represent the various elements of the XML matrix
       definition.
       Here's a sample document:
       <!-- The supportmatrix tag opens the document -->
       <supportmatrix>
         <!-- Objects are keyed by classid. "1" is the classid of a queue manager object. -->
         <object classid="1">
           <!-- Versions group attributes according to the queue manager version where they
                were introduced. The "base" cmdlevel encompasses all versions up to 5.1. -->
           <version cmdlevel="base">
             <!-- Attributes are defined by the attr tag. -->
             <attr id="MQCA_Q_MGR_NAME">
               <!-- Support elements define the platform-specific requirements for an attribute. -->
               <support platforms="UNIX,WINDOWS,OS400,VMS,NSK" maxlen="48" type="MQCFST"/>
               <support platforms="MVS" maxlen="4" type="MQCFST"/>
             </attr>
             <attr id="MQCA_Q_MGR_DESC">
               <!-- Specific attribute characteristics, most notably maximum len for string parms,
                    are defined in the support element. As shown in the following example, it may
                    apply to all platforms. -->
               <support platforms="all" maxlen="64" type="MQCFST"/>
             </attr>
             <!-- Support elements are optional. -->
             <attr id="MQIA_PLATFORM"/>
             <attr id="MQIA_COMMAND_LEVEL"/>
           </version>
           <!-- The version element may 'include' other versions. Note that object elements
                may also refer to other objects via the 'include' parm of the object tag.
                This is to allow common attributes (especially for queues and channels) to
                be shared by multiple definitions in order to reduce some of the
                redundancy. -->
           <version cmdlevel="520" include="base">
           </version>
         </object>
       </supportmatrix>
       The inner classes, and their hierarchical relationships are as follows:
         SupportObject - corresponds to the <object> element. Stored in a static HashMap, and
                         keyed by classid.
           VersionObject - corresponds to the <version> element. Stored in a HashMap instance
                           variable of the SupportObject class, keyed by cmdlevel.
             AttributeObject - corresponds to the <attr> element. Stored in a HashMap instance
                               variable of the VersionObject class, keyed by attribute name.
               PlatformObject - corresponds to the <support> element. Stored in HashMaps belonging
                                to the AttributeObjects, keyed by platform. A single PlatformObject
                                instance is created when the support tag is encountered. The
                                "platforms" attribute of the support element is then processed. For
                                each platform in the comma-delimited list, an entry is added to the
                                collection of PlatformObjects. This is to greatly simplify later
                                lookups.
       In order to support the 'include' feature of object and version elements, certain
       functions are recursive. If the attribute to be validated is not found for the passed
       cmdlevel, the 'parent' VersionObject is consulted by means of the 'include' value. If
       the chain of VersionObjects has been exhausted and the attribute in question has still not
       been located, the next SupportObject in the chain is consulted in a similar fashion.
    public class SupportMatrix extends DefaultHandler {
        /** The objects collection holds all the SupportObjects, keyed by classid. */
        private static HashMap objects;
        /** xmlFile will name the xml document to be parsed. Note that using the
            default class loader expects the string to be the path to the file. It must
            NOT begin with the '/' character. */
        private static String xmlFile =
            ResourceManager.getApplicationProperties().getProperty("SupportMatrixFile");
        private Stack stack;
        /** This static initializer allocates the static objects collection, creates an
            instance of the SupportMatrix class for xml parsing purposes, and initiates
            the parse operation to populate the collection. */
        static {
            objects = new HashMap();
            // Create a parser and process the xml doc
            SupportMatrix handler = new SupportMatrix();
            InputSource is = null;
            try {
                is = new InputSource(ClassLoader.getSystemClassLoader().getResourceAsStream(xmlFile));
                XMLReader xmlReader =
                    SAXParserFactory.newInstance().newSAXParser().getXMLReader();
                xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
                xmlReader.setContentHandler(handler);
                if (is == null) {
                    System.err.println("No input stream, dammit");
                xmlReader.parse(is);
            } catch(Exception e) {
                e.printStackTrace();
        /** Private constuctor, used only for XML parsing. */
        private SupportMatrix() {
            stack = new Stack();
        /** Add a SupportObject instance to the objects collection. */
        private void addObject(SupportObject obj) {
            String key = obj.getClassId();
            objects.put(key, obj);
        /* DefaultHandler methods                                              */
        /** Not used. */
        public void characters(char[] ch, int start, int length) {}
        /** Not used. */
        public void endDocument() {}
        /** For the version, object, and attr elements, pop the top element of the stack. */
        public void endElement(String uri, String localName, String qName) {
            if (localName.equals("version") || localName.equals("object") || localName.equals("attr")) {
                stack.pop();
        /** Not used. */
        public void setDocumentLocator(Locator locator) {}
        /** Not used. */
        public void startDocument() {}
        /** Most of the work is done here. Create the appropriate inner class instance for
            element; for object, version, and attr, push the element onto the stack so that
            child elements may be added to their collections as needed. */
        public void startElement(String uri, String localName, String qName,
                                 Attributes attributes) {
            String include = attributes.getValue("include");
            if (localName.equals("object")) {
                SupportObject obj = new SupportObject(attributes.getValue("classid"), include);
                addObject(obj);
                stack.push(obj);
            } else if ( localName.equals("version")) {
                VersionObject ver = new VersionObject(attributes.getValue("cmdlevel"), include);
                ((SupportObject)stack.peek()).addVersion(ver);
                stack.push(ver);
            } else if ( localName.equals("attr")) {
                AttributeObject a = new AttributeObject(attributes.getValue("id"));
                //String desc = StringFactory.getString(attributes.getValue("desc"));
                //if(desc != null)
                   //     a.setAttribute();
                String readonly = attributes.getValue("readonly");
                String exclude = attributes.getValue("exclude");
                if (include != null && exclude != null) {
                    Log.log(Log.ERROR, this, "include and exclude are mutually exclusive, exclude value ignored");
                    exclude = null;
                if (include != null) {
                    a.setCondition(include, true);
                if (exclude != null) {
                    a.setCondition(exclude, false);
                if (readonly != null)
                    a.setReadonly(readonly.equals("y"));
                ((VersionObject)stack.peek()).addAttr(a);
                stack.push(a);
            } else if (localName.equals("support")) {
                String platforms = attributes.getValue("platforms");
                String readonly = attributes.getValue("readonly");
                String maxlen = attributes.getValue("maxlen");
                String type = attributes.getValue("type");
                int attrType = 0;
                if (type != null) {
                    if (type.equals("MQCFIN")) {
                        attrType = CMQCFC.MQCFT_INTEGER;
                    } else if (type.equals("MQCFIL")) {
                        attrType = CMQCFC.MQCFT_INTEGER_LIST;
                    } else if (type.equals("MQCFST")) {
                        attrType = CMQCFC.MQCFT_STRING;
                    } else if (type.equals("MQCFSL")) {
                        attrType = CMQCFC.MQCFT_STRING_LIST;
                    } else if (type.equals("EXBIN")) {
                        attrType = MqcConstants.EXCFT_BINARY;
                    } else if (type.equals("EXPCF")) {
                        attrType = MqcConstants.EXCFT_PCF;
                PlatformObject p = null;
                if (readonly == null) {
                    p = new PlatformObject(platforms);
                } else {
                    p = new PlatformObject(platforms, readonly.equals("y"));
                String exclude = attributes.getValue("exclude");
                if (include != null && exclude != null) {
                    Log.log(Log.ERROR, this, "include and exclude are mutually exclusive, exclude value ignored");
                    exclude = null;
                if (include != null)
                    p.setCondition(include, true);
                if (exclude != null)
                    p.setCondition(exclude, false);
                if (attrType != 0)
                    p.setType(attrType);
                if (maxlen != null)
                    p.setLen(Integer.parseInt(maxlen));
                ((AttributeObject)stack.peek()).addPlatform(p);
        public static boolean isExported(int attribute, TopologyModelNode node) {
            String name = ResourceManager.getAttributeName(attribute);
            return isExported(name, node);
        public static boolean isExported(String attribute, TopologyModelNode node) {
            // Find the qmgr node to fetch platform and cmdlevel
            TopologyModelNode qmgr = node.getModel().getQMgrNode(node.getAddress());
            // If there's no qmgr for this node, it must be one of 'ours'.
            if (qmgr == null)
                return false;     // None of 'our' objects can be exported to MQSC.
            String classId = node.getClassId();
            String cmdLevel = qmgr.getAttributeValue("MQIA_COMMAND_LEVEL");
            String platform = qmgr.getAttributeValue("MQIA_PLATFORM");
            return isExported(attribute, classId, cmdLevel, platform, node);
        public static boolean isExported(int attribute, String classId, String cmdLevel, String platform,
                                         TopologyModelNode node) {
            String name = ResourceManager.getAttributeName(attribute);
            return isExported(name, classId, cmdLevel, platform, node);
        /** Determine if an attribute is exportable. The attribute name, the classid of the object to
            which it belongs, plus the command level and platform of the queue manager are all needed
            to make this determination.
            Start by finding the AttributeObject for the combination of attribute, classid, and
            command level. If we can't find the AttributeObject, we assume that the attribute
            is not exported. Otherwise, find out if it is exportable for the selected platform.
        public static boolean isExported(String attribute, String classId, String cmdLevel, String platform,
                                         TopologyModelNode node) {
            AttributeObject attr = getAttributeObject(attribute, classId, cmdLevel);
            if (attr == null) {
                return false;
            } else {
                return attr.isExported(platform, node);
        public static boolean isSupported(int attribute, TopologyModelNode node) {
            String name = ResourceManager.getAttributeName(attribute);
            return isSupported(name, node);
        public static boolean isSupported(String attribute, TopologyModelNode node) {
            // Find the qmgr node to fetch platform and cmdlevel
            TopologyModelNode qmgr = node.getModel().getQMgrNode(node.getAddress());
            // If there's no qmgr for this node, it must be one of 'ours'.
            if (qmgr == null)
                return true;
            String classId = node.getClassId();
            String cmdLevel = qmgr.getAttributeValue("MQIA_COMMAND_LEVEL");
            String platform = qmgr.getAttributeValue("MQIA_PLATFORM");
            return isSupported(attribute, classId, cmdLevel, platform);
        public static boolean isSupported(int attribute, String classId, String cmdLevel, String platform) {
            String name = ResourceManager.getAttributeName(attribute);
            return isSupported(name, classId, cmdLevel, platform);
        /** Determine if an attribute is supported. The attribute name, the classid of the object to
            which it belongs, plus the command level and platform of the queue manager are all needed
            to make this determination.
            Start by finding the SupportObject for the classid. If it isn't there, we make the assumption
            (for now) that the attribute is supported. The only classids for which this can occur are
            broker, agent, and the various container objects.
            Propagate the isSupported request to the chain of SupportObjects (based on 'include' values)
            until we get a 'true' result or we run out of SupportObjects. */
        public static boolean isSupported(String attribute, String classId, String cmdLevel, String platform) {
            if (attribute == null)
                return false;
            SupportObject obj = (SupportObject)objects.get(classId);
            // If the object type isn't even in the support matrix, we interpret that to
            // mean that it's a Broker or Agent, in which case all attributes are supported
            // at present.
            if (obj == null)
                return true;
            boolean result = false;
            while (result == false && obj != null) {
                result = obj.isSupported(attribute, cmdLevel, platform);
                if (result == false && obj.getInclude() != null) {
                    obj = (SupportObject)objects.get(obj.getInclude());
                } else
                    obj = null;
            return result;
        /** Locate an AttributeObject for a given attribute name, object type, and command level.
            This is a helper function for the getMaxLen and getType methods. */
        private static AttributeObject getAttributeObject(String attr, String classID, String cmdLevel) {
            AttributeObject result = null;
            SupportObject obj = (SupportObject)objects.get(classID);
            while (result == null && obj != null) {
                result = obj.getAttr(attr, cmdLevel);
                if (result == null && obj.getInclude() != null) {
                    obj = (SupportObject)objects.get(obj.getInclude());
                } else
                    obj = null;
            return result;
        /** Determine the maximum length for a given combintation of attribute name, object type,
            command level, and platform. If the AttributeObject can't be found, or if the length
            hasn't been set, return -1. */
        public static int getMaxLen(String attr, String classId, String cmdLevel, String platform) {
            AttributeObject a = getAttributeObject(attr, classId, cmdLevel);
            if (a == null)
                return -1;
            return a.getMaxLen(platform);
        /** Determine the PCF parm type for a given combintation of attribute name, object type,
            command level, and platform. If the AttributeObject can't be found, or if the length
            hasn't been set, return -1. */
        public static int getType(String attr, String classId, String cmdLevel, String platform) {
            AttributeObject a = getAttributeObject(attr, classId, cmdLevel);
            if (a == null)
                return -1;
            return a.getType(platform);
        /** Inner class to contain platform-specific info for an attribute. */
        class PlatformObject {
            /** This instance variable will contain the comma-delimited string of all
                platforms to which this object applies. */
            private String platform;
            private int maxlen;
            private String condition = null;
            private boolean include;
            private boolean readonly;
            private boolean lenSet;
            private int attrType;
            private boolean typeSet;
            public PlatformObject(String p, boolean readonly) {
                platform = p;
                this.readonly = readonly;
                lenSet = false;
                typeSet = false;
            public PlatformObject(String p) {
                this(p, false);
            public void setCondition(String condition, boolean include) {
                this.condition = condition;
                this.include = include;
            public boolean isReadonly() {
                return readonly;
            public boolean isExported(TopologyModelNode node) {
                if (condition != null) {
                    boolean test = false;
                    try {
                        test = Utilities.evaluateCondition(node, condition);
                    } catch (Exception e) {}
                    if (include ^ test)
                        return false;
                return !readonly;
            public void setLen(int len) {
                maxlen = len;
                lenSet = true;
            public void setType(int type) {
                attrType = type;
                typeSet = true;
            public String getPlatform() {
                return platform;
            public int getMaxLen() {
                if (!lenSet)
                    return -1;
                return maxlen;
            public int getType() {
                if (!typeSet)
                    return -1;
                return attrType;
        /** This class represents a specific MQSeries attribute. It can optionally contain
            instances of the PlatformObject class as needed. When the 'platforms' collection
            is empty, the attribute is supported on all platforms. It is also possible to
            include a PlatformObject for the 'all' platform, if specific attribute characteristics
            need representation. When the 'platforms' collection is non-empty, it will include one
            entry for each platform where the attribute is supported. */
        class AttributeObject {
            private String attribute;
            private String attrValue;
            private HashMap platforms;
            private String condition = null;
            private boolean include;
            private boolean readonly = false;
            public AttributeObject(String a) {
                this(a, false);
            public AttributeObject(String a, boolean readonly) {
                attribute = a;
                platforms = new HashMap();
                this.readonly = readonly;
            public void setCondition(String condition, boolean include) {
                this.condition = condition;
                this.include = include;
            public void setReadonly(boolean readonly) {
                this.readonly = readonly;
            public boolean isReadonly() {
                return readonly;
            public void addPlatform(PlatformObject p) {
                for (StringTokenizer st = new StringTokenizer(p.getPlatform(), ","); st.hasMoreTokens() ;) {
                    platforms.put(st.nextToken(), p);
            public PlatformObject getPlatform(String platform) {
                PlatformObject p = (PlatformObject)platforms.get(platform);
                if (p == null)
                    p = (PlatformObject)platforms.get("all");
                return p;
            public String getAttribute() {
                return attribute;
            public int getMaxLen(String platform) {
                PlatformObject p = getPlatform(platform);
                if (p == null)
                    return -1;
                return p.getMaxLen();
            public int getType(String platform) {
                PlatformObject p = getPlatform(platform);
                if (p == null)
                    return -1;
                return p.getType();
            public boolean isSupported(String platform) {
                if (platforms.isEmpty()) {
                    return true;
                if (platforms.containsKey(platform)) {
                    return true;
                if (platforms.containsKey("all")) {
                    return true;
                return false;
            public boolean isExported(String platform, TopologyModelNode node) {
                if (readonly) {
                    Log.log(Log.DEBUG, this, attribute + " is readonly, returning false");
                    return false;
                if (condition != null) {
                    Log.log(Log.DEBUG, this, "Testing condition = " + condition);
                    boolean test = false;
                    try {
                        test = Utilities.evaluateCondition(node, condition);
                        Log.log(Log.DEBUG, this, "Condition result is " + test);
                    } catch (Exception e) {
                        Log.log(Log.ERROR, this, "Condition through an exception");
                    if (include ^ test)
                        return false;
                if (platforms.isEmpty()) {
                    return true;
                PlatformObject p = getPlatform(platform);
                if (p == null) {
                    Log.log(Log.DEBUG, this, platform + " not found for " + attribute + ", returning false");
                    return false;
                return p.isExported(node);
        /** This class represents a specific value of a queue manager's command level. A
            given instance of this class may 'include' a 'parent' instance through its
            include instance variable. The traversal of the parent/child hierarchy is
            delegated to the SupportObject class, since that is where the collection of
            VersionObjects lives. */
        class VersionObject {
            private String cmdLevel;
            private String include;
            private HashMap attributes;
            public VersionObject(String cmdLevel, String include) {
                this.cmdLevel = cmdLevel;
                this.include = include;
                attributes = new HashMap();
            public void addAttr(AttributeObject attr) {
                attributes.put(attr.getAttribute(), attr);
            public AttributeObject getAttr(String attr) {
                return (AttributeObject)attributes.get(attr);
            public String getCmdLevel() {
                return cmdLevel;
            public String getInclude() {
                return include;
            public boolean isSupported(String attr, String platform) {
                AttributeObject obj = (AttributeObject)attributes.get(attr);
                if (obj == null) {
                    return false;
                } else
                    return obj.isSupported(platform);
        /** This class represents an MQSeries object type, as identified by its classid, e.g.
            queue manager or local queue. This class implements an include facility similar to
            that described for the VersionObject. The traversal of that hierarchy is delegated
            to the static isSupported method, because the collection of SupportObject instances
            is a static variable of the SupportMatrix class. */
        class SupportObject {
            private String classId;
            private String include;
            private HashMap versions;
            public SupportObject(String classId, String include) {
                this.classId = classId;
                this.include = include;
                versions = new HashMap();
            public void addVersion(VersionObject obj) {
                String key = obj.getCmdLevel();
                versions.put(key, obj);
            public String getClassId() {
                return classId;
            public String getInclude() {
                return include;
            public boolean isSupported(String attr, String cmdLevel, String platform) {
                boolean result = false;
                VersionObject obj = (VersionObject)versions.get(cmdLevel);
                if (obj == null)
                    obj = (VersionObject)versions.get("base");
                // I don't actually know what it means if obj is null at this point.
                // It probably can't happen.
                if (obj == null)
                    return false;
                while (result ==  false && obj != null) {
                    result = obj.isSupported(attr, platform);
                    if (result == false && obj.getInclude() != null) {
                        obj = (VersionObject)versions.get(obj.getInclude());
                    } else
                        obj = null;
                return result;
            public AttributeObject getAttr(String attr, String cmdLevel) {
                AttributeObject result = null;
                VersionObject obj = (VersionObject)versions.get(cmdLevel);
                if (obj == null)
                    obj = (VersionObject)versions.get("base");
                // I don't actually know what it means if obj is null at this point.
                // It probably can't happen.
                if (obj == null)
                    return null;
                while (result ==  null && obj != null) {
                    result = obj.getAttr(attr);
                    if (result == null && obj.getInclude() != null)
                        obj = (VersionObject)versions.get(obj.getInclude());
                    else
                        obj = null;
                return result;
    }

    Are you the one who commented out the code you're looking for ?//String desc = StringFactory.getString(attributes.getValue("desc"));You just have to modify you AttributeObject class to hold a new field : String description. And then, it's up to you to create a new constructor or a new setter method.
    Btw, this is not a Swing related question.

  • How can I use evaluate to get the instance variable in customized tag

    1.
    At first , I create a class called bean,and declared several params in it and do not define any getter function for the param.
    class bean{
    String param = "test";
    SomeClass scObj = new SomeClass();
    2.
    The second ,I use
    request.setAttribute("beanObj",new bean());
    3.
    And then I wanna use the customized tag to show a text box , then initialize it's value.
    <salt:text name="param" value="beanObj.param">
    <salt:text name="obj" value="beanObj.scObj.func()">
    4.
    I tried the evaluator provided by JexlContext ,Struts, JSTL and it seems that if I do not define the getter for the variable ,I can not get the bean's instance variable's value.
    Expression e = ExpressionFactory.createExpression( value );
    JexlContext jc = JexlHelper.createContext();
    jc.getVars().put(strInitBeanName, request.getAttribute("beanObj"));
    Object obj = e.evaluate(jc);
    the result of the obj is null....
    Can anybody recommand some other evaluator can get the value of a instance variable from an object?

    do you have any other suggestion ? Nops, somebody else may have though. AFAIK, all lookups of the type
    beanName.propertyNameuse reflection on the getXXX() methods to access the property.
    Having said that, I guess you could write one though in a custom tag, using the same - reflection (you will ahve to rely on the java.lang.reflect.Field class quite heavily) - but that would be reinventing the wheel for most other functionality that you would have to include (like looking up the bean in scope etc)
    cheers,
    ram.

  • Profit Center Hierarchy is not updating in Variable

    HI Guru's,
    Profit Center Hierarchy is not updating in Variable .
    We have 3 new profit center added of which i have updated the master data ie, attr, txt, and hierarchy and Txn data. Where after updating i can find the thing updated but when i execute the report in the variable i dont find the updated profit center.
    Please guide
    Prasad

    But just to update you that we don't have data for the new profit centerin R3. Is it because of this i don't find the new profit centers in
    Variable screen ( though i can see in Query Designer)
    Please guide

Maybe you are looking for

  • Zen V 8Gb locks up with MediaSource 5, no longer recognized by

    I have an 8G Zen V which I sync using a computer running Windows XP. I was transferring a file from MediaSource 5 to my 8G Zen V when I noticed that the current file had simply stopped transferring stuck at %. I unplugged the Zen, but instead of retu

  • Setting Up Rectangular, for example 16:9 with different subdivisions, Grid (View Show Grid)

    The Grid tool (View > Show Grid) is a huge help when designing. Unfortunately, by default AI allows us to specify only square grids, i.e. you set one parameter for gridline spacing (and one for its subdivisions) and AI creates square grid applying yo

  • How to get canon 70 raw on photoshop cs6

    I cannot get photoshop cs6 to read the raw files on the canon 70D. I have tried all the recommended fixes but nothing happens Using windows 8.

  • Can't export pages into word

    I am getting an error message The file "/Users/kafia2008/Library/Caches/Cleanup At Startup/com.apple.iWork.Pages_186_TEMP_376522632_4  when i try to export a pages document into word

  • Font resize, scale

    Flex doens't scale text by default. What is the best way to make the text look bigger when the textcomponent has more space. I did something like this: <mx:Text fontSize="{this.width*this.height/8000}" But most of the time the text is too big or too