One to one mapping in OMBPlus

Hello,
i'm looking for information how to create a mapping from one object (table) to one other object.
thanks

puts -nonewline stdout "Hostname : "; gets stdin Host;
puts -nonewline stdout "Port : "; gets stdin Port;
puts -nonewline stdout "Service : "; gets stdin Service;
puts -nonewline stdout "Database Version (10.1, 10.2) DbVersion : "; gets stdin DbVersion;
puts -nonewline stdout "Repository Owner : "; gets stdin ReposOwner;
puts -nonewline stdout "Repository User : "; gets stdin ReposUser;
puts -nonewline stdout "Repository User Password : "; gets stdin ReposUserPassw;
puts -nonewline stdout "Ombexample1.log location (d://path) : "; gets stdin LogPath;
set DEBUG off; ## TCL debug info off
set OMBDEBUG off; ## OMBPLUS debug info off
set OMBCONTINUE_ON_ERROR false; ## Continue execution of the script in case of errors
set OMBPROMPT on; ## Shows Current Context in OMB*Plus prompt
OMBDCC ## Display Current Context
puts "Connecting to the Design Repository..."
puts [OMBCONNECT $ReposUser/$ReposUserPassw@$Host:$Port:$Service USE REPOSITORY '$ReposOwner' USE SINGLE_USER_MODE]
puts "CLEANUP OF PREVIOUS EXECUTION"
puts "============================="
puts "Check existance of Location OMB_TRG_LOCATION.."
if ([lsearch -exact [OMBLIST LOCATIONS] "OMB_TRG_LOCATION"]>0) {
puts "OMB_TRG_LOCATION found... dropping..."
puts [OMBCC '/OMB_PROJECT1']; ## Change context to Project OMB_PROJECT1
puts [OMBDCC]
puts "First unregistering the Target location from the Control Centre (CC"
puts "before dropping this Target Location..."
puts [OMBCONNECT CONTROL_CENTER]; ## Connect to the Control Centre
puts [OMBUNREGISTER LOCATION 'OMB_TRG_LOCATION']
puts [OMBDROP LOCATION 'OMB_TRG_LOCATION']
puts [OMBDISCONNECT CONTROL_CENTER]
OMBCOMMIT
OMBCC '/'
puts "Check existance of Location OMB_SRC_LOCATION.."
if ([lsearch -exact [OMBLIST LOCATIONS] "OMB_SRC_LOCATION"]>0) {
puts "OMB_SRC_LOCATION found... dropping..."
puts [OMBDROP LOCATION 'OMB_SRC_LOCATION']
puts "Check existance of Project OMB_PROJECT1..."
if ([lsearch -exact [OMBLIST PROJECTS] "OMB_PROJECT1"]>0) {
puts "OMB_PROJECT1 found... dropping..."
puts [OMBDROP PROJECT 'OMB_PROJECT1']
OMBCC '/' ## Change Current Context to root
puts [OMBCREATE PROJECT 'OMB_PROJECT1']; ## Create an empy Project
puts [OMBCOMMIT]; ## Commit Changes
puts [OMBCC '/OMB_PROJECT1']; ## Change Current Context to OMB_PROJECT1
puts [OMBDCC]; ## Display the Current Context
puts "SOURCE DEFINITION"
puts "-----------------"
puts "Creating Source Location..."
puts [OMBCREATE LOCATION 'OMB_SRC_LOCATION' SET PROPERTIES(TYPE,VERSION,HOST,PORT, \
SERVICE_NAME,CONNECT_AS_USER,SCHEMA,PASSWORD) VALUES('ORACLE_DATABASE','$DbVersion', \
'$Host','$Port','$Service','SCOTT','SCOTT','tiger')]
puts -nonewline "Validate location... "; puts [OMBVALIDATE LOCATION 'OMB_SRC_LOCATION']
puts "Create Oracle Source Module, and assign Source Location..."
puts [OMBCREATE ORACLE_MODULE 'OMB_SRC_MODULE' \
SET PROPERTIES (DESCRIPTION) VALUES ('Source Module') \
SET REF LOCATION 'OMB_SRC_LOCATION' \
SET REF METADATA_LOCATION 'OMB_SRC_LOCATION']
puts -nonewline "Validate module... "; puts [OMBVALIDATE ORACLE_MODULE 'OMB_SRC_MODULE']
puts "Importing Metadata (SCOTT.EMP) from Database..."
puts [OMBCREATE TRANSIENT IMPORT_ACTION_PLAN 'IMPORT_PLAN' \
ADD ACTION 'IMPORT_ACTION' \
SET REF SOURCE TABLE 'EMP' \
SET REF TARGET ORACLE_MODULE 'OMB_SRC_MODULE']
puts [OMBIMPORT FROM METADATA_LOCATION FOR IMPORT_ACTION_PLAN 'IMPORT_PLAN']
puts ""
puts "TARGET DEFINITION"
puts "-----------------"
puts "Creating Target Location..."
puts [OMBCREATE LOCATION 'OMB_TRG_LOCATION' \
SET PROPERTIES(TYPE,VERSION,HOST,PORT,SERVICE_NAME,CONNECT_AS_USER,SCHEMA) \
VALUES('ORACLE_DATABASE','$DbVersion','$Host','$Port','$Service','$ReposUser','$ReposUserPassw')]
puts -nonewline "Validate location... "; puts [OMBVALIDATE LOCATION 'OMB_TRG_LOCATION']
puts "Create Target Module, and assign Target Location..."
puts [OMBCREATE ORACLE_MODULE 'OMB_TARGET_MODULE' \
SET PROPERTIES (DESCRIPTION) VALUES ('Target Module') \
SET REF LOCATION 'OMB_TRG_LOCATION' \
SET REF METADATA_LOCATION 'OMB_TRG_LOCATION']
puts -nonewline "Validate module... "; puts [OMBVALIDATE ORACLE_MODULE 'OMB_TARGET_MODULE']
puts "Create target Table EMP_TARGET in Target Module..."
puts [OMBCC '/OMB_PROJECT1/OMB_TARGET_MODULE']
puts [OMBCREATE TABLE 'EMP_TARGET' ADD COLUMN 'EMPNO' SET PROPERTIES(DATATYPE, PRECISION, SCALE) VALUES('NUMBER', 4, 0) ADD COLUMN 'ENAME' SET PROPERTIES(DATATYPE, LENGTH) VALUES('VARCHAR2', 10) ADD COLUMN 'JOB' SET PROPERTIES(DATATYPE, LENGTH) VALUES('VARCHAR2', 9) ADD COLUMN 'MGR' SET PROPERTIES(DATATYPE, PRECISION, SCALE) VALUES('NUMBER', 4, 0) ADD COLUMN 'HIREDATE' SET PROPERTIES(DATATYPE) VALUES('DATE') ADD COLUMN 'SAL' SET PROPERTIES(DATATYPE, PRECISION, SCALE) VALUES('NUMBER', 7, 2) ADD COLUMN 'COMM' SET PROPERTIES(DATATYPE, PRECISION, SCALE) VALUES('NUMBER', 7, 2) ADD COLUMN 'DEPTNO' SET PROPERTIES(DATATYPE, PRECISION, SCALE) VALUES('NUMBER', 2, 0)]
puts -nonewline "Validate table... "; puts [OMBVALIDATE TABLE 'EMP_TARGET']
puts " "
puts "MAPPING DEFINITION"
puts "------------------"
puts "Create mapping..."
puts [OMBCREATE MAPPING 'MAP1' SET PROPERTIES (GENERATION_LANGUAGE) VALUES ('PLSQL') ADD TABLE OPERATOR 'EMP' BOUND TO TABLE '/OMB_PROJECT1/OMB_SRC_MODULE/EMP' ADD TABLE OPERATOR 'EMP_TARGET' SET PROPERTIES (LOADING_TYPE) VALUES ('TRUNCATE_INSERT') BOUND TO TABLE 'EMP_TARGET' ADD CONNECTION FROM GROUP 'INOUTGRP1' OF OPERATOR 'EMP' TO GROUP 'INOUTGRP1' OF OPERATOR 'EMP_TARGET' BY POSITION]
puts -nonewline "Validate mapping... "; puts [OMBVALIDATE MAPPING 'MAP1']
puts "Connect to the Control Center for deployment/execution..."
puts [OMBCONNECT CONTROL_CENTER]
puts "Register the Target Location in the Control Center..."
puts [OMBALTER LOCATION 'OMB_TRG_LOCATION' SET PROPERTIES (PASSWORD) VALUES ('$ReposUserPassw')]
puts [OMBCOMMIT]
puts [OMBREGISTER LOCATION 'OMB_TRG_LOCATION' REUSE]
puts " "
puts "DEPLOYMENT"
puts "----------"
puts "Deploying Table EMP_TARGET..."
puts [OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'TABLE_DEPLOY_PLAN' \
ADD ACTION 'DEPLOY_TABLE' SET PROPERTIES (OPERATION) \
VALUES ('REPLACE') SET REFERENCE TABLE 'EMP_TARGET']
puts [OMBDEPLOY DEPLOYMENT_ACTION_PLAN 'TABLE_DEPLOY_PLAN']
puts [OMBDROP DEPLOYMENT_ACTION_PLAN 'TABLE_DEPLOY_PLAN']
puts " "
puts "Deploying Mapping MAP1..."
puts [OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'MAP_DEPLOY_PLAN' \
ADD ACTION 'DEPLOY_MAP' SET PROPERTIES (OPERATION) \
VALUES ('CREATE') SET REFERENCE MAPPING 'MAP1']
puts [OMBDEPLOY DEPLOYMENT_ACTION_PLAN 'MAP_DEPLOY_PLAN']
puts [OMBDROP DEPLOYMENT_ACTION_PLAN 'MAP_DEPLOY_PLAN']
puts " "
puts "EXECUTION"
puts "---------"
puts "Execute Mapping MAP1..."
puts [OMBSTART MAPPING 'MAP1' IN 'OMB_TRG_LOCATION']
puts [OMBCOMMIT]
puts "DISCONNECTING"
puts "-------------"
puts "Disconnect From Control Center... "
puts [OMBDISCONNECT CONTROL_CENTER]
puts "Disconnect From Repository..."
puts [OMBDISCONNECT]
puts " "
puts "======================"
puts "END OF OMBEXAMPLE1.TCL"
puts "======================"

Similar Messages

  • Need Help with One to One Mapping in SQL

    Can aynone please design me tables in Oracle .
    I want to have a two tables with one to one mapping .
    Following is the scenario.
    I have an Employee object and a Parking Space Object. The have a one to one relation i.e., an employee will always be associated to only one parking space, that parking space should not be associated to any other employee.
    It would be a great help .

    sb92075 wrote:
    We don't do homework assignments.I used to do my own... seems like a novel concept now-a-days :)

  • One mapping program for three diferent enviroments

    Hello there,
    I have developed a scenario in which an rfc requests a web service trough XI. In the process a BPM is involved together with some XSLT mappings.
         R3->XI->WebService
    The Web service request message looks like follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <cem:Z_ORDER_SEARCH xmlns:cem="http://XXXXXXXX/yyyyyyyyyyyy">
         <messageStructure/>
    </cem:Z_ORDER_SEARCH>
    Where "http://XXXXXXXX/yyyyyyyyyyyy" Is the web service destination.
    Everything works fine, but as I have to manage three different environments for Development, Quality and Production I need three different versions of the XSL mapping since destinations are not the same for Dev, Qlty and Production environments.
    I found out that I can get information of the sender using runtime parameters as follows:
    <xsl:param name="SenderSystem">
    I would like to evaluate this information to determine the target URL destination.
    If the sender is the development sender then the URL target is the development destination and so on.
    I tried the following code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:cemDev="http://developmentDestination"
    xmlns:cemQlty="http://qualityDestination"
    xmlns:cemPrd="http://productionDestination"
    xmlns:cem=""
    <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>
    <xsl:template match="/">
         <cem:mappingProgram/>
    </xsl:template>
    </xsl:stylesheet>
    This works all right, but I cannot insert code to evaluate the destination.
    On the other hand, this code is not valid:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:cemDev="http://developmentDestination"
    xmlns:cemQlty="http://qualityDestination"
    xmlns:cemPrd="http://productionDestination"
    xmlns:cem="">
    <xsl:param name="SenderSystem"/>
         <xsl:choose>
              <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemPrd"/>
              </xsl:when>
              <xsl:when test="string($SenderSystem) = 'QUALITY'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemQlty"/>
              </xsl:when>
              <xsl:otherwise>
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>
              </xsl:otherwise>
         </xsl:choose>
         <xsl:template match="/">
              <cem:mappingProgram/>
         </xsl:template>
    </xsl:stylesheet>
    Neither this one:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:cemDev="http://developmentDestination"
    xmlns:cemQlty="http://qualityDestination"
    xmlns:cemPrd="http://productionDestination"
    xmlns:cem="">
            <xsl:param name="SenderSystem"/>
            <xsl:template match="/">
         <xsl:choose>
              <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemPrd"/>
              </xsl:when>
              <xsl:when test="string($SenderSystem) = 'QUALITY'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemQlty"/>
              </xsl:when>
              <xsl:otherwise>
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>
              </xsl:otherwise>
         </xsl:choose>
         <cem:mappingProgram/>
          </xsl:template>
    </xsl:stylesheet>
    I tried this other code, which is obviously not valid:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <xsl:param name="SenderSystem"/>
              <xsl:choose>
                   <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://productionDestination">
                   </xsl:when>
                   <xsl:when test="string($SenderSystem) = 'QUALITY'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://qualityDestination">
                   </xsl:when>
                   <xsl:otherwise>
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://developmentDestination">
                   </xsl:otherwise>
              </xsl:choose>
         <cem:mappingProgram/>
    </cem:Z_ORDER_SEARCH>               
         </xsl:template>
    </xsl:stylesheet>
    So the only way I found to make it works is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <xsl:param name="SenderSystem"/>
              <xsl:choose>
                   <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://productionDestination">
         <cem:mappingProgram/>
                        </cem:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:when test="string($SenderSystem) = 'QUALITY'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://qualityDestination">
         <cem:mappingProgram/>
                        </cem:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:otherwise>
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://developmentDestination">
         <cem:mappingProgram/>
                        </cem:Z_ORDER_SEARCH>               
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
    </xsl:stylesheet>
    Unfortunately this doesn’t solve my problem, because I need to reproduce the mapping program three times in the document.
    Any ideas, or suggestions how to manage one mapping program for the three different environments?
    Thanks a lot in advance, Raú

    Hi there,
    I just found one way of getting this done. It may not be the better waw, but I post it in case it is helpfull.
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
         <!-- Sender System at runtime-->
         <xsl:param name="senderSystem"/>
         <!-- SenderSystem constants (development addressed by default)-->
         <xsl:variable name="qualitySenderSystem" select="'WHATEVERTHENAMEOFTHEQUALITYSENDERSYSTEM'"/>
         <xsl:variable name="productionSenderSystem" select="'WHATEVERTHENAMEOFTHEPRODUCTIONSENDERSYSTEM'"/>
         <!-- Mapping program template to be called-->
         <xsl:template name="mappingProgram" match="/">
              <!-- MAPPING PROGRAM-->
              <UNIQUE_MAPPING_PROGRAM/>
              <!-- END OF MAPPING PROGRAM-->
         </xsl:template>
         <!Receiver determination depending on senderSystem>
         <xsl:template match="/">
              <xsl:choose>
                   <xsl:when test="$senderSystem=$productionSenderSystem">
                        <xxx:Z_ORDER_SEARCH xmlns:xxx="http://production">
                             <xsl:call-template name="mappingProgram"/>
                        </xxx:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:when test="$senderSystem=$qualitySenderSystem">
                        <xxx:Z_ORDER_SEARCH xmlns:xxx="http://quality">
                             <xsl:call-template name="mappingProgram"/>
                        </xxx:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:otherwise>
                        <xxx:Z_ORDER_SEARCH xmlns:xxx="http://development">
                             <xsl:call-template name="mappingProgram"/>
                        </xxx:Z_ORDER_SEARCH>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
    </xsl:stylesheet>

  • One to one mapping question -- can I just map a lookup field for queries?

    I have a table with a state code. I'd like to have a "virtual lookup" on the java class to a region table. I.e., this java class "studies" has a state code. I can map a one-to-one to the descriptor class that has the ref table, but I'd like to have a property in the java class pre-mapped to the "region" field in this lookup so for querying i can just use:
    ReadAllQuery q = new ReadAllQuery();
    q.setReferenceClass(study.class);
    q.setSelectionCriteria(new ExpressionBuilder().get("Region").equal(Region));
    to get all the studies for a particular region.
    am I going about this wrong? or do I have to get the reference table descriptor fromt he one to one map and do something different?

    well,on the way home last nite, I realized I'd had a complete brain fart. I've done this before. I just set up a 1-1 map between descriptors and then built the query like this:
    q.setSelectionCriteria(new ExpressionBuilder().get("refFPO").get("FPO_NO").equal(FPO));
    You can get the pointer to the "refFPO" which is the the descriptor mapped 1-1, then appended the column you wish to get.
    I still went ahead and amended my class to include a read-only, non-toplink mapped attribute "FPO" which just gets the reference variable pointing to "refFPO.getFPO_NO();
    I answered my own question just in case anyone wondered ....

  • I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sending data to Message borker.(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to save file in SAP fold

    I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sends data to Message borker(thru JMS channel).(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to create file with same data what ever send to Message broker and put the file in SAP folder without touching mapping. Is it possible? Please advise with the steps. We are using the ICO for this senario. Quick response is appriciated.

    Hi Pratik,
         http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?quicklink=index&overridelayout=true
    This link might help.
    regards
    Anupam

  • One to one mapping issue - urgent

    Dear all SAP Experts,
    Client is requiring when we do Gate entry pass  one to one mapping ie, 1 gr = 1 GRn.
    Can you explain
    regards,
    ramanar

    I think, you want to sent a material outside & get back after some time.
    In SAP there is no option for creating Gate Pass in standard.
    But, try the below suggested procedure as a work around process;
    Repair Process (Reconditioning) via Returnable Gate Pass: -
    1. MM01 - Create Material Master for every Spare Part / Machinery to be sent to Vendor for Repair (Reconditioning) as Non-Valuated (Material Type "UNBW") (Do not extend Accounting and Costing views since you don't require postings of Stock value and consumption values, you only want to track the Service/Repair Charges)
    It's not necessary to have materials as Non-Valuated always, it depends on your requirement.
    2. MIGO - Goods Receipt > Others (Receive the quantities of these materials using Movement Type 501 / 511) - Only if Stock of Material is not available.
    3. ME21N - Create Subcontracting PO (Here Main Material and Component will be same material)
    4. MB1B - Transfer Posting w.r.t. Subcon PO (Mvmt Type - 541, Spare Part stock will get posted to Vendor Stock)
    5. MB90 - Take Print out of this Material Doc as Returnable Gate Pass (U need to configure Message Determination of Inventory Mgmt)
    6. MIGO - GR against Subcon PO (101 - Receive Spare Part, 543 O - Consumption of Spare Part form Vendor Stock)
    7. MIRO - LIV for Service Charges w.r.t. Subcon PO
    8. MIGO - Goods Issue > Others (Do GI of Subcontracted Material using Movement Type 502 or 512)

  • Many to One Mapping issue

    Hi Experts,
    I am currently facing issue with many to one mapping . I have a source schema called revenue having Profit and Profit GST which is looping multiple times. I need to copy the name,value and GST value for each type into the destination schema.
    i am using Looping funtiod to create item profit records and than copying name and value from source to destination but the problem statement is that i am unable to map the GST value
    Thanks
    Abhishek

    could you post the schema definition please
    well why i am asking is, in General matching the records will be based on common node values in corresponding records.
    Assume you have 2 records of Profit and 2 records of ProfitGST in the source message like below, you cannot match the records unless you have some value common in both the records. i mean there should be some common node or attribute value that exits in
    both records.
    assume the following sample with 2 records each
    <ns0:Revenue xmlns:ns0="http://TestSample">
    <ns0:profit availabilityIncentivePayment="342" increasedCapacityCharge ="121" increasedCapacaityPayment="231" />
    <ns0:profit availabilityIncentivePayment="100" increasedCapacityCharge ="110" increasedCapacaityPayment="120" />
    <ns0:profitGST availabilityIncentivePayment="55" increasedCapacityCharge ="21" increasedCapacaityPayment="23"/>
    <ns0:profitGST availabilityIncentivePayment="150" increasedCapacityCharge ="160" increasedCapacaityPayment="170"/>
    </ns0:Revenue>
    if you observe the above sample instance, it does have 2 records each, but Profit record's nodes values
    are no where common with ProftGST record's node values.
    And for every Profit record, you want to pick corresponding GST value from ProfitGST record. However, since you don't have atleast one common node/attribute value here, you will not find a way to relate corresponding records. Means while mapping the first
    record of Profit, it cannot decide which record's nodes values in the ProftGST should pick to match as there are 2 records of ProfitGSt and with no relation with Profit Records.
    if the requirement is such that the records should be matched by the order(index) irrespective
    or the values in them, then that can be achieved easily with postion() function in the for loop.  just try to use code some thing like below sample xslt script like below, apply the proper name spaces and put full names as applicable in your scirpt, mould
    it as per your need
    <ns0:Root>
    <xsl:for-each select="Profit">
    <Profit>
    <xsl:if test="@availabilityIncentivePayment">
    <name>
    name>availabilityIncentivePayment</name>
    </name>
    </xsl:if>
    <xsl:if test="@increasedCapacityCharge">
    <Value>
    <xsl:value-of select="@increasedCapacityCharge" />
    </Value>
    </xsl:if>
    <xsl:if test="../profitGST/@availabilityIncentivePayment">
    <ProfitGSt>
    <xsl:value-of select="../profitGST/@availabilityIncentivePayment[position()]" />
    </ProfitGSt>
    </xsl:if>
    </Profit>
    </xsl:for-each>
    </ns0:Root>
    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Fixed width file outgoing with header,detail and trailer in one map

    we have a scenario where in we have to create an output file. the file is fixed width with three different kinds of records namely header, details and trailer. if the specification of the metadata of the file is specified how will we incorporate the creation of the file in one map since the map produces only one call to UTL_FILE and writes it.
    there is a work around in a crude way where in we can define the file as a CSV and pass everything in an appanded string in one column. but i wanted to know how we can get the three logical records in one map..
    thanks
    kamal

    The problem is not with generating the records.. i mean header , detail and trailer.
    it is how we put them into a fixed width sampled file. if we look at the code generated we will see only one call being made to generate the file.

  • Best Practive - One mapping reading multiple source files

    I want to develop a solution for one single mapping reading multiple similar source files that are stored on different directories on my OWB server. I want to be able to determine on runtime of my mapping from what location to load the source file from.
    Example:
    Mapping: Load_test_data
    source file 1: c:\input\loc1\test.dat
    source file 1: c:\input\loc2\test.dat
    When I run the mapping I would like to use an input parameter specifying the location loc1 or loc2. I would also like to use this input parameter in my mapping to populate one column in my target table with the value of this input parameter. This design would make it possible to dynamically load source files from different directories and also being able to see after loading where the data came from.
    Questions:
    - Is there a way to create such a design
    - If not, what alternative would be appropriate.
    Thanks in advance for the feedback

    Thanks for the feedback. Unfortunately I do not use workflow together with my OWB.
    I now indeed specified the file name and file location in the configuration of my mapping. However I am not able to change then upon executing the mapping. Data file name and file location are empty and greyed out when I execute my mapping. It always takes the values I specified in the configuration of my mapping
    What I would like to do is specify the location upon runtime when I execute my mapping, but I don't know if this is possible. In addition I'd also want to use the data file location as an input parameter for one of the columns I populated in my target table.
    Then in the end I would be able to use one mapping and read multiple sources files from different locations and also be able to check in the end where the data was loaded from.
    Hope you can give me some more feedback on how to set this up in OWB.
    Many Thanks!
    data file name parameter to ma

  • How to use the One-to-One mapping in Java Code

    Dear all:
    I have set the direct mapping and named query,
    and have written web service of login.
    I can login successfully.
    Now,I want learning about One-to-One mapping.
    I have setting the One-to-One mapping,
    then what can I do latter?
    I do not found any paper showing how to use it in web service?
    Somebody help me?thx all.

    Following code worked for me:
    import oracle.javatools.resourcebundle.BundleFactory;
    import java.util.ResourceBundle;
    * This method retrieves localized strings from a given XLIF resource bundle.
    * @param bundleName The XLIF bundle from which the localized string is to be retrieved.
    * @param key The key of the localized string.
    * @return The localized string retrieved from the given XLIF bundle.
    public static String getXlifLocalizedString(String bundleName, String key) {
    if (StringUtils.isEmpty(key)) {
    return key;
    if (StringUtils.isEmpty(bundleName)) {
    return "[" + key + "]";
    String localizedString = null;
    ResourceBundle resourceBundle = null;
    try {
    resourceBundle = BundleFactory.getBundle(bundleName);
    localizedString = resourceBundle.getString(key);
    } catch (Exception e) {
    LOG.log(Level.SEVERE, "Problem in loading XLIF resource bundle: " + bundleName, e);
    return "[" + key + "]";
    return localizedString;
    }

  • Copying Mapping from existing multple mapping to One to one mapping

    Hi Experts,
    I am having a scenario in which I am doing one to three mapping.
    I have a input file and I am tarnsforming it to three files HEADER, DETAIl and FOOTER.
    I am using only one mapping for it and it is completed.
    Now I need to do one to one mapping for each HEADER, DETAIL and FOOTer.
    Is there any way that I can copy my mapping from the existing one and do the one to one mapping.
    Regards
    Pradeep

    Hi,
    I guess it should be possible to copy your mapping (3 times) and remove the parts that you don't need.
    The problem (in PI 7.0) is that if you have more than one message at the target side and reduce it to one message your field mappings are lost.
    You can avoid this if you set the occurence of your target message to 0.. unbounded.
    If you don't want to do this you could copy for all fields the last field before the target field (right click on field -> copy) and paste it in your new mapping (this will copy your complete mapping structure).
    Regards
    Patrick
    Edited by: Patrick Koehnen on Jan 12, 2009 11:48 AM

  • Variable one to one mapping question

    I'm trying to create a variable one to one mapping using an interface with two implementing classes. The problem that I have is that I have two different values in the class indicator column that I wish to map to the same class. Mapping workbench doesn't let me do this. The MW documentation discusses using unique primary keys by leaving the class indicator blank. However, i'm using 9.0.4.8 and this doesn't appear to work as I get exceptions at runtime.
    Is there anything along the lines of the inheritance classextraction method for interfaces? Any suggestions for how to go about this?
    Thanks in advance,
    Jonathan

    Hi Jonathan,
    This use case is not supported in the Workbench. You will have to define an After Load Method in the workbench and add the indicator->class mappings in code. I am not positive on how this is handled in the runtime. Which indicator would be used when writing, maybe only supported for read-only mappings, or possibly not supported at all? Someone from the runtime team can respond about this.
    Karen

  • Missing Descritpor for One to One Mapping

    Hi,
    I have a one to one mapping from an Object A to Object B. When I execute the code, I get an exception as given below. Has any one encountered the same problem ?
    Appreciate your help.
    Thanks
    Priya
    Local Exception Stack:
    Exception [TOPLINK-7009] (OracleAS TopLink - 10g (9.0.4) (Build 031126)): oracle.toplink.exceptions.ValidationException
    Exception Description: Missing descriptor for [class oracle.toplink.indirection.ValueHolder]. Verify that the descriptor has been properly registered with the Session.
         at oracle.toplink.exceptions.ValidationException.missingDescriptor(ValidationException.java:599)
         at oracle.toplink.publicinterface.UnitOfWork.registerObject(UnitOfWork.java:3086)
         at oracle.toplink.mappings.ObjectReferenceMapping.buildCloneForPartObject(ObjectReferenceMapping.java:50)
         at oracle.toplink.internal.indirection.BasicIndirectionPolicy.cloneAttribute(BasicIndirectionPolicy.java:82)
         at oracle.toplink.mappings.ForeignReferenceMapping.buildClone(ForeignReferenceMapping.java:160)
         at oracle.toplink.internal.descriptors.ObjectBuilder.populateAttributesForClone(ObjectBuilder.java:1493)
         at oracle.toplink.publicinterface.UnitOfWork.cloneAndRegisterNewObject(UnitOfWork.java:580)
         at oracle.toplink.publicinterface.UnitOfWork.internalRegisterObject(UnitOfWork.java:2261)
         at oracle.toplink.publicinterface.UnitOfWork.registerObject(UnitOfWork.java:3093)
         at com.starkey.cqm.dao.PersistenceManager.createObject(PersistenceManager.java:65)
         at com.starkey.cqm.bcs.AdminService.saveRoute(AdminService.java:217)
         at com.starkey.cqm.web.RouteAction.processCreate(RouteAction.java:183)
         at com.starkey.cqm.web.AdminAction.execute(AdminAction.java:50)

    Looks like you've mapped from ObjectA to ObjectB but accidentally set the target class to be ValueHolder. Except for the checkbox in the Mapping Workbench, you shouldn't need to specify ValueHolder in any of your mappings.

  • Variable One-to-one mapping

    i am working on variable one-to-one mapping. i am unable to figure out how to work on it. can anybody provide an example on how to implement it from java and toplink perspectives.

    Thank you. I have gone through the links. i used class indicator field method. I am still getting error saying
    "Exception Description: Missing descriptor for [class java.lang.String]. Verify that the descriptor has been properly registered with the Session."
    My code and table structure is as below.
    Interface - VariableOneToOne
    Implementation classes: Phone and Email
    Table Structure:
    Employee Table:
    ID (PK)
    Name
    TYPE (mapped as variable one-to-one)
    C_ID(FK to eid and pid)
    Phone Table:
    pid (PK)
    phnumber
    Email Table:
    eid (PK)
    emailaddress
    "TYPE" is of string type. "Phone" or "Email" is sent from this attribute. Toplink instantiates the respective class from the configurations specified in the variable one-to-one mapping of "TYPE" attribute in workbench.
    The classes and interface code is as below:
    Inteface:
    package com.cts;
    public interface VariableOneToOne {
         public int getId();
         public void setId(int id);
    Employee Class:
    package com.cts;
    public class Employee2{
         protected int id;
         protected String name;
         protected String type;
         protected VariableOneToOne phone;
         protected VariableOneToOne email;
         public Employee2()
              this.id = 0;
              this.name = null;
              this.type = null;
              this.phone = null;
              this.email = null;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public String getType() {
              return type;
         public VariableOneToOne getEmail() {
              return email;
         public void setEmail(VariableOneToOne email) {
              this.email = email;
         public VariableOneToOne getPhone() {
              return phone;
         public void setPhone(VariableOneToOne phone) {
              this.phone = phone;
         public void setType(String type) {
              this.type = type;
    Email Class:
    package com.cts;
    public class Email2 implements VariableOneToOne {
         protected int id;
         protected String email;
         public Email2() {
              this.id = 0;
              this.email = null;
         public String getEmail() {
              return email;
         public void setEmail(String email) {
              this.email = email;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
    Phone Class:
    package com.cts;
    public class Phone2 implements VariableOneToOne {
         protected int id;
         protected String phone;
         public Phone2()
              this.id = 0;
              this.phone = null;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getPhone() {
              return phone;
         public void setPhone(String phone) {
              this.phone = phone;
    Please advice on resolving the issue.
    Thanks in advance.

  • No cache hit on one-to-one mapping

    I am experimenting with toplink and have found that toplink does not use cache when I read a object having one-to-one mapping with other object that have been already in memory.
    e.g. I have an employee class that have a field with one-to-one mapping (with no indirection) to a department class
    I have two objects of the employee class, that share the same object of department class (they work in the same department)
    When I read (using readObject ) first object of the employee class, I expect an referenced object of the department class is read and placed in the session cache.
    However when I read second object of the employee class, I recognized that toplink again issue SQL command to read the department class's object

    Hello,
    Is employee-> department mapping using the full department pk in the reference? TopLink by default uses the check cache by primary key on all queries. This means that when the Employee object is built, it will query for the department object. This will cause it to search the cache for the department object only if it can create the full pk from the foreign key fields in the employee table, otherwise it will go to the database. Even though it may go to the database, it will still return the object from the cache to maintain object identity - it will only build the department object if one does not already exist with that pk in the cache.
    Another circumstance this behaviour could occur is if the department object is removed from the identity map through garbage collection, or if no identitymap is being used.
    Please check http://download-west.oracle.com/docs/cd/B10464_01/web.904/b10313/queries.htm#1134704
    for info on TopLink queries with respect to the cache. If this is what is happening in your case and you want to have this specific department query go to the cache first, you can change it using an ammendment method on the employee descriptor. in the ammendment method, you will need to get the department mapping and use the getSelectionQuery() api to modify the associated query.
    Best Regards,
    Chris Delahunt

Maybe you are looking for