Accessing Instance Variables

Hi,
I am trying to make a presentation that shows all instance variables of a determined process's instance.
In order to do that, I have created a Gloabal Interactivity Activity with a presentation that ask for a key.
So, I want to show in the next presentation all the instance variables of the instance processes that has the key informed by the user on the previous presentation.
How can I do that?
Thanks very much
Marcos

<script language="JavaScript">
var scriptVar = "<%= jspVar %>";
</script>

Similar Messages

  • Accessing Instance variables from within javascript

    Is it possible to access Instance variables of a JSP using
    javascript? If so, an example would be very much appreciated.
    LaMont

    <script language="JavaScript">
    var scriptVar = "<%= jspVar %>";
    </script>

  • Accessing instance variables within frames.

    I have 2 jsf within frames that is having one managed bean.
    i would like to access the instance variable defined in one jsf from another jsf. Since the managed bean is getting instantiated for the second jsf, the values in first jsf is getting reintialized.
    Is it possible to access like this? or do we need to have a separate backing bean and call the first from second.

    <script language="JavaScript">
    var scriptVar = "<%= jspVar %>";
    </script>

  • Accessing instance variables from container

    I am new to Flash. I am a programmer, not a designer so this
    is my first foray into Actionscript.
    I am creating a slide show player in Flash. It retrieves an
    XML file containing other .swf files that should be played, the
    order in which they should be played, the length of time each one
    should show, and the text that should be displayed.
    For example:
    <presentation>
    <globals>
    <setting name="use_transitions" value="false"/>
    <setting name="use_delays" value="false"/>
    </globals>
    <slide src="slide5.swf" text="Slide 1" delay="10"/>
    <slide src="slide3.swf" text="Slide 2" delay="10"/>
    </presentation>
    I have everything working except for the loaded .swf file
    picking up on the text to display.
    I can set the Var: property on the dynamic text field to
    _root.dynamic_text and it will load what is in the variable
    dynamic_text just fine.
    However, the slide3.swf and slide5.swf file have default text
    in them that should who if there is no text specified.
    It seems that variables inside a loaded movie are not in
    scope.
    I load the movie using:
    loadMovie(slides[nIndex][0], "slideMovie");
    However if my instance name on my dynamic text field is
    "theText" this code does not work:
    this.slideMovie.theText.text = dynamic_text;
    How do I dereference the dynamic text field?
    Thanks for any help.

    quote:
    Originally posted by:
    abeall
    I didn't really follow your set up.
    > this.slideMovie.theText.text = dynamic_text;
    Where is that code placed? Where is theText? Where is
    dynamic_text defined, or what is it? _txt usually signifies a
    TextField instance, but if that was the case then the statement
    would not do anything. Are you trying to access objects in the
    external slide SWF before it has been loaded and initialized?
    I'm sorry that I wasn't clear enough.
    Maybe this will help.
    ============== Begin Code ==============
    slide3.swf
    ========
    _root
    layer |------> Instance of Graphic Symbol
    -----------------------> Dynamic Text Object named
    'theText'
    layer |------> Instance of Graphic Symbol
    -----------------------> JPEG Graphic Background
    layer |------> Actionscript Layer
    slide_show engine.swf
    ==================
    _root
    layer |------> Movie Clip Object named 'slideMovie'
    layer |------> Actionscript Layer
    Actionscript code snippet:
    /* This becomes a two dimentional array of slides.
    * slides[index][0] is the .swf file to load.
    * slides[index][1] is the transistion to load. (Not
    currently used.)
    * slides[index][2] is the delay to wait (in seconds) until
    the next slide shows.
    * slides[index][3] is the customized text to show the loaded
    slide. If blank show the default text.
    var slides = new Array();
    var dynamic_text;
    var nIndex = 0;
    var main:Object = new Object();
    main.switch_slides = function()
    if (nInterval != -1)
    clearInterval(nInterval);
    if (nIndex >= slides.length)
    return;
    _root.dynamic_text = slides[nIndex][3];
    loadMovie(slides[nIndex][0], "slideMovie");
    this.slideMovie.theText.text = _root.dynamic_text;
    nInterval = setInterval(main, "switch_slides",
    (slides[nIndex++][2] * 1000));
    // Code to load and parse the configuration file deleted for
    brevity.
    ============== End Code ==============
    The slides are made by our designer. Most of which animate
    the background image and then fade in the text.
    The text object usually does not exist in the first key
    frame. So my workaround is probably the only way this can be done.
    The workaround needs to go in every slide's actionscript
    layer on the first key frame.
    The only real problem I have with it is that I need to put
    the default text in the actionscript. Putting a Var reference in
    the dynamic text will remove the text there if the variable is
    empty.
    However trying to dynamically create the var reference does
    not seem to work. For example:
    In the slide3.swf file if I have the following code on the
    actionscript layer, the var reference in the dynamic text does not
    get pulled in properly:
    if (_root.dynamic_text)
    this.dynamic_text = _root.dynamic_text;
    I need to put the var reference at the top with the default
    text. For example:
    var dynamic_text = "default text";
    if (_root.dynamic_text)
    this.dynamic_text = _root.dynamic_text;

  • I want to access that BEA instance variable inside of a external java class

    Hi,
    This is N.pradeep. I am a java programmer, and I am new to BEA AquaLogic BPM studio5.7. I have a question regarding how to retrieve an instance variable of BEA Aqua Logic to an external Java Program. i.e. I want to access that BEA instance variable inside of a external java class, and vice versa.

    You can use PAPI or PAPI-WS for accessing BPM instance variable from a Java code, thougt I am not sure how the reverse will be done. Assuming that you are aware aof PAPI-WS and have created the necessary stubs out of the PAPI-WS WSDL using Axis, you can access instance variables using the API's or operations defined therein.
    Thanks and Regards
    Vivek Nandey
    BEA Certified Developer for Integration Solutions
    [email protected]

  • Not able to access parent instance variable in outside of methods in child

    Hi,
    I am not getting why i am not able to access parent class instance variable outside the child class intance methods.
    class Parent
         int a;
    class Child extends Parent
         a = 1; // Here i am getting a compilation error that Syntax error on token "a", VariableDeclaratorId expected after this token
         void someMethod()
              a = 1;  // Here i am not getting any compilation error while accessing parent class variable
    }Can any one please let me know exact reason for this and what is the error talks about?
    Thanks,
    Uday
    Edited by: Udaya Shankara Gandhi on Jun 13, 2012 3:30 AM

    You can only put assignments or expressions inside methods, constructors or class initializors, or when declaring a variable.
    It has nothing to the with Child extending Parent.
    class Parent {
        int a = 1;
        { a = 1; }
        public Parent() {
            a = 1;
       public void method() {
           a = 1;
    }

  • Access of Instance variable in servlet

    hi,
    If i declare a instance variable in servlet , can i access that variable throughout my application??.
    please let me know.
    thanks in advance.

    Servlets are Java classes. They follow all the rules of Java.

  • 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.

  • JSP and Instance Variables

    I have some questions about JSP presentation (Interactive Component Call in Screenflow):
    - Only BPM Objects are possible to be mapped in JSP?
    - Is possible to map two or more BPM Objects to the JSP?
    - What is the difference of mapping using the variable "attributes" in argument mapping and the option "Select BPM object variable" in main task of Interactive Component Call activity?

    I seem to be having a similar problem.
    If I include this fragment, for an instance variable called "contacts" which is a BPMObject of type "ITSSContactRequest".
    <%
    Object r = request.getAttribute("contacts");               
    Class cl = r.getClass();
    out.println(cl.getName());
    %>
    I get the following output:
    xobject.ITSSContactManagement.ITSSContactRequest
    and I can access the object via reflection:
    <%
    Object r = request.getAttribute("contacts");               
    Class cl = r.getClass();
    out.println(cl.getName());     
    Method getGeneralContacts = cl.getMethod("getGeneralContacts", null);               
    Object rv = getGeneralContacts.invoke(r);
    %>
    and access the rv variable accordingly.
    However, if I try and cast the variable directly:
    <%
    Object r = request.getAttribute("contacts");
    Class cl = r.getClass();               
    out.println(cl.getName());
    xobject.ITSSContactManagement.ITSSContactRequest rq = (xobject.ITSSContactManagement.ITSSContactRequest)r;
    %>
    I get the following error message:
    "The task could not be successfully executed. Reason: 'fuego.web.execution.exception.InternalForwardException: UnExpected error during internal forward process.'.
    See log file for more information [Error code: workspace-1258985548580] "
    The same error occurs if I try and import the object via
    <%@ page import="xobject.ITSSContactManagement.ITSSContactRequest" %>
    Thanks for any help.

  • Using multiple instance variables or BPM objects in a single JSP

    In my screenflow, for an user activity, I've selected a BPM object variable for my JSP and using this BPM object variable within the JSP to display or accept values related to this BPM object.
    But in certain circumstances, I need access to some of the instance variables defined in my screenflow (which are not members of the BPM object), and to get these variable values displayed in my JSP. I don't want to overload my BPM object with all these instances as they do not logically fit as members in this BPM object.
    For example, if I need to capture and display the logged in user name across the JSPs in my web application, then how can I do that without specifying this user variable in all of my BPM objects.
    Is there any extensibility in using more than one BPM object variables in my JSPs? Why is it that a single BPM object variable is tied to a JSP? Or am I missing something else here?

    I'm with the same problem!

  • How to wash out an AM instance variable at the end of user session (logout)

    We have a need to create AM instance variables to hold some session level data, which is too complex to be held in a transient VO.
    What we observed is that the instance variable is not washed out at the end of the user session (i.e logout).
    I think since the AM instance is not really destroyed but only release back to the pool the instance variable content persists and is carried over to the next session that access the AM instance.
    What method in AM can be overridden to wash out this instance variable.
    At the moment we are resetting it in prepareSession(), but this means that the information is still held till the next session access the AM.
    It would be better to reset it when the AM is released back to the pool.
    Any pointers would be helpful.

    At the moment we are resetting it in prepareSession(), but this means that the information is still held till the next session access the AM.
    Note that prepareSession() is also invoked after AM activation so this can(and probaly will) reset your variable inside existing session.
    If you don't need to keep variable value between AM activations/passivations, you can use userData, for example:
    this.getSession().getUserData().put("someKey", value);
    UserData values are lost after AM passivation (by default).
    If you need to keep UserData variable value for lifetime of user session, then you can override passivateState() and activateState() as in this sample:
    Application State Management
    Dario

  • Stateful session bean destroying instance variables?

    I'm trying to use a stateful session bean as some kind of login controller and to maintain the login id and access level across JSPs and HTMLs so that once logged in, all the JSPs can obtain the login name of the current user (String) and his access level (int).
    I use the login.jsp to login and it successfully reports logging in with the correct access level retrieved from database. However, if I go to another JSP (testlogin.jsp), these 2 EJB instance variables are always destroyed and set to null and 0 when I access them again.
    What am I missing that my stateful session bean is not saving these instance variables? Do I need to put them in some serializable value objects (create a help VO class?)
    I suspected that on different JSP, I call the MemberControllerHome.create() method, it creates a new instance or something but if I don't use the create method how do I get a handle to MemberController at all?
    MemberControllerBean.java
    public class MemberControllerBean implements SessionBean {
         //initialize in ejbCreate.
         private MemberHome memberHome;
         SessionContext context;
         //Member currentLogin;
         //Current Login
         private String loginID;
         private int accessLevel;
         // Constructor
         public MemberControllerBean() {}
    ...some code in between...
    public void login(String id, String password){
              try{
                   Member member = null;
                   member = memberHome.findByPrimaryKey(id);
                   if(member.getMPassword().equals(password)){
                        this.loginID = member.getMID();
                        this.accessLevel = member.getMAccessLevel();
                   else{
                        throw new EJBException("Login failed. Invalid member ID and/or password.");
              } catch (FinderException ex) {
                   throw new EJBException("Login failed. Invalid member ID and/or password.");
         public void logout(){
              this.loginID = null;
              this.accessLevel = 4;
         public String getLoginID(){
              return this.loginID;
         public int getLoginAccessLevel(){
              return this.accessLevel;
    login.jsp
    String mID = request.getParameter("mID");
    String mPassword = request.getParameter("mPassword");
    out.println("20:" + mID + ":" + mPassword);
    if(mID != null && mPassword != null){
         out.println("22:" + mID + ":" + mPassword);
         try{
              InitialContext ic = new InitialContext();
              MemberControllerHome home = (MemberControllerHome) ic.lookup("java:comp/env/ejb/MemberController");
              MemberController mc = home.create();
              out.println("26:Logging in as " + mID + " with " + mPassword);
              mc.login(mID, mPassword);
              out.println("28:" + mc.getLoginID() + "logged in successfully at level " +
                   mc.getLoginAccessLevel() + ".");
         } catch (NamingException ex) {
              out.println("java:comp/env/ejb/MemberController not found.");
         } catch (EJBException ex) {
              out.println(ex.getMessage());
         } catch (Exception ex) {
              out.println(ex.getMessage());
    testlogin.jsp
    <%
    try{
         InitialContext ic = new InitialContext();
         MemberControllerHome home = (MemberControllerHome) ic.lookup("java:comp/env/ejb/MemberController");
         MemberController mc = home.create();
         out.println("You are logged in as <b>" + mc.getLoginID() +
              "</b> at level <b>" + mc.getLoginAccessLevel() + "</b>.");
    } catch (NamingException ex) {
         out.println("java:comp/env/ejb/MemberController not found.");
    } catch (EJBException ex) {
         out.println(ex.getMessage());
    } catch (Exception ex) {
         out.println(ex.getMessage());
    %>

    The key to the problem is that in testlogin.jsp a new stateful session bean is created. The new bean instance of course doesn't know the log-in information you stored in the old session bean. That is why the method returns null and 0 when called.
    There are couple of ways to solve the issue. The easiest solution is to store the bean instance created in Login.jsp in the jsp's implicit HttpSession object. Because login.jsp and testlogin.jsp share the same session, the bean instance can be easily stored and retrieved.
    Here is the code you need to have:
    1. in login.jsp
    session.setAttribute("MemberControllerBeanInstance", mc);
    2. in testlogin.jsp
    MemberController mc =
    (MemberController) session.getAttribute("MemberControllerBeanInstance");
    Hope it helps.

  • Can i use instance variables in page flow controller with out restriction?

    I am using instance variable in pageflow controller.
    1) Will it give any problem if concurrent users are accessing that controller class?
    2) How many controller objects will be created if multiple users (Say 10 users) accessing same controller class?
    Thanks.

    1) Will it give any problem if concurrent users are accessing that controller class? Pageflows are pere user session, different users wont cause it problems. however a single user can cause problems by using open new tab on a link etc(or back button or refresh on browser, problems with using state in a stateless protocol) . A bigger problem is that since a pageflow is indirect in session, using private variables in pageflow increases your session footprint and in a cluster , if replicated, your network trafiic as well. Using state also causes problem in HTTP , a stateless protocol,. Highly not recommended (unless you have no other choice)
    2) How many controller objects will be created if multiple users (Say 10 users) accessing same controller class? 10. assuming the portlet is used once only. If you use the same portlet in multiple pages , then you have that many.
    Edited by: deepshet on Feb 27, 2010 12:10 PM

  • How to clone generic instance variables?

    Hi guys,
    If I have private class Item<T>
            private T value;
            private int priority;
            public Item(T value, int priority)
                this.value = value;
                this.priority = priority;
            @Override
            public Object clone()
                try           
                    Item copy = (Item)super.clone();
                    copy.value = (T)value.clone();       //compiler errors, says: "clone has protected access in java.lang.Object"
                    return copy;
                catch (CloneNotSupportedException e)
                    return null;
        }So if the instance variable is of mutable type e.g. Person, how can I make sure that value.clone() is called on a Person object?

    [http://www.angelikalanger.com/GenericsFAQ/FAQSections/ProgrammingIdioms.html#FAQ502|http://www.angelikalanger.com/GenericsFAQ/FAQSections/ProgrammingIdioms.html#FAQ502]

  • Inheritance - instance variable initialization

    Hi all.
    I have a question regarding inherited instance variables.
    class Animal {
       int weight;
       int age = 10;
    class Dog extends Animal {
       String name;
    class Test {
       public static void main(String[] args) {
          new Dog();
    }This is just an arbitrary code example.
    When new Dog() is invoked, I understand that it's instance variable "name" is give the default
    type value of null before Dog's default constructor's call to super() is invoked.But Im a little perplexed about
    Animals instance variables. I assume that like Dog, Animals instance variables are given their default type values
    of 0 & 0 respectively, before Animals invocation of super(); What im unclear about is that at the point that weight and age are given their default type values, are Dog's inherited weight and age variables set to 0 aswell at that exact moment? Or are Dog's inherited weight and age variables only assigned their values after Animals constructor fully completes because initialization values are only assigned to a classes instance variables after it's call to super().
    Many thanks & best regards.

    Boeing-737 wrote:
    calvino_ind wrote:
    Boeing-737 wrote:
    newark wrote:
    why not throw in some print statements and find out?Super() or this() have to be the very first statement in a constructor..
    Also you cannot access any instance variables until after super or this.
    :-S
    Kind regardsbut if you add the "print" statement in animal constructor, you can easily see what happened to the attributes of Dog ; that s the trick to print "before" super()You can never add a print before super(). It's a rule of thumb, super() and this() must always be the first statements
    in a constructor, whether added implicitly by the compiler or not. In this case there are 2 default constructors (inserted by the compiler), each with a super() invocation. Even if i added them myself and tried to print before super(), the compiler would complain.
    Thanks for the help & regards.you didn't understand what i meant ; take a look at that:
    class Animal {
       int weight;
       int age = 10;
       public Animal() {
           Dog thisAsADog = (Dog) this;
          System.out.println(thisAsADog.name);
          System.out.println(thisAsADog.x);
    class Dog extends Animal {
       String name;
       int x = 10;
    public class Test {
       public static void main(String[] args) {
          new Dog();
    }this way you will know what really does happen

Maybe you are looking for