Skip to Content
author's profile photo Former Member
Former Member

how to get seeburger work bench counter value

hi all,

i want to get the current counter value in the seeburger workbech counter.

i used the following function suggested in one of the threads in forum, but its giving the below error

func used:

try {

VariableBean be=VariableFactory.getVariableInstance("");

return be.getStringVariable(variableName);

} catch (Exception e) {

throw new RuntimeException(e);

}

error:

RuntimeException in Message-Mapping transformation: Exception:[java.lang.RuntimeException: java.lang.RuntimeException: VariableBeanServlet: Could not call getVariable() method of the Servlet. Cause=java.lang.ClassCastException]

i guess this above function is to get variable value and not counter value. can any body give me code to get counter value.

Thanks a lot in addvance

Regards,

Rashmi

Edited by: Rashmi H S on Aug 12, 2009 2:30 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2009 at 01:29 PM

    Hi

    Please use this function to get counter.

    imports com.seeburger.functions.permstore.impl.*;com.seeburger.functions.permstore.*;
       //write your code here
     try {
    CounterBean be=CounterFactory.getCounterInstance();
    return "" + be.nextCounter(counterName);
    } catch (Exception e) {
    throw new RuntimeException(e);
    }
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2009 at 03:03 PM

    HI ,

    In addition to above please check that The SeeFunctions tables must have been deployed in the J2EE server.

    Check in Seeburger Namespace under Imported Archives -->SeeFunctions.

    Java Code:

    try {

    CounterBean be=CounterFactory.getCounterInstance();

    return "" + be.nextCounter("MYCOUNTER");

    } catch (Exception e) {

    throw new RuntimeException(e);

    }

    Thanks & Regards,

    Anurag

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      use getCounter

      //write your code here

      try {

      CounterBean be=CounterFactory.getCounterInstance();

      return ""be.getCounter("counterName_"b"_"a );

      } catch (Exception e) {

      throw new RuntimeException(e.getMessage());

      will return the same counter what you have ,I also had same scenario what you are facing recently

      HTH

      Rajesh

      Edited by: Rajesh on Aug 13, 2009 7:49 PM

  • Posted on Aug 13, 2009 at 02:44 PM

    Hi Rashmi,

    If you use Counter Factory, the counter gets automatically incremented when you use the nextCounter function.

    For your requirement you have to use only Variables, which you have tried already.

    Check the function parameters that need to be passed when using the get functions of the Variablefactory class.

    May be , just send the actual variable name to the be.getStringVariable() function

    for eg if the variable name is VN

    retrun be.getStringVariable("VN");

    Regards,

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.