Accessing Array and Iterating Array list - call corresponding subprocess

Hi,
I want some advice on how to iterate through a Array list which has an array of tasks/processes and make calls to the corresponding subprocess for each element in the list.
Any example or ideas would be of great help.
My requirement states that i will get a list of tasks from a Rules Engine and i have to use BPM to iterate through the tasks and make calls to each tasks(which is a subprocess call).
Thanks

Are you using Oracle BPM 10 or are you using 11?
Dan

Similar Messages

  • Not able to make outgoing calls in iphone4. Regularly i face this problem, at the same time i receive incoming call, can do net surfing, can access email and sms, only outgoing calls get failed every time. please answer to solve this problem

    not able to make outgoing calls in iphone4. Regularly i face this problem, at the same time i receive incoming call, can do net surfing, can access email and sms, only outgoing calls get failed every time. please answer to solve this problem

    Good day Sidharth Namrta,
    It sounds like you are unable to make any calls, but you can recieve them, and everything else seems to work fine. I recommend you use the troubleshooting in the following article to help you get that resolved, named:
    iPhone: Troubleshooting issues making or receiving calls
    Follow the steps below to resolve this issue. Please test after each step.
    Toggle airplane mode: Tap Settings > Enable Airplane Mode, wait five seconds, then turn off airplane mode.
    Check your phone settings:
    Check your Do Not Disturb settings: Tap Settings > Do Not Disturb.
    Check for any blocked phone numbers: Tap Settings > Phone > Blocked.
    See if Call Forwarding is turned on: Tap Settings > Phone > Call Forwarding.
    Ensure that your software is up to date:
    Check for a carrier settings update.
    Check for an iOS software update. 
    Note: Some updates may require a Wi-Fi connection.
    If the iPhone has a SIM card, reseat the SIM card.
    If the iPhone 4 or iPhone 4s is on the Verizon network, dial *228 from the iPhone and select option 2 to update the Preferred Roaming List (PRL). The PRL determines the cellular towers the phone uses for cellular service, selecting those with the best signal strength.
    Reset the network settings: Tap  Settings > General > Reset > Reset Network Settings.
    Try to make or receive calls in another location.
    Attempt to isolate to one network band:
    If you're having the issue on LTE, disable LTE, if possible, and try again.
    If you're having the issue on 3G/4G, disable 3G/4G, if possible, and try again.
    Contact the carrier to check the following:
    Your account is properly configured to use the specific iPhone that has the issue.
    There are no localized service outages.
    Your account doesn't have a billing-related block.
    Your calls don't have errors on the carrier system.
    Restore the phone as new.
    If the above steps don't resolve the issue, go to an Apple Retail Store, carrier, Apple Authorized Reseller, or contact AppleCare to send the phone in for service.
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • How can I lookup text values in a column and display a list of corresponding names from another column, sorted by values?

    My spreadsheet looks like this:
              Monday     Tuesday     Wednesday
    Name 1     OFF          4:30 PM     4:30 PM
    Name 2     5 PM     OFF          4:30 PM
    Name 3     4:30 PM     5 PM     OFF
    Name 4     4 PM     OFF          OFF
    I would like to create a spreadsheet for each day that will display the values sorted by time, as follows (e.g. Monday):
    Name     In Time
    Name 4     4 PM
    Name 3     4:30 PM
    Name 2     5 PM
    Any help would be greatly appreciated. Thanks!

    Here's an example, using the provided data:
    I've set the alignment on Main to Automatic (except for row 1) to distinguish between numeric and quasi numeric values (aligned right) and text (aligned left). This is a visual aid to developing the table, and would likely be changed for appearance in the end version.
    Columns E, F and G of Main are index columns listing the RANK of numeric/date and time values in columns A, B and C respectively. Text values cause RANK to throw an error, which is caught by IFERROR, which returns a value of 999, chosen to be well above any of the RANK values returned. A small amount ( ROW()/100000 ) is added to each result to prevent duplicate results is cases like column D, where duplicate times appear.
    Formula: Main::E2: =IFERROR(RANK(B2,B,1),999)+ROW()/100000
    Fill down the column, and right to column G.
    These columns may be hidden.
    The three daily columns use a single formula each, revised to match the index columns from which they determine the row containing each piece of data to be copied, and to match the columns from which they retrieve that data. The formulas from row 2 of these tables are listed here in the order (left to right) that they are used in the second row of tables above. Parts that are edited from one formula to another are shown in bold.
    =IF(SMALL(Main :: $E,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$E,ROW()-1),Main :: $E,0)-1,0))
    =IF(SMALL(Main :: $E,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$E,ROW()-1),Main :: $E,0)-1,1))
    =IF(SMALL(Main :: $F,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$F,ROW()-1),Main :: $F,0)-1,0))
    =IF(SMALL(Main :: $F,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$F,ROW()-1),Main :: $F,0)-1,2))
    =IF(SMALL(Main :: $G,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$G,ROW()-1),Main :: $G,0)-1,0))
    =IF(SMALL(Main :: $G,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$G,ROW()-1),Main :: $G,0)-1,3))
    Each of the formulas is filled down its column.
    Each of the functions used is described in the iWork Formulas and Functions User Guide, a useful resource to have on hand when you are writing (or attempting to 'decode') Numbers formulas, The guide (and the Numbers '09 User Guide) may be downloaded from the Help menu in Numbers '09.
    Regards,
    Barry

  • How can I lookup text values in a column and display a list of corresponding names from another column?

    My spreadsheet looks like this:
                     Monday...
    Name 1      4PM
    Name 2      4PM
    Name 3      5PM
    Name 4      5PM
    Name 5      4PM
    I would like to create a spreadsheet that will display the values as follows:
    Openers (4PM)    Closers (5PM)
    Name 1                Name 3
    Name 2                Name 4
    Name 5
    Any help would be greatly appreciated. Thanks!

    Hi Shawn,
    I think this will do it for you:
    There's an auxiliary column in your data entry table. It counts the entries for each distinct time.
    The formula in the auxiliary column's body rows is:
    =COUNTIF(OFFSET(B$1, 0,0,ROW()), B)&"--"&B
    The formula in the Summary table's body rows is:
    =IFERROR(OFFSET(Schedule::$A$1, MATCH(ROW()-1&"--"&A$1, Schedule :: $C, 0)-1, 0), "")
    Regards,
    Jerry

  • Accessing Array and Iterating Array list - Need Oracle Pro Assistance

    Hi,
    This is the third time i am posting the question, :( .
    I want some advice on how to iterate through a Array list which has an array of tasks/processes and make calls to the corresponding subprocess for each element in the list.
    We are looking for a BPMN approach.
    Any example or ideas would be of great help.
    My requirement states that i will get a list of tasks from a Rules Engine and i have to use BPM to iterate through the tasks and make calls to each tasks(which is a subprocess call).
    In Oracle BPM 11g I would like to use a multi-instance subprocess to send a task to a user for each item in an array. There are an unknown number of rows in the array. Does anyone have a good example of how to do this?
    I am using BPM Oracle 11g but any help 10 will also help us.
    I am reposting again this question , hoping that someone will help us
    Thanks
    Edited by: user9083699 on Aug 28, 2010 4:03 AM

    I am not the expert on 11g, however, in 10g, if I understand correctly... it sounds like you should be able to use PAPI to notify instances/sub processes, etc....
    With a list of Instances, you can search for that instance and notify it...
    If you have a list of processes, that need to be started, you can create an instance within that process....
    user9083699 wrote:
    My requirement states that i will get a list of tasks from a Rules Engine and i have to use BPM to iterate through the tasks and make calls to each tasks(which is a subprocess call).If you are just trying to initiate a sub-process, (btw, why would they have to be subprocesses?), It sounds like you should be able to create a global in the process, and just call it with PAPI...
    I'm still a little fuzzy, on how this business requirement turned up... however, maybe this helps a little?
    -Kevin

  • Accessing Array and Iterating Array list

    Hi,
    I want some advice on how to iterate through a Array list which has an array of tasks/processes and make calls to the corresponding subprocess for each element in the list using BPM 11g
    We are looking for a BPMN approach.
    Any example or ideas would be of great help.
    My requirement states that i will get a list of tasks from a Rules Engine and i have to use BPM to iterate through the tasks and make calls to each tasks(which is a subprocess call).
    In Oracle BPM 11g I would like to use a multi-instance subprocess to send a task to a user for each item in an array. There are an unknown number of rows in the array. Does anyone have a good example of how to do this?
    I am using BPM Oracle 11g but any help 10 will also help us.
    I am reposting again this question , hoping that someone will help us
    Thanks

    Others probably are getting it, but I'm not really sure what it is that you're tyring to do with the list of instances.
    I'm getting lost in two areas. First, you mentioned you have a rules engine returning a list of instances. Mostly out of curiosity - why do you have an array of instances being created by a rules engine? What is the use case? Asking because I'm sure to learn something new from you on this - I'm used to seeing a lot of things coming back from an invoked rule, but never an array of instances before.
    Second (sure you know this), in both 10g and 11g there is a Split-N activity that you can use to parse (as the name implies) "N" number of instances. This "N" is discoverable at runtime. If you have 14 instances in your array at runtime, it would go into a Split-N activity and 14 instances would automatically be spawned. The 14 instances would flow from the Split-N to its corresponding Join activity in the process.
    Dan

  • Hashmap and array list problems

    This is an assignment I have to do and I do NOT expect anyone to do the coding for me. I am just looking for some direction as I have no clue where to go from here. Any guidance would be very welcomed.
    We were given code that used just an Array lisThis is an assignment I have to do and I do NOT expect anyone to do the coding for me. I am just looking for some direction as I have no clue where to go next. Any guidance would be very welcomed.
    We were given code and told to "Modify the MailServer so that it uses a HashMap to store MailItems. The keys to the HashMap should be the names of the recipients, and each value should be an ArrayList containing all the MailItems stored for that recipient. " Originally it was just an ArrayList named messages. There is also a MailClient and MailItem class.
    I think I can post the messages using the HashMap now, but can't test it. I get a compiler error saying else without if even though I have an if statement. Even if I can compile, I need to make sure I am on the right track with the getNextMailItem method. It is the one I am stuck on and if I can get it to work, I can probably modify the other methods.
    I would really appreciate feedback on that one method.
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    public class MailServer
         // Storage for the arbitrary number of messages to be stored
         // on the server.
         private HashMap messages;
         private ArrayList list;
         private MailItem item;
          * Construct a mail server.
         public MailServer()
             messages = new HashMap();
             list = new ArrayList();
          * Return the next message for who. Return null if there
          * are none.
          * @param who The user requesting their next message.
         public MailItem getNextMailItem(String who)
              Iterator it = list.iterator();
              while(it.hasNext())
                MailItem item = (MailItem)it.next();
                if(messages.containsKey(who));
                    return item;
               else
                   return null;
          * Add the given message to the message list.
          * @param item The mail item to be stored on the server.
         public void post(String name, MailItem item)
             if(messages.containsKey(name))
                    list = (ArrayList) messages.get(name);
                    else {
                        list = new ArrayList();
                        list.add(item);
                        messages.put(name, list);
    }[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The way I understand this is that MailItems are stored in per user ArrayLists, and that the ArrayLists are stored in the HashMap, and use the username as a key,
    HashMap messages = new HashMap();
    //ArrayList userMailItems = new ArrayList(); this should not be declared here, only the messages mapso given a User name, you need to get the list of mail items for that user out of the hashMap, and then return the next MailItem from the list. So given that, you don't even need to Iterate over the list:
    public MailItem getNextMailItem(String who)
    ArrayList list = (ArrayList)messages.get(who);
    if(list == null || list.size() == 0)
    return null;
    //now we get the next item from the list, we can call remove, since it returns the object we are removing.
    MailItem item = (MailItem)list.remove(0);
    return item;
    }

  • Sort array list and using comparable

    With the following code I would like to setup a score object for the current player.
    Change it to a string(Is it correct to say parse it to a string type)
    Then add it to the arraylist.
    So I can sort the array list according to the string size.
    That's why I have the variables in that order.
    So if 3 players have the same amount of guesses, they can be positioned on the high score list according to their gameTime.
    //create score object
                   Score currentScore = new Score(guessCount, gameTime, name);
                   String currentScoreToString = currentScore.toString();
                   //add score to arrayList
                   scores.add(currentScoreToString);So the error message says " The method add(Score) in the type arrayList <Score> is not applicable for the arguments(string)"
    Now, I understand that, I would like to know if there is another way to achieve what I am trying to do.
    Is the string idea I am trying here possible? is it practical or should I use comparable?
    I have looked at comparable, but I don't get it.
    Will my Score class implement comparable. I am looking at an example with the following code.
    Employee.java
    public class Employee implements Comparable {
        int EmpID;
        String Ename;
        double Sal;
        static int i;
        public Employee() {
            EmpID = i++;
            Ename = "dont know";
            Sal = 0.0;
        public Employee(String ename, double sal) {
            EmpID = i++;
            Ename = ename;
            Sal = sal;
        public String toString() {
            return "EmpID " + EmpID + "\n" + "Ename " + Ename + "\n" + "Sal" + Sal;
        public int compareTo(Object o1) {
            if (this.Sal == ((Employee) o1).Sal)
                return 0;
            else if ((this.Sal) > ((Employee) o1).Sal)
                return 1;
            else
                return -1;
    ComparableDemo.java
    import java.util.*;
    public class ComparableDemo{
        public static void main(String[] args) {
            List ts1 = new ArrayList();
            ts1.add(new Employee ("Tom",40000.00));
            ts1.add(new Employee ("Harry",20000.00));
            ts1.add(new Employee ("Maggie",50000.00));
            ts1.add(new Employee ("Chris",70000.00));
            Collections.sort(ts1);
            Iterator itr = ts1.iterator();
            while(itr.hasNext()){
                Object element = itr.next();
                System.out.println(element + "\n");
    }The thing I don't understand is why it returns 0, 1 or -1(does it have to do with the positioning according to the object is being compared with?)
    What if I only use currentScore in a loop which loops every time the player restarts?
    //create score object
                   Score currentScore = new Score(guessCount, gameTime, name);
                   String currentScoreToString = currentScore.toString();
                   //add score to arrayList
                   scores.add(currentScoreToString);Also why there is a method compareTo, and where is it used?
    Thanks in advance.
    Edited by: Implode on Oct 7, 2009 9:27 AM
    Edited by: Implode on Oct 7, 2009 9:28 AM

    jverd wrote:
    Implode wrote:
    I have to hand in an assignment by Friday, and all I have to do still is write a method to sort the array list. Okay, if you have to write your own sort method, then the links I provided may not be that useful. They show you how to use the sort methods provided by the core API. You COULD still implement Comparable or Comparator. It would just be your sort routine calling it rather than the built-in ones.
    You have two main tasks: 1) Write a method that determines which of a pair of items is "less than" the other, and 2) Figure out a procedure for sorting a list of items.
    The basic idea is this: When you sort, you compare pairs of items, and swap them if they're out of order. The two main parts of sorting are: 1) The rules for determining which item is "less than" another and 2) Determining which pairs of items to compare. When you implement Comparable or create a Comparator, you're doing #1--defining the rules for what makes one object of your class "less than" another. Collections.sort() and other methods in the core API will call your compare() or compareTo() method on pairs of objects to produce a sorted list.
    For instance, if you have a PersonName class that consists of firstName and lastName, then your rules might be, "Compare last names. If they're different, then whichever lastName is less indicates which PersonName object is less. If they're the same, then compare firstNames." This is exactly what we do in many real-life situations. And of course the "compare lastName" and "compare firstName" steps have their own rules, which are implemented by String's compareTo method, and which basically say, "compare char by char until there's a difference or one string runs out of chars."
    Completely independent of the rules for comparing two items is the algorithm for which items get compared and possibly swapped. So, if you have 10 Whatsits (W1 through W10) in a row, and you're asked to sort them, you might do something like this:
    Compare the current W1 to each of W2 through W10 (call the current one being compared Wn). If any of them are less than W1, swap that Wn with W1 and continue on, comparing the new W1 to W(n+1) (that is, swap them, and then compare the new first item to the next one after where you just swapped.)
    Once we reach the end of the list, the item in position 1 is the "smallest".
    Now repeat the process, comparing W2 to W3 through W10, then W3 to W4 through W10, etc. After N steps, the first N positions have the correct Whatsit.
    Do you see how the comparison rules are totally independent of the algorithm we use to determine which items to compare? You can define one set of comparison rules ("which item is less?") for Whatsits, another for Strings, another for Integers, and use the same sorting algorithm on any of those types of items, as long as you use the appropriate comparison rules.Thanks ;)
    massive help
    I understand that now, but I am clueless on how to implement it.
    Edited by: Implode on Oct 7, 2009 10:56 AM

  • Adding two array lists together and a text file to an array list

    I'm having problems coding these two methods... Could someone explain how to do this? I can't find information on it anywhere... :(
    "MagazineList" is the class I'm coding in right now, and I already declared "list" as an array list of another class called "Magazine".
    public boolean addAll(MagazineList magazines)
           if (list == magazines) {
               return false;
            else {
                list.addAll(magazines);
           return true;
       public boolean addAll(String filename)
           Scanner in = ResourceUtil.openFileScanner(filename);
            if (in == null) {
               return false;
            String line = source.nextLine();
            while (!line.equals("")) {
              list.add(Magazine(source));
           in.close();
       }

    I assume "addAll(MagazineList magazines)" is defined in the MagazineList class?
    Then,
    list.addAll(magazines);probably needs to be something like:
    list.addAll(magazines.list);This uses the private variable ( should be private) list from the input MagazineList, and adds all of those Magazine objects to the list in the current MagazineList.
    But, yes, describe your problems more clearly, and you'll get better answers more quickly (because people will be able to understand you and give you a suggestion without asking you another question first).

  • How to get keep one column as a key and the other columns as a array list

    Hello,
    I am really new to Java...I am trying to read a text file containing different columns separated by comma and then create a hash map for the first column (key) and then rest as a array list for the key.I am not able to create the hash map and the corresponding key.Could someone help me in this regard.
    The text document is :
    AcctNo,AcctMngr,AcctType,ProdList,Volume,AcctPrice,Returns
    12345,Vikram,2,MSFS:IBM:XYZ:MAN,28000,4500,1.25
    53278,Anand,1,PLYS:AIX:YET:WON,85000,8500,2.32
    94005,Vincent,3,UTIL:FLY:YEL:WIN,67000,5600,3.21
    45000,Abhishek,2,WENS:KYL:MEN:ABS,34000,9800,4.21
    76000,Chris,3,MENS:IBM:ROC:QUE,25000,2500,2.15
    67000,Kiran,4,FORS:ITI:MOC:REM,32000,3500,1.54
    87000,Rohit,2,MSNF:IIT:HOT:ROC,54000,5400,4,23
    45600,Sathyan,3,HELP:FOR:PRO:GRA,65000,3400,2,1.98
    84600,Vinay,4,PLZE:TES:ROC:WEN,76000,7300,3,4.32
    65000,Venkat,2,HETT:WEL:SEE:RED,89000,9800,1,3.23
    and the code which i have so far is
    import java.io.*;
    import java.util.*;
    class SearchHash {
    public static void main (String args[]) {
    int i=0;
    int j=0;
    Object newKey = new Object();
    Object newValue = new Object();
    Map map1 = new HashMap();
    ArrayList a1 = new ArrayList();
    String val;
    try {
    BufferedReader br1 = new BufferedReader ( new FileReader ( new File ("progress.txt")));
    String s="";
    s = br1.readLine();
    while (s!=null) {
    StringTokenizer st = new StringTokenizer (s ,",");
    int k=0;
    while (st.hasMoreTokens()) {
    while (k<=6) {
    val= st.nextToken();
    if (k==0) {
    newKey = val;
    else{
    newValue = val;
    a1.add(newValue);
    k = k+ 1;
    map1.put(newKey,a1);
    map1.put(newKey,a1);
    a1.clear();
    s = br1.readLine();
    // System.out.println(map1);
    }catch (Exception e) {
    System.out.println("Exception Raised : " + e);
    Thanks.,...

    Array? Don't live in object denial. Define a class (Account?) and parse each line as an Account object. Then you put them into a Map<Integer, Account> by their account number.

  • How to find and display the posistion in an array list

    hi all,
    i know this is proballly simple but i have an arraylist where every time someone connects to my system it adds them to an arraylist, how can i post back somelike like hi user "1" thanks for connecting and so on. i just dont understand how to find their unique posistion in the array list and display it as a number.
    any help would be great

    So to be clear...
    You have an arraylist of connections .... for example
    ArrayList<ConnectedPeople> connPplArr = new ArrayList();And then each time someone connects you would add a connected people object to the arraylist.
    ConnectedPeople, migh contain username etc etc.
    You could then do:
    ConnectedPeople newConnection..... ;
    int index = connPplArr.indexOf( newConnection );
    if(int == -1){
        add them to your array
        index = connPplArr.size();
    return "Hello user "+ index;That what you mean?
    I know some of it is sudo code, but have I understood your problem?
    Edited by: Azzer_Mac on Apr 29, 2008 2:20 AM
    Edited by: Azzer_Mac on Apr 29, 2008 2:20 AM

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • Is possible to pass array/list as parameter in TopLink StoredProcedureCall?

    Hi, We need to pass an array/List/Vector of values (each value is a 10 character string) into TopLink's StoredProcedureCall. The maximum number of elements on the list is 3,000 (3,000 * 10 = 30,000 characters).
    This exposed two questions:
    1. Is it possible to pass a Vector as a parameter in TopLink's StoredProcedureCall, such as
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    Vector strVect = new Vector(3000);
    strVect.add(“ab-gthhjko”);
    strVect.add(“cd-gthhjko”);
    strVect.add(“ef-gthhjko”);
    Vector parameters = new Vector();
    parameters.addElement(strVect);
    session.executeQuery(query,parameters);
    2. If the answer on previous question is yes:
    - How this parameter has to be defined in Oracle’s Stored Procedure?
    - What is the maximum number of elements/bytes that can be passed into the vector?
    The best way that we have found so far was to use single string as a parameter. The individual values would be delimited by comma, such as "ab-gthhjko,cd-gthhjko,ef-gthhjko..."
    However, in this case concern is the size that can be 3,000 * 11 = 33, 000 characters. The maximum size of VARCHAR2 is 4000, so we would need to break calls in chunks (max 9 chunks).
    Is there any other/more optimal way to do this?
    Thanks for your help!
    Zoran

    Hello,
    No, you cannot currently pass a vector of objects as a parameter to a stored procedure. JDBC will not take a vector as an argument unless you want it to serialize it (ie a blob) .
    The Oracle database though does have support for struct types and varray types. So you could define a stored procedure to take a VARRAY of strings/varchar, and use that stored procedure through TopLink. For instance:
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    oracle.sql.ArrayDescriptor descriptor = new oracle.sql.ArrayDescriptor("ARRAYTYPE_NAME", dbconnection);
    oracle.sql.ARRAY dbarray = new oracle.sql.ARRAY(descriptor, dbconnection, dataArray);
    Vector parameters = new Vector();
    parameters.addElement(dbarray);
    session.executeQuery(query,parameters);This will work for any values as long as you are not going to pass in null as a value as the driver can determine the type from the object.
    dataArray is an Object array consisting of your String objects.
    For output or inoutput parameters you need to set the type and typename as well:
      sqlcall.addUnamedInOutputArgument("PERSON_CODE", "PERSON_CODE", Types.ARRAY, "ARRAYTYPE_NAME"); which will take a VARRAY and return a VARRAY type object.
    The next major release of TopLink will support taking in a vector of strings and performing the conversion to a VARRAY for you, as well as returning a vector instead of a VARRAY for out arguments.
    Check out thread
    Using VARRAYs as parameters to a Stored Procedure
    showing an example on how to get the conection to create the varray, as well as
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html on using Varrays in Oracle, though I'm sure the database docs might have more information.
    Best Regards,
    Chris

  • How can i check to see if an object is already in the array list?

    while (res.next()) {
                    Schedule schedule = new Schedule();
                    customerName = res.getString("CUSTOMERNAME");
                    schedule.setCustomerName(customerName);
                    magName = res.getString("MAGNAME");
                    schedule.setMagName(magName);
                    System.out.println("NAME: " + customerName);
                    System.out.println("MAGNAME: " + magName);
                    if(!scheduleListH.contains(schedule))  //this won't work
                        scheduleListH.add(schedule);
                }schedule object has 2 fields, customerName and MagName;
    Basically i want to say, IF the scheudleList (which is an array list) contains an object schedule that has the same customerName and MagName as any of the objects in the array list, don't readd the object.
    ANy help would be great!

    Thanks!
    Oops I forogt I could use the .contains, i also tried that but still no luck.
    There is no compiler error but here is an example of the output:
    Populating scheudle list for HOLIDAY selection data structure: 
    NAME: Cory
    MAGNAME: Merlin
    NAME: Brandon
    MAGNAME: Gondorf
    NAME: Chris
    MAGNAME: Houdini
    NAME: Lokie
    MAGNAME: Blaine
    Sample SCHEDUEL H [Cory          Merlin, Brandon          Gondorf, Chris          Houdini, Lokie          Blaine]As you can see, There are 4 objects in the array list:
    Cory Merlin
    Brandon Gondorf
    Chris Houdini
    Lokie BLaine
    Now this function is called everytime the user choses a new item in a combo box.
    So if they go back to the previous selection, Holiday's, it shouldn't read add all the orginal things.
    But if I go up and select the same item in the combo box it changes whats in the array list to the following:
    Populating scheudle list for HOLIDAY selection data structure: 
    NAME: Cory
    MAGNAME: Merlin
    NAME: Brandon
    MAGNAME: Gondorf
    NAME: Chris
    MAGNAME: Houdini
    NAME: Lokie
    MAGNAME: Blaine
    Sample SCHEDUEL H [Cory          Merlin, Brandon          Gondorf, Chris          Houdini, Lokie          Blaine, Cory          Merlin, Brandon          Gondorf, Chris          Houdini, Lokie          Blaine]Here's my whole function if your interested and where I call it:
        void populateSchedule(String holiday) {
            Statement sta = null;
            Connection connection6 = null;
            try {
                connection6 = DriverManager.getConnection(URL, USERNAME, PASSWORD);
                sta = connection6.createStatement();
                //getting the list of magicians from the selected holiday to see if any are free
                ResultSet res = sta.executeQuery(
                        "SELECT CUSTOMERNAME, MAGNAME FROM SCHEDULE WHERE HOLIDAYNAME = '" + holiday + "'");
                String customerName = " ";
                String magName = " ";
                System.out.println("Populating scheudle list for HOLIDAY selection data structure:  ");
                //this is where I add the waiting list objects to the array that will later be used
                //to print out and shown to the user when they select the waiting list status
                while (res.next()) {
                    Schedule schedule = new Schedule();
                    customerName = res.getString("CUSTOMERNAME");
                    schedule.setCustomerName(customerName);
                    magName = res.getString("MAGNAME");
                    schedule.setMagName(magName);
                    System.out.println("NAME: " + customerName);
                    System.out.println("MAGNAME: " + magName);
                   if(!scheduleListH.contains(schedule))
                       scheduleListH.add(schedule);
                System.out.println("Sample SCHEDUEL H " +   scheduleListH);
            } catch (SQLException ex) {
                System.out.println(ex);
                ex.printStackTrace();
            } finally {
                try {
                    sta.close();
                    connection6.close();
                } catch (SQLException ex) {
                    Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);
    //this is where i call in the GUI
        private void specStatusComboBoxActionPerformed(java.awt.event.ActionEvent evt) {                                                  
            // TODO add your handling code here:
            String selectedItem = (String)specStatusComboBox.getSelectedItem();
            String groupSelectedItem = (String) groupStatusComboBox.getSelectedItem();
            if(groupSelectedItem.equals("Holidays"))
                //get customer name and magician name from the Scheduel table
                //use selectedItem (it will be a holiday name)
                //magicDB.clearScheduleHList();
                magicDB.populateSchedule(selectedItem);
                ArrayList<Schedule> tempScheduleList = magicDB.getScheduleHListCopy();
                outputTextArea.setText(" ");
                outputTextArea.setText("CUSTOMER NAME" +"\t\t" + "MAGICIAN NAME" + "\n");
                for(int i = 0; i < tempScheduleList.size(); i++)
                    outputTextArea.append(tempScheduleList.get(i).toString() + "\n");
        }   I'll reward the duke stars anyways because you have been a great help either way!

  • Bank account array list

    I'm very lost and need a push in the right direction. I am trying to get the balance of a bank account which is an array list of accounts and balances. The class I am working on is the Bank class. There is also a BankAccount class and a BankTester class.
    //deposit funds
         public void deposit(int accountNumber, double amount)
              double bal = (accountNumber).getBalance();
              double newBalance = bal + amount;
              balance = newBalance;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    This is the error I am getting that I do not understand.
    C:\Users\matthew\Documents\FLCC\CSC190\Exercise7_1\Bank.java:34: int cannot be dereferenced
              double bal = (accountNumber).getBalance();
              ^
    C:\Users\matthew\Documents\FLCC\CSC190\Exercise7_1\Bank.java:36: cannot find symbol
    symbol : variable balance
    location: class Bank
              balance = newBalance;
              ^

    mgp wrote:
    I'm very lost and need a push in the right direction. I am trying to get the balance of a bank account which is an array list of accounts and balances. The class I am working on is the Bank class. There is also a BankAccount class and a BankTester class.
    //deposit funds
         public void deposit(int accountNumber, double amount)
              double bal = (accountNumber).getBalance();
              double newBalance = bal + amount;
              balance = newBalance;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    This is the error I am getting that I do not understand.
    C:\Users\matthew\Documents\FLCC\CSC190\Exercise7_1\Bank.java:34: int cannot be dereferenced
              double bal = (accountNumber).getBalance();
    OK, here is what I think is happening. I do not see a definition of accountNumber anyplace that would override the int definition in the parameter list, and you are trying to access it as a object with a method getBalance()--that is what the dereference error is saying--when you put the parentesis around the variable and then attaching a method to it you are trying to access the enclosed variable as an object. In any case it is not an object and it does not contain the method getBalance().
              ^
    C:\Users\matthew\Documents\FLCC\CSC190\Exercise7_1\Bank.java:36: cannot find symbol
    symbol : variable balance
    location: class Bank
              balance = newBalance;
              ^balance is undefined in your Bank class.

Maybe you are looking for