Compare two complex variables with BPEL ?

Hi,
I would like to compare 2 csv files with BPEL, with specific rules. For example, I would like to check that for each row : "Value of Field1 of File1" has less than a 10% difference with "Value of Field1 of File2"
I can successfully retrieve the content of the files, thanks to the following thread : Help! Three questions about FileAdapater. . Now the files are in 2 variables.
What is the right method to compare the variables, row by row with this kind of specific validation rules ? Should I handle it with a Java call ? Especially, where should be the loop on rows : in BPEL (if so : how ?) or Java ?
Regards,
Alexandre
Message was edited by:
Alexandre

I suggest having a look at the Array sample (orabpel\samples\tutorials\112.Arrays)
that shows how to loop through an array.
Whether to do this in BPEL of Java depends on a lot of circumstances, but I suggest giving this a try first.

Similar Messages

  • Functinality to compare two material price with reference to BOM in CO

    Hi All,
    Is there is any functionality in Controlling which can compare the costing for two FERT materials.
    or
    is there is  any functionality where we can compare two material price with reference to BOM in controlling
    Please help me to compare the material price with reference to BOM
    Regards
    nandu

    Hi,
    You can use this report to compare two itemizations. The report compares the characteristics item number, item category, cost element, resource, material, cost center, plant/work center, cost center/activity type, operation number, BOM item, assembly indicator, and cost component.
    You can access this report as follows:
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Material Costing ® Cost Estimate with Quantity Structure or Cost Estimate Without Quantity Structure ® Compare
    or
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Information System ® Object Comparisons ® For Material ® Itemization Comparison.
    For Detail Please reffer following link:
    http://help.sap.com/saphelp_46c/helpdata/en/56/abd108f1a611d28a950000e8214595/content.htm
    Thanks and Regards
    Binoj M D

  • Compare two dynamic variables

    Hello,
    I'm struggeling comparing two variables against each other as seen below. I have some AD-group names in a csv file, and I have a  variable($getGroup) with results from a Get-ADGrup-query.
    I'd like to filter out the groups of the csv-file from the variable, so "$getGroup" in this example should end up empty. 
    In the example below, the return is the two groups, so it doesn't get filtered out. How can I do that?
    Contents of exclude.csv:
    Name,Comment
    "AD,Group1","Some comment"
    "AD*Group2","Some comment"
    $excluded = Import-CSV 'C:\temp\exclude.csv'
    $getGroup = Get-ADGroup -Filter * | Where-Object {$_.Name -like '*,*' -or $_.Name -like '*#*' -or $_.Name -like '*+*' -or $_.Name -like '*"*' -or $_.Name -like '*\*' -or $_.Name -like '*<*' -or $_.Name -like '*>*' -or $_.Name -like '*;*'}
    #At this point $getGroup returns two groups; AD,Group1 and AD*Group2
    $getGroup = $getGroup | Where-Object {$_.Name -notlike $excluded.Name}
    $getGroup

    Hi,
    If you have actual group names in your input CSV, try this:
    $excludedGroups = Import-Csv .\excludeGroups.csv | Select -ExpandProperty Name
    Get-ADGroup -Filter * -SearchBase 'OU=Testing,DC=domain,DC=com' |
    Where { $excludedGroups -notcontains $_.Name }
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Compare two dropdownlists values with each other!!!!!!

    Hi ,
    I have two dropdown s with some values i want to compare two dropdowns values. I have java script on the click event of the button it will compare values of drodpowns. If any redundant/duplicate value found then those values need to be deleted from the second dropdown.
    function dummy()
    var dd1=xfa.resolveNode(form1.Page1.State.somExpression);       //path to first dropdown
    var dd2 = xfa.resolveNode(form1.Page1.Dummy.somExpression);  //path to second dropdown
    var i =0;
    var j=0;
    if(State.length!= 0)//State is first dropdown
         for (;i<dd1.length;i++)
              for(;j<dd2.length;j++)
                   if(dd1.getDisplayItem(i)==dd2.getDisplayItem(j))
                       dd2.deleteItem(j);   //deleting the value from second dropdown.
                        break;
                   else
                        continue;
    But this function is not working properly it is taking first value of the DD1 and comapring with all the values of DD2 and coming out of the loop .There are other values in the DD1.So for that comapring is not happening.
    Please help me !!!
    Thanks in advance,
    Bharathi.

    Hi,
    You just need to re-initialise the j variable each time though the i loop.  As you have it the second time around j will already be equal to dd2.length so will skip the inner loop.
    try
    for(var j=0;j<dd2.length;j++)
    Regards
    Bruce

  • How can i compare two excel files with different no. of records.

    Hi
    I am on to a small project that involves us to compare two excel files. i am able to do it but am struck up at a point. When i compare 2 different .csv files with different no. of lines i am only able to compare upto a point till when the number of lines is same in both the files.
    Eg. if source file has 8 lines and target file has 12 lines. The difference is displayed only till 8 lines and the remaining 4 lines in source lines are not shown.
    Can you help me in displaying those extra 4 lines in source file. I am attaching my code snippet below..
    while (((strLine = br.readLine()) != null) && ((strLine1 = br1.readLine())) != null)
                     String delims = "[;,\t,,,|]";
                    String[] tokens = strLine.split(delims);
                    String[] tokens1 = strLine1.split(delims);
                   if (tokens.length > tokens1.length)
                    for (int i = 0; i < tokens.length; i++) {
                        try {
                            if (!tokens.equals(tokens1[i])) {
    System.out.println(tokens[i] + "<----->" + tokens1[i]);
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + tokens1[i]);
    out.println();
    sno++;
    } catch (Exception exception)
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + "");
    out.println();
    Thanks & Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    A CSV file is not an Excel file.
    But apart from that your logic makes no sense.
    If the 2 files are of different sizes the files are different by definition, so further comparison isn't needed, you're done.
    If you want to compare individual records, you need to compare all records from one file with all records from the other, unless the order of records is important in which case your current system might work.
    That system however is overly complicated for comparing CSV files.
    As you assume a single record per line, and if one can assume those records to have identical layout (so no leading or trailing whitespace in or between columns in one file that's not in the other) comparing records is simply a matter of comparing the entire lines.

  • Automating the process of comparing two PDF file with the help of QTP(Automation Testing Tool)

    Can anybody help me with comparing the two pdf files with the help of QTP.I have Adobe Acrobat installed on my system and i have access to the API.
    Thanks,
    Varun Saini

    I want to find out more about QTP and API. Maybe that is what I want to compare two mechanical drawings for differences between them. (see “More than one pdf file in one window”. Is that what you are looking to do? 9Not necessarily mechanical drawings but some other pdf).

  • Comparing two data sets in BPEL

    Hey guys,
    There exists a web service that provides (and is the source of) data and a table that is independent of the service that holds the same data. I'm writing a BPEL 11g process to sync the data that is returned from the service with the data in the table. I invoke the service and database adapter to receive a collection of the data and I need to compare the two data sets to see what's in the service's data set that isn't in the table's data set, so that I can insert them into the table. I also need to compare the values of the data sets for possible updates to already existent records. I'm not sure how to do this though. I was thinking of using an embedded java activity to compare the two sets. What's the best way to do this? Code examples would be much appreciated.
    Thanks,
    Bill

    Hi Bill,
    How many records are we talking about here? BPEL may not be the best option for synchronisation of large data sets... Probably ODI would be more suitable...
    S.Ananth's solution is probably the simple and neat way to solve your case... would this operation BLINDLY update all records? Short answer: no
    Long answer... Merge first reads the corresponding records in the database, calculates any changes, and then performs a minimal update. INSERT, UPDATE, and MERGE make the most sense when you are thinking about a single row and a single table. However, your XML can contain complex types and map to multiple rows on multiple tables. Imagine a DEPT with many EMPS, each with an ADDRESS. In this case, you must calculate which of possibly many rows have changed and which to insert, update, or delete. If a specific row did not change or only one field changed, then the DML calls is minimal.
    About merge on DBAdapter...
    http://docs.oracle.com/cd/E28280_01/integration.1111/e10231/adptr_db.htm#BDCDBAJI
    Cheers,
    Vlad

  • How do i compare value javascript variable with jsp variable

    I have promblem .I have variable that store store the attribute value of column .The colum has more then one value.How to i compare with javascript value .Currently I am using the following method .
    <%String sql_query3 = "SELECT DISTINCT (ir_tran_typ),ir_rea_desc "+
                                              "  FROM intrcd "+
                                              " GROUP BY ir_tran_typ ";
                               System.out.println("trans type"+sql_query3 );           
                                try{
                                    rset = db.execSQL(sql_query3);
                                catch(SQLException e) {
                                    System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query3);
                                while(rset.next()== true){
                                    tran_cde = rset.getString("ir_tran_typ");
                                            rea_desc = rset.getString("ir_rea_desc");%>
                                            <%System.out.println("trans type 34 "+tran_cde );%>
                                                 //tran_typ = addElement('<%=tran_cde%>');
                                                 <% }%>
                                      if(obj.value== '<%=tran_cde%>' ){      
    <%                                 String sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                              "  FROM intrcd"+
                                              " WHERE ir_tran_typ = '"+tran_cde+"' " +
                                                        " ORDER BY ir_rea_cde ";
                               System.out.println("trans type"+ tran_cde);           
                                try{
                                    rset = db.execSQL(sql_query2);
                                catch(SQLException e) {
                                    System.err.println("Error in query - emmast2 - transaction_main.jsp " +e +" sql " +sql_query2);
                                        index = 1;
                                while(rset.next()== true){%>
                                document.all.rea_cde.options[<%=index%>] = new Option(eval('"<%=rset.getString("ir_rea_cde")%>"'));
                                document.all.rea_cde.options[<%=index%>].value = eval('"<%=rset.getString("ir_rea_cde")%>"');
                                document.all.rea_cde.options[<%=index%>].text = eval('"<%=rset.getString("ir_rea_desc")%>"');
    <%                          index++;
                                       }%>
    please replay me soon
    thank you.

    javascript and java do not mix.
    Java code runs, and produces HTML/javascript.
    Java code stops running.
    The page loads in the browser, and it starts up javascript.
    Javascript cannot talk to java and vice versa.
    Your JSP can generate javascript code onto the page to be executed on the client, but they never directly communicate.
    please replay me soongame over dude ;-)

  • Comparing two column values with multiple Parameter in VC (Indicator)

    Hello VC experts,
    GM
    I would like to know about how to indicate multiple parameter with different colour in same column and also comparing value with adjucent column.
    Eg.
    Parameters     ,,           Column1      ,,              Column 2       ,,            Indicator (Image)
    Parameter 1    ,,             a1             ,,                     b1          ,,                  RED
    Parameter 2    ,,            a2              ,,                     b2          ,,                  GREEN
    Parameter 3    ,,            a3              ,,                     b3          ,,                 
    Parameter 4    ,,            a4              ,,                     b4          ,,
    In case I  : Parameter -1     Column 1 ( value)  =  more is better compared to Column 2
    In case II : Parameter -2     Column 1 ( value)  =  Less is better compared to Column 2
    How to acheive this  INDICATOR based value comparison.
    Edited by: Sunil  B. Mundhe on Mar 7, 2009 6:30 AM
    Edited by: Sunil  B. Mundhe on Mar 7, 2009 6:38 AM

    Hi
    This is possible in VC. You have to insert 'Image' UI in the required table. Add images of alert through 'Image manager' (Tools tab). Select relevant images of alert in 'Image' UI. In display there is option for 'visibility condition' there you enter condition (like if greater than ,true,false).
    Like wise you can add multiple 'Image' UIs in that table & based on visibility conditions you will get these alert images in table.
    Regards
    Sandeep

  • VORowImpl problem - comparing two ROW[] lists

    Hi Everyone,
    I have a huge proble right now, I'm trying to compare two VO list with the same values, this is because one it's attached to an advancedtable in the xml page wich the user can change some values, and the other one is from the values of the table but from the DB, the reason is to made a validation to compare the original values from the DB with the list from the tabla and update only the rows that the users made changes in their values, here's my code for a better explain of what I'm doing:
    public void saveChanges(){
    OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getDBTransaction();
    Row[] rows1 = getAppVO1().getAllRowsInRange();
    Row[] rows2 = getDBVO1().getAllRowsInRange();
    for(int i = 0; i < rows1.length; i++){
    int j = i;
    //Colections to compare
    //r1: colection from the app
    //r2: colection from BD
    AppVORowImpl r1 = (AppVORowImpl) rows1;
    DBVORowImpl r2 = (DBVORowImpl) rows2[j]; //<--- here in the second iteration appears the following error:
    // "oracle.apps.fnd.framework.OAException: java.lang.ArrayIndexOutOfBoundsException: 1"
    //variables string to check if got changes in the column
    String columnAPP = r1.getId().toString();
    String columnBD = r2.getId().toString();
    //'if' that validates changes
    if(!columnAPP.equals(columnBD)){
    //String variable SP
    StringBuilder procedureCall = new StringBuilder();
    //calling to SP
    try{
    procedureCall.append("... stored proc...");
    OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransactionimpl.createCallableStatement(procedureCall.toString(), -1);
    oraclecallablestatement.execute();
    getOADBTransaction().commit();
    }catch(SQLException sqlexception){
    System.err.println("SQL Exception: "+ sqlexception.getMessage());
    getOADBTransaction().rollback();
    throw OAException.wrapperException(sqlexception);
    }catch(Exception e){
    System.err.println("Exception: "+ e.getMessage());
    getOADBTransaction().rollback();
    throw OAException.wrapperException(e);
    the first iteration works fine, but the second and futher shows an exception error, what can I do to make this method works?
    I'll be pending to your answers, I really hope you can help me with this one
    Regards,
    Mentor

    Here is the dump code for you. Code you have to write in AmImpl and call the same from Controller class.
    AMImpl Code
    public void executeBothViewObjects() //Calls this method from Controller *ProcessRequest*
            OAViewObject vo = (OAViewObject)getMainViewObjectVO1();
            OAViewObject dvo = (OAViewObject)getDBViewObjectVO1();
           if (vo != null && dvo != null)
                         //1st VO
                           dvo.setWhereClauseParams(null);
                          //Set where clause if Any  dvo.setWhereClauseParam(0,xx);
                          dvo.executeQuery();  
                         //2nd VO
                         vo.setWhereClauseParams(null);
                          //Set where clause if Any  dvo.setWhereClauseParam(0,xx);
                         vo.executeQuery(); 
    public void compareViewObject()   // Calling this method to compare Attribute of both View Object *Process Form Request*
          OAViewObject vo = getMainViewObjectVO1();
          OAViewObject OrigVO = getDBViewObjectVO1();
          MainViewObjectVORowImpl rowi = null;
          DBViewObjectVORowImpl rowii = null;
          int fetchedRowCount = vo.getRowCount();
          int OriginalfetchedRowCount = OrigVO.getRowCount();  
         RowSetIterator originalSelectIter = OrigVO.createRowSetIterator("originalSelectIter");
         RowSetIterator selectIter = vo.createRowSetIterator("selectIter");
         if (fetchedRowCount > 0 && OriginalfetchedRowCount >0)
              selectIter.setRangeStart(0);
              selectIter.setRangeSize(fetchedRowCount);
              originalSelectIter.setRangeStart(0);
              originalSelectIter.setRangeSize(OriginalfetchedRowCount);
              for (int i = 0; i < fetchedRowCount; i++)
                rowi = (MainViewObjectVORowImpl)selectIter.getRowAtRangeIndex(i);
                rowii = (DBViewObjectVORowImpl)originalSelectIter.getRowAtRangeIndex(i);
               //Compare Attribute here
                   if((!(rowi.getRoleStartDate().equals(rowii.getRoleStartDate()))
                            // Comparing Start date here of both View Object
                 else if(((rowi.getRoleEndDate().equals(rowii.getRoleEndDate()))
                       // Comparing End date here of both View Object
    }Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • Comparing two xml files in pl/sql

    What is the best way to compare two 'complex' xml structures and return the difference using a plsql procedure/function. Example:
    FUNCTION f_equals(XMLTYPE actualxml, XMLTYPE expectedxml) RETURN VARCHAR2
    this should return 'EQUAL' if they are equal and the actual node with value if different..
    Can somebody throw some ideas please?

    The solution would depend on what you are trying to achieve, is it node to node comparison? overall file comparison? If there is any difference in either of the aforementioned approach, do what with the result?

  • Compare two similar objects

    Do you know about any possible Java bugs with JDK update?
    In my case, my code stopped working.
    Here is what I have. There are two similar objects, but Object 1 has key, and Object 2 (same as Object 1) has no key. I need to compare both, and if they are equal, I need Object 1 to assign key to Object 2.
    It worked before. How I can get around.
    Please help me if you can.
    Respectfully,
    Alex

    Let me change the question:
    "Can we compare two objects one with key and another one without key? How?

  • Repository variable with report level prompts

    Hi Gurus,
    i want to display previous year ,current year into one prompt.
    i have created two repository variables with the name of previous year and current year . i have tried for sql results its giving me odbc error.
    SELECT @{biServer.variables['currentyear']['previousyear']}  "year"."year ID" FROM "table a" these query is giving odbc error. could you please help me out to resolve these issue?

    Why two create two variables,Go head and create one presentation variable and embed the below sql
    SELECT saw_0 FROM ((SELECT Year(CURRENT_DATE) saw_0 FROM "SampleSales") UNION (SELECT Year(CURRENT_DATE)-1 saw_0 FROM "SampleSales")) T1 ORDER BY saw_0
    Where SampleSales is my Subject Area.
    Mark if helps.

  • How to COmpare two variable in BPEL

    Hi ,
    I have two compare two variable ( EIN field ) one from input variable of a BPEL process and other one the output variable of a invoke .
    My requiremet is like this :
    If the the value of both EIN field is same then I have to assign Name field of Invoke output parameter to Output variable of BPEL process .
    If the value doesn't match then i have to assign ' No Data Exist ' expression to Output variable of BPEL process .
    How can i do this .
    Please help me regarding this as early as possible .

    You can do this in a switch statement. Perform a comparision to check if the values are the same, if case is not important (because users will enter anything) wrap the code in a case expression, e.g. upper(user_date) = upper(file_data)
    What version of SOA Suite and JDev are you using. Make sure that these versions are in sync.
    cheers
    James

  • Compare two dateTime with different timezone

    HI, All,
    I found a strange thing when compare two dateTime in BPEL;
    In my BPEL process, client passed a date time to the process , and the process compare the date time with current data time.
    1.client pass cutoffDate to process
    2. in a switch activity, I compare cutoffDate with current date. code:
    bpws:getVariableData('cutoffDate')<=xpath20:add-dayTimeDuration-to-dateTime()
    but seems this compare ignored the timezone information.
    For example:
    cutoffDate=2010-03-05T06:17:38.838+00:00
    currentDate=2010-03-05T14:10:38.838+08:00 this time =2010-03-05T06:10:38.838+00:00
    but cutoffDate<currentDate == true... seems it ignored the timezone info..
    This is a bug or I used a wrong compare function?
    Thanks.
    Edited by: Colin Song on Mar 5, 2010 3:28 PM

    Hi Colin,
    Please go through below link, there is topic about calculating difference between dates. Hope you find solution.
    http://blogs.oracle.com/reynolds/2007/07/19/
    Please let me know, if still not successful.
    Thx,

Maybe you are looking for