Global Constants / Variable in OSB

I want to define global Constants / Variable in OSB and I want to access them in XSLT when I am tranforming the requests...
Any idea how can I do that?
I want to use these variables and constants for server name and ports (in different environment) and some other stuff.

We have done a similar implementation for the same scenario. We have created a Xquery where we put in the configuration information as an XML and then in the pipeline stages we use the Assign the Xquery to a a temporary variable and then use the values of the xml using relative xpath expressions.
This way any time we need to make any changes to the confguration we know once place we can change and it gets reflected in the complete code base.
Below is how we have done it:
- create a Xquery with xml configurations (say commonconfig.xq)
- then using the Assign action get the output of this xquery into a temp var (say commonConfig)
- then use the configurable values using the relative xpath in the Assign action (say Assign $commonConfig/param1/text() to param1Value
Let me know if you need further information.
Thanks,
Patrick

Similar Messages

  • Best Practice for Global Constants in IRPT files?

    Hi,
    For Global constants that need to be accessed inside IRPT files and would only change as the code migrates from Dev->Test-> Production, what is the preferred method of storing and accessing these constants in a reusable way so that we donu2019t have to change the code of individual irpt files.  Additionally, this should not be stored in a code file, as the QA team is uncomfortable with changing code files as we migrate through environments. 
    It seems like just using a constant only .js file would work, but are there other methods and what is the preferred way of configuring global constants/variables?
    Thanks for the help.
    Kerby

    Hi Kerby,
    I was planning on putting all the config values in the database.  Then there is no changing of files that are inside the deployment package.
    Another idea, particularly if this is not a database app:
    What I did for a Portal dynpro app was have multiple properties files named with the host name.
    myDevHostName.properties and myQAHostName.properties and myProdHostName.properties. 
    They all got deployed with the app.  The code used the host name to open the appropriate file.
    Probably need a custom action block though because I only saw the IP address in the attribute
    list and not the server name.  And not so good when system names change...
    http://<servername>:<portnumber>/XMII/PropertyAccessServlet?mode=List&Content-Type=text/html
    --Amy Smith
    --Haworth

  • Question about using constant variables in Forms

    As I am still very new to Forms, please forgive my ignorance if the answer to my question is very simple. I am trying to figure out how to use constant variables within my Forms application. For example, if I want to setup return code constants for the application (mind me, these are examples):
    RC_SUCCESS CONSTANT PLS_INTEGER := 1;
    RC_FAILURE CONSTANT PLS_INTEGER := 0;
    RC_YEAR_DATA_NOT_FOUND := 50;
    Then in a module I created, if I wanted to check the return code against one of the constants I would do:
    DECLARE
    rc PLS_INTEGER;
    BEGIN
    GET_YEAR_DATA('2000', rc);
    IF rc = RC_YEAR_DATA_NOT_FOUND THEN
    -- Do some error handling
    END IF;
    END;
    I know that you can declare constants within individual procedures or packages but I can't see to find information on how to do this globally for the application. I've read about using global variables within Forms but the CHAR data type only and the fact the value can be changed doesn't really fit for this purpose. Am I missing something? Is there a config file or something for the webserver that can be used to set these up??
    Any help would be appreciated.
    Thanks

    To declare constants create a Package-Specification in a pll and deifne all your constants there, something like:
    PACKAGE PK_CONSTANTS IS
      RC_SUCCESS CONSTANT PLS_INTEGER := 1;
      RC_FAILURE CONSTANT PLS_INTEGER := 0;
      RC_YEAR_DATA_NOT_FOUND := 50;
    END;Then attach that pll to all your forms-modules, and use it like
    IF rc = PK_CONSTANTS.RC_YEAR_DATA_NOT_FOUND THEN
    END IF;A word about exceptions or errors: In my eyes its clearer (and in case of exceptions even better) to raise an exception than to hide it behind return-codes.

  • Comma problem with global string variable

    Hi,
    I'm fiighting with comma problem for global string variable. I've on page string for example "7nndqrr52vzyb,0" and by dynamic column link I'm assigning this string to global variable. Then I'm trying to display value of that global variable on another page but I see only string till comma, nothings more. I'm not sure what I'm doing wrong because when I'm trying to assign that value normally by computation process as a constant value is fine and see on another page correct string. I'll be really glad for help.
    Thanks
    Cheers,
    Mariusz

    When it tries to display the string, it sees the comma and wants to believe the string is terminated. You could escape the , in the string or replace it with a different character..
    See this link: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#BEIGDEHF
    Thank you,
    Tony Miller
    Webster, TX
    If vegetable oil is made of vegetables, what is baby oil made of?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Xquery with bind variable in OSB

    Hi,
    I have requirement to read XML file in Xquery as bind variable but it's giving error. I have included this file in OSB proejct but i dont know how to point this out using bind variable. I tried to read file using fn:doc and given file name but it's giving error.
    Any pointer here..
    Thanks

    a few other threads :
    How to use fn:doc() in ALSB
    Re: OSB: How read file xml that is into project OSB
    Caching XML Variable in OSB
    things you need to look at :
    xquery files aren't customizable
    xquery files itself are cached, the fn:foc function will be executed every time again
    so if you don't use the xml for other things, i would just registrate it as xquery file with the xml in it
    or you could use the synchronous file adapter to retrieve the data from the file

  • Creating a Package for Constant Variables

    Hi
    I expect this should be an easy question for some of you, but I am fairly new to PL/SQL!
    Anyhow, I would like to create an PL/SQL Script as a package, which holds a list of Constant Variables, which will be common across a number of PL/SQL Packages rather than having to repeat the constants again and again over a number of files and then having the worry of trying to maintain them all.
    Can someone please advise me how to create such a package?
    Thanks

    You can create the package this way:
    create or replace package myconst is
    const1 number := 0;
    const2 number := 2;
    end;
    /And you can optionally initialize your constants this way:
    create table myconstTable  (c1 number, c2 number);
    insert into myconstTable values (1,2);
    create or replace package body myconst is
    begin
      Select c1,c2
        into const1,const2
        from myConstTable;
    end;
    /And finally you can use it this way:
    set serverout on
    exec dbms_output.put_line(myconst.const1);
    1Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/18/table-elimination-oppure-join-elimination-lottimizzatore-si-libera-della-zavorra/]

  • Constant variable in control file - sqlldr

    Hi all,
    Is there a way to create a dynamic constant variable within the control file?
    I'm trying to load from a csv file but need just 2 values from the 1st row, as a constant for the inserts for the rest of the rows.
    How/can I use a variable and assign this value to it and use that variable inside the control file?
    For example: (first character: 1=header, 2=content)
    .csv file:
    1,constant1,constant2
    2,data11,data12
    2,data21,data22
    2,data31,data32
    2,data41,data42
    table:
    col1 col2 col3 col4
    data11 data12 constant1 constant2
    data21 data22 constant1 constant2
    data31 data32 constant1 constant2
    data41 data42 constant1 constant2
    Thank you soo much for your help
    Edited by: user9215527 on Nov 15, 2011 8:08 PM
    Edited by: user9215527 on Nov 15, 2011 8:11 PM
    Edited by: user9215527 on Nov 17, 2011 9:48 AM

    I am thinking about the following:
    1. Load the data into 2 separate tables (header and content)
    2. Update the content with the constant value from header.
    Question:
    Is there any other better way that I can do? Like can those 2 steps be done in a single control file?
    Pls help.
    ====================================================
    Step 1:
    load data
    infile 'test.txt'
    append
    into table zz_test_hdr
    when (1:1) = '1'
    ( constant_1 POSITION(2:12) ,
    constant_2 POSITION(13:23))
    into table zz_test
    when (1:1) = '2'
    ( col_1 POSITION(2:11),
    col_2 POSITION(12:22))
    Step 2:
    update zz_test
    set (col_3, col_4) = (select constant_1,constant_2 from zz_test_hdr);
    =============================================

  • How to define a global constant in OWB

    Hi,
    How can i define a global constant in a module, which can be used in all my mappings?
    ~Prabha

    I have the following approach.
    You can declare public constants within a package specification.
    Then, import this package spec into OWB repository.

  • How can I hide constant variable value in class file?

    hi,everybody.
    I am having a problem with constant variable which define connectted with database(URL,username,password).
    when I used UltraEdit to open class file, I can see constant variable value.
    Thanks!

    OK, let's see. Firstly, if I may correct your terminology, the phrase "constant variable" is a paradox (I think that is the right word). You have either one of the other. You declaration is either 'constant' or 'variable' (ie: it can change at run-time or it doesn't). People often use the term 'variable' and 'declaration' interchangably which is where the confusion lies.
    Anyway, onto the real problem. It seems that you want to protect your connection details (in particular the password, I would guess). Unfortunately, Java compiles not to machine-code, but byte-code which is semi-human-readable. So people, if they are inquisitive enough, will always be able to see it if they try hard enough.
    You can do one of two things:
    (1) Get an 'obfusticator'. An obfusticator is something that you run over Java source files and it completely messes it up (without modifying functionality). You then compile and the original source is such gibberish that the byte-code is very difficult to understand. However, the password will still be in there somewhere.
    (2) Don't put sensitive information into your source. Have this kind of info in external files (encrypted) and allow your class to read this file, decrypt, and use it.
    Hope that helps.
    Ben

  • Dealing with a turn based application with using a global static variable

    Hi there. I read some articles about JavaFX concurrency,so as a newbie i have to practice on it. Now i'm trying to implement a turn based application that can be played among 3-6 players. Moreover, i use a scene imported from a .fxml file and i have to update it correctly depends on some calculations of each thread (in other word players ). My main issue is, i don't wanna use a while loop which checks the state of game like;
    while( GameState != State.GAME_OVER ){
         currentPlayer = GameBoard.getNextPlayer();
         // do some actions,calculations etc.
    So, i want to use worker threads instead of this while loop. I guess using Service class for iterating and assigning the next player will be suitable instead of using the while loop and Tasks for doing each player's calculation,or waiting for some responses from Human players on UI based,however, i'm struggling with two problems.
    There should a global static variable ( like GameState which is an Enumarator ) determines the state of the game,so it should be updated and should be checked by each turn. Is there any way to do this ?
    How can i get rid off this while loop ?
    I will appreciate for every answer. Thanks anyway.

    It shouldn't make too much difference. The basic idea is that you have a model class representing your game state (the Game class in jsmith's example). When a player makes a move, you update the state of the game. Since this will result in changes to the UI, this update should be performed on the FX Application Thread.
    If the player making the move is a human player, the move will likely be made by a user action (button press or mouse click, etc); this will be handled on the FX Application thread anyway.
    When the state of the game changes so it is the turn of an "artificial" player to make a move, have the object representing the artificial player calculate its next move, and then update the game state. Since this is a response to the game state changing (it's now the turn of the artificial player), this will also be on the FX Application Thread.
    The only (slight) complexity comes if the calculation of the move for the artificial player takes a long time. You don't want to perform this long running calculation on the FX Application Thread. The cleanest way to manage this is to launch a Task which calculates the desired move, and then updates the game state when the move is ready. So, something like this:
    GameState game = ... ;
    // UI is bound to the game state.
    ExecutorService executorService = ... ;
    final Player currentPlayer = game.getCurrentPlayer() ;
    final Task<Move> calculateMoveTask = new Task<Move>() {
         @Override
         public Move call() {
              Move move = // compute next move...
              return move ;
    calculateMoveTask.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
         @Override
         public void handle(WorkerStateEvent event) {
              gameState.makeMove(currentPlayer, calculateMoveTask.getValue());
    executorService.submit(calculateMoveTask);
    If you're doing more threading than that, you're probably doing it wrong... . There should also be no need for anything to be held as a "global" static variable (the idea above is the only structural modification you need to the example posted by jsmith).

  • Global Container Variable

    Hi
    Give me idea on Global Container variable in Graphical mapping.
    Thanx in Advance

    Hi
    Ref this
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    http://help.sap.com/saphelp_nw04/helpdata/en/95/bb623c6369f454e10000000a114084/content.htm
    Design and Configuration [original link is broken]
    Thanks
    Sridhar

  • Global Counter Variable - Graphical Mapping

    Hi there.
    Can anybody help with implementing a global counter variable in the graphical mapping please.
    I am trying to populate the "SEGMENT" field of an IDoc with the correct sequence, i.e. add 1 for each new segment. The IDoc has several segments, most of which are embedded. I have tried using the "<b>counter</b>" function but this seems to reset back to one for each instance of it being called.
    I would appreciate any pointers.
    Thank you.
    Mick.

    Hi see this for implementation
    <b>defining Global Variables</b>
    ArrayList arrVI;
    int counter =0;
    <b>Initialization Section</b>
    arrVI= new  ArrayList();
    <b>assignment</b>
    arrVI.add(sVI[iLoopCounter]);
    counter++;
    <b>
    fetch Values</b>
    for (int i =0;i<counter;i++)
    result.addValue(arrVI.get(i)+"");
    Mudit

  • Global Application variable

    How do I set a global application variable in a Swing application?
    Namely
    MDI display opens a new window
    new window sets a variable
    close the new window and return to the MDI window
    MDI window needs to use the variable.
    Note: the new window is is its own class object.

    What are you talking about?
    Static variables are "global".
    In some class (it does not really matter which) define
    a static variable. O.K. now you have a "global"
    variable.
    Some people may say that this is "bad" programming
    practice, but it is what you asked for.public static variables of public classes are 'global' in the sense you can refer to them if anywhere in an application. Public classes are also 'global' in this sense.
    However, we don't call them global variables, they are class variables. A global variable is generally defined to be one that is associated with the running application. It has no context other than that. It can be used anywhere at any time without any qualifications. In other words, the are terrible.
    I had to maintain an application that had 50 or so global variables. Some of these variables represented the exact same piece of information so it was cruicial during modifications to make sure that they were kept in sync. Don't use this type of design.

  • Corrupt Global User Variable?

    We're running ICM 7.5 and over the weekend, calls stopped routing to one skill.  AT&T, our first line, worked with Cisco and after research/testing, came back with an answer that the global user variable was corrupt.  Has anyone experienced this?  It seems odd that out of the blue this becomes corrupt, especially over a weekend when call volume is low.
    My team, along with Network and AT&T did a process of elimination, removing translation route & global user to validate call routing and adding each piece back.  When the variable was added, call routing failed to backup routing.
    Thanks,
    Jill M Gorrie

    Hi,
    User variables are meant to be used in web forms and web forms only. You can certainly pass their values to business rules when you used them in POV or page section of the form during save. All you need to do is to create another business rule (local or global) variable in business rule on the corresponding dimension and use it in your business rule. If you enable running the business rule on save and using the form values for variables options in form properties, business rules would replace the values of business rule variables with the values that are set in user variables.
    Cheers,
    Alp

  • Implemenying Global constants through out a project or module in LABVIEW

    I am looking for the best method for implementing global constants in a project, the method I use now is to make a vi which returns a single indicator value that has been wired to a constant.  This works nicely but it seems like a lot of unnecessary overhead.  I was hoping for a way of performing something similar to a header file (*.h) in c which uses a #define preprocessed directive.  This has no overhead since it replaces the named constant with the global constant value.  A typedef is similar to this but it has the problem that the constant appears as a constant and does not allow for a custom icon to be associated with it.  I guess the ideal situation would be if typedefs allowed for custom icons on the block diagrams for constant instances.  Is this possible?  It would make coding much more readable.  A header file could be simulated with a library of typedefs (scripting might even allow a .h file to be auto-generated)  Any ideas on this.  Other solutions. 
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

    I look forward to the new LV8 features, I hope to begin the migration process this winter when work slows down a little.  The only advantage to a preprocessed directive is that is will replace the code before processing (like cutting and pasting the value in place of the constant, with no function call overhead.  This could only be a problem with CPU intensive code.  See the following "toy" example.
    //haven't been programming in c lately so don't jump on my syntax.
    #define PI 3.14
    void calculateManyCircleAreas()
    float area = 0.0;
    for (r=0;r<10000000;r++){area = (PI*r*r);
    void calculateManyCircleAreas2()
    float area = 0.0;
    for (r=0;r<10000000;r++){area = (getPI()*r*r);}
    float getPI(){return 3.14;}
    the first example simply replaces the named constant with a value, while the second example uses a function call, requiring pushing the return value on the stack along with an Instruction pointer, and 2 required jumps in program flow.  Your solution is none the less the best I have seen and what I am using.  Labview used to have the same problem with commenting (ie placing code in a case statement and hardwiring it to a false Boolean) where the code was not removed by the complier but simply not executed (not quite the same thing) but this too looks to be fixed in LV8.
    Thanks,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

Maybe you are looking for