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

Similar Messages

  • 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 - 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

  • How do you "push" into an array and return array without commas?

    Hi.  In AS 3.0 I have declared an Array as a new Array();
    I would like to push objects into that array but have a text field read back the array minus the commas that are pushed by user interaction (from numbered buttons).
    For example, if the user pushes button 1 then button 4 then button 8 I would like the array to read in the text field 148 instead of 1,4,8 .
    This seems easy but I looked at the AS 3 reference and couldn't determine whether pop() would do it.

    Does the following help in any way?
    var vb:Array = new Array(1,2,3);
    trace(vb);
    trace(vb.join(""));

  • How to increment an element in an array and put it back in the same array?

    I have an array of values generated by another part of my program. My goal is to count the number of occurences for each integer value in the array and put these values in a new array. This new array will be a histogram of the input array. My approach is to do auto-indexing with a for loop. In the loop I use a "index array" to get the current value of the histogram array and a "replace array subset" to update the array element with "current+1". The problem is that when I wire the output of the "replace array subset" VI back to its input, I get a wire error. I guess I cannot wire it like that, but what should I do? Is there a completely different approach to do this that
    is more elegant?
    Thanks for your help!
    Benoit

    Hi Benoit,
    I believe the thing that's missing is a shift register.
    Right-click on the edge of your "For loop" and select add shift register.
    Wire an initialized array to the shift register left terminal before entering the "for loop". Wire from this same terminal (inside the loop) as the source of the info used in your "index array" and replace array. The results of these two operations (just the way you are doing it now) gets wired to the "right terminal" of the shift register (inside the loop).
    What ever you stuff into the right terminal, gets returned via the left terminal on the next iteration of the loop. When the loop is done, your final array of counts can be accessed by wiring from the "right terminal" (outside the loop).
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Booting from thunderbolt array and accessing projects

    I'm attempting to speed up my FCPX flow on my iMac.  The biggest problem is the slow harddrive installed in the iMac and because its difficult to replace, the easiest solution is to duplicate my Macintosh HD drive to an external thunderbolt RAID-0 array and boot to it.  That way everything runs snappy.
    The problem I'm finding (aside from a few apps complaining about the 'hardware' change thinking they are on a different computer), FCPX no longer sees all my projects.  How do I get my projects back?
    Original install:
    FCPX located on 'Macintosh HD'
    Projects and media located on 'ScaryRaid' external thunderbolt RAID0 array.
    New install:
    FCPX located on 'ScaryRaid' external thunderbolt RAID0 array along with projects and media.
    -> so the only thing that 'moved' was the operating system and apps.

    I was hoping the solution was as simple as this.  Thank you!
    However, if I want to be able to access my events in both ways, creating an alias in my Movies folder to the 'Final Cut *' folders in the main directory on the drive doesn't work.  Creating soft links using ln -s doesn't appear to work either.  Is there a way to create links that FCPX will recognize?
    Thanks!

  • How to ask for an array and how to save the values

    I'm supposed to be learning the differences between a linear search and a binary search, and the assignment is to have a user input an array and search through the array for a given number using both searches. My problem is that I know how to ask them how long they want their array to be, but I don't know how to call the getArray() method to actually ask for the contents of the array.
    My code is as follows:
    import java.util.Scanner;
    import java.util.ArrayList;
    public class Main
        private static Scanner input = new Scanner(System.in);
        public static void main (String args[])
            //creates ArrayList
            int List[];
            System.out.println("How long would you like the array to be?");
            int arrayLength = input.nextInt();
            //Initializes array list
            List = new int [arrayLength];
            System.out.println("Please enter the first value of the array");
        public static void getArray(int List[], int arrayLength)
            for(int i=0; i < arrayLength; i++) {
                 System.out.println("Enter the next value for array");
                 List[i] = input.nextInt();
         public static void printArray(int List[])
             for(int i=0; i < List.length; i++)
                 System.out.print(List[i] + " ");
    public class search
        public static int binarySearch(int anArray[], int first, int last, int value)
            int index;
            if(first > last) {
                index = -1;
            else {
                int mid = (first + last)/2;
                if(value == anArray[mid]) {
                    index = mid; //value found at anArray[mid]
                else if(value < anArray[mid]) {
                    //point X
                    index = binarySearch(anArray, first, mid-1, value);
                else {
                    //point Y
                    index = binarySearch(anArray, mid+1, last, value);
                } //end if
            } //end if
            return index;
        //Iterative linear search
        public int linearSearch(int a[], int valueToFind)
            //valueToFind is the number that will be found
            //The function returns the position of the value if found
            //The function returns -1 if valueToFind was not found
            for (int i=0; i<a.length; i++) {
                if (valueToFind == a) {
    return i;
    return -1;

    I made the changes. Two more questions.
    1.) Just for curiosity, how would I have referenced those methods (called them)?
    2.) How do I call the searches?
    import java.util.Scanner;
    import java.util.ArrayList;
    public class Main
        private static Scanner input = new Scanner(System.in);
        public static void main (String args[])
            //creates ArrayList
            int List[];
            System.out.println("How many values would you like the array to have?");
            int arrayLength = input.nextInt();
            //Initializes array list
            List = new int [arrayLength];
            //Collects the array information
            for(int i=0; i < arrayLength; i++) {
                 System.out.println("Enter a value for array");
                 List[i] = input.nextInt(); 
            //Prints the array
            System.out.print("Array: ");
            for(int i=0; i < List.length; i++)
                 System.out.print(List[i] + " ");
            //Asks for the value to be searched for
            System.out.println("What value would you like to search for?");
            int temp = input.nextInt();
            System.out.println(search.binarySearch()); //not working
    }

  • Array of variable-length lists in Action Engine

    I'm starting work on a application that consists of multiple sub-panels which each present a specific subset of the hardware functionality.  The hardware appears to the host mostly as memory-mapped registers.  I'm considering implementing the hardware interface in an Action Engine (AE) so that LV will automatically arbitrate among the hardware access requests from the sub-panels and because it (seems to me) to make the data flow more clear than the current implementation that uses a veritable plethora of queues, notifiers, and rendezvous to send requests and results between the sub-panels and the hardware interface at the top-level.
    The challenge is this, though:  Certain hardware addresses need to be modeled in multiple sub-panels -- maybe data at a certain address changes the functionality of some other addresses, or maybe different bit-fields within an address are part of different functional groups.   
    So any of sub-panel can request a read or write to the hardware, but often several of them need to see the resulting data.
    In order to keep the design modular and expandable I don't want to hard-code anything in the hardware AE that is specific to the sub-panels.   Instead, I intend to have the sub-panels "register" with the hardware AE indicating for which addresses they need to receive updates when some hardware address is read or written to.  This means the AE will have to keep the "registration" data in an un-initialized shift-register (USR).  But I want the hardware accesses to run as fast as possible, so I would like to ask for some suggestions how to implement this as efficiently as possible (avoiding, for example, clusters of arrays...)
    I imagine the sub-panel registration info might consist of a user-defined event reference (created inside the sub-panel VI) and a list of hardware addresses that the sub-panel is modeling.   Then when the hardware AE gets a request to read or write at some address it will also generate events to broadcast the data to the sub-panels that have registered for that address.   This will probably include 20-25 subpanels registering for a collective total of about 700 hardware addresses.  
    I'm less concerned about memory than speed.
    So, a few possibilities come to mind for how to implement the registration data in the AE USR:
    A) Have one 2-D array where the array contains one row per hardware address (~320), and columns contain the event refs for all the sub-panels registered for that address.   The width of the array would depend on whichever address has the greatest number of sub-panels registered for it (maybe 4-5?), but that still means the array would be pretty large (about 6.5 kbytes if a reference is a 32-bit value?)
    On the other hand, indexing into this array to look up the sub-panel references for the current address would be relatively quick and easy since the hardware address is the row number.
    B) Have two arrays where the array size is the number of sub-panels:  One 1D array for the registered event refs and one 2-D array for the addresses.  But different sub-panels will have different quantity of addresses registered, so that means the "width" of the address array would be as big as the largest number of addresses registered by one sub-panel (maybe 20?).   This would use a total of only about 1.5 kbytes, but I would have to search through all 25 address arrays to see if the current address is registered.
    C) or, some other way that I have not though of.   
    Once the "registration" data is received from the sub-panels during program initialization it is never changed, only read.   So at first glance it would seem (A) would be the faster implementation.  But I don't know what, if any, performance hit there would be from having such a large array in a USR, which is why I'm asking here.
    Any thoughts or suggestions would be greatly appreciated.
    Thank you and Best Regards,
    -- J.

    JeffBuckles wrote:
    Any thoughts or suggestions would be greatly appreciated.
    Thank you and Best Regards,
    -- J.
    Quick thought (hardly!)...
    I have used a "Self-Addressed Stamped Envelope" architectrure for those type os apps.
    DAQ device has a queue it monitors for subscription requests (Think of a in-box for Marketing deparetment).
    When client is created it submits a request via the queue for the subscription request that included a ref to its update queue and a list of teh channels it wants to watch. The clients then wait for updates.
    The Marketing department pass the request for updates (in-box of marketing department) to the production department (I used an AE to pass the mailing list) who picks through the acquired data and passes updates as requested to all of teh subscribing clients.
    Just sharing ideas,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Inserting Records in an Array and using a constructor with it

    I badly need help on this! Please please please! I have been studying java for a short time only.
    Anyway, here goes: My project requires the following:
    Employee inputs the no. of video in the shelf. They have four classifications: Drama, Comedy, Action, and Thriller. Each video classification has different rates. The employee creates a video record containing the following information: 1. video ID number, 2. video classification, and 3. Price.
    The employee should display the classifications of videos available and the price. Only the available video tapes would be displayed according to the customer's chosen classification. When the customer chooses the video he wants to rent, the program will register and attach the name of the customer to the video number.
    I only need to use arrays, and NOT database to record the information.

    is it ok i i declare the drama_rate outside the video class?
    i have a list of variables on my videoupdate classYes. It's probably best to declare it static & then you can access it directly:
    public static float drama_rate = 100.0;
    rate = <the class name>.drama_rate;
    so, i should also include a customer no. both in the video and customer class.I would. You may want to list a bunch of videos and who currently has them. This way you don't have to search the customers AND the videos to do this.
    thanks =) i don't know either why we had to validate/invalidate,\
    but our applet doesnt refresh when >it is supposed to, so
    we just used this method. It wouldnt slow down the application, would it?Could you just revalidate()?
    the use of arrays. i havent finished with the program yet.
    i have the design already, i just couldnt put it in code.
    im not familiar with the use of multidimensional arrays-
    can i use this for the video and customer records i will need to store?Not sure what you're using arrays for, but here's an example of something I might do. Maybe it will be useful to you.
    Have you looked at HashMaps? You could use "Customer" as the key and then use an ArrayList of checked out Videos as the value:
    HashMap customers = new HashMap();
    ArrayList videos = new ArrayList();
    //Add the checked out videos to the list
    videos.add(video);
    <etc>
    // Add this customer and the list of videos he has checked out.
    customers.put(customer,videos);
    [\code]

  • Excel & ActiveX: Insert arbitrary columns from 2D array and create graph problems

    Hi there,
    I want to insert data from either a 1D or 2D array from LabView into Excel and create graphs.
    I used the information from the following example:
    http://www.ni.com/example/28934/en/
    and was able to create a new Excel file (I'm using Excel 2010), writing data from an 1D array to a column in excel by creating a while loop and using the first element of the array to write it to a specific cell. I use the counter of the loop to write to the next cell when the loop starts over and always delete the first value, which I write to the cell, from the array until it is empty.
    Now I also would like to write a 2D array - so the first column in Excel should be the first column from the array and so. Here I cannot use the loop counter directly as Excel only counts 1,2,... for the rows, but uses A,B,... to count columns. Also I do not know in advance how many columns my 2D array will contain, so creating a lookup table like (A means 1, B means 2,...) is not really an option (except there really is no other way). Is there a possibilty to convert numbers into letters or some way to 'explain' to the program that column 2 in the array means column B in Excel for example, or is there a way to insert new columns?
    I figured out how to add new Worksheets and as I also need to create a certain number of Worksheets and I know that on standard 3 sheets are present when creating the file, I use the 'add' methode to create every new worksheets before worksheet 3 - I could use the same methode to create new columns in Excel, but so far I didn't find a methode to do so. Or is there a way to enter the whole 2D array at once?
    Then I'd like to create a graph (in case of the 1D arrays a bar plot, when using 2D arrays a 3D plot) to view the data. I found this example:
    http://www.ni.com/newsletter/51339/en/
    -> as I do not have the toolkit I'd like to do it using ActiveX directly, so I tried to do things like shown under the headline 'DIY ActiveX/.NET'
    I tried to load the snippet to a new Excel file but got the error message 'microsoft.office.interop.excel.dll not found' and hence the code is not working. That confuses me a little as I would guess when this dll is not present I cannot access Excel from LabView at all, though my understanding of what I'm really doing so far is quiet limited. ;-)
    Also - as far as I understand from the snippet - when creating a new chart object I should be able the create methodes for it, however when I do a right click on the chart object of an ActiveX Worksheet symbol there are none listed.
    To explain my problems better I added a snippet showing my two problems: The inner of the two while loops shows how I import a 1D array. In the outer loop I seperate the columns. I know that currently this is not working as all data end up in column A of the Excel sheet - so I would need to convert the number of the outer counter to A, B,... or find a different solution.
    Moreover on the snippet I placed an ActiveX Worksheet Property with the Chart Object - as I can see the difference to the Chart Object in the example code from the last link above is the color. However I'm not sure what that means and how to change/ solve this.
    And just to make sure - I know this way the VI does not run as the Chart Object is placed completely wrong - I just did it, so it is included in the snippet.
    I'd be thankful for any suggestions,
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    ExcelAreaScan.png ‏60 KB

    Hello everyone and thanks for the answers.
    I only have the LabView Student Edition available here - is the toolkit included in it too. How can I check if it is installed/ available and in case it is installed - where can I find it?
    Today I had time to take a look at the example
    Create via ActiveX Labview a XY Scatter plot graph on an excel sheet
    It almost does what I want in terms of creating a graph. The only problem I could not fix, is that in this example a sheet is created where only the graph is present. i'd like to add the graph to a previously created worksheet. Today I tried get this working but it seems I stilll don't really understand what I'm doing, I'll post a snippet of my code as soon as I can access the PC with LabView on it again.
    I also took a look at the other example for inserting 2D attays - it seems to be what I need, I just had no time so far to test it, I'll post an update when I could test it.
    Thanks for the help so far!

  • Trying to learn Structure and/or Array

    OK here goes my best attempt at an explanation... I been
    through some tutorial on Structures and Arrays and have an ok idea
    of what to do with them. But all the tutorials I went through had
    the variable amounts hard coded in, but I want it to come from a
    database query(s).
    I want to get a mileage total per month per riderId
    tablename: mileageLog
    table fields: ridierId, rideDate, rideDistance
    First I want to query a DB and get all the riderId numbers
    (grouped so I only have one for each). This is no problem.
    <cfquery name="riderIds" datasource="DevKevin">
    SELECT riderId
    FROM mileageLog
    GROUP BY riderId
    </cfquery>
    Now using each riderId, I want to put the results into a
    structure and/or array so that I can then turn around and sort as
    desired.
    I think I need to use a loop - one for each riderId.
    Inside each loop, I would need a second loop running 12 times
    (once for each month)
    The inner loop would run a query like...
    <cfquery name="mileageByMonth" datasource="DevKevin">
    SELECT sum(rideDistance) AS monthTotal
    FROM mileageLog
    WHERE riderId=
    ???? from above somehow
    AND year(rideDate)=#nowYear#
    AND month(rideDate)=#
    ???? loop through 12 months#
    </cfquery>
    I'm so lost

    quote:
    Originally posted by:
    2onboard
    This does indeed return the correct amounts - THANKS
    But how do I utilize them? by that I want to take my results
    and put it into a table that is 14 columns wide.
    Column 1 = the riderID
    Columns 2-13 = the monthly totals
    column 14 = a yearly total
    I also want to be able to sort by any column
    Now it becomes complicated. I'm going to assume that you want
    the current year, not the last 12 months. That means you don't
    necessarily want 14 columns. I also assume that Access's month()
    function returns a number like 4, and not a string like April. I
    don't use Access so I don't actually know.
    Step 1 - Use query of queries and valuelist to get a list of
    distinct month numbers. I'll call this variable abc.
    Step 2 - Build another list of the month names for each of
    those numbers. The function is MonthAsString. I'll call this
    variable months. Then build a third list, the same length, with the
    word integer as each element. I'll call this variable xyz.
    Step 3 - Create a new query. This will have your data in a
    cross tab format for later.
    xTab = QueryNew("Rider,#months#,total",
    "varchar,#xyz#,integer");
    Step 4 - Loop through your original query and use if/else
    logic to populate the xTab query.
    Final Step - Use a flash grid to display your xTab query.
    That will enable you to sort on any column.

  • Newbie - help needed with array and dictionary objects

    Hi all
    Please see the code below. I've posted this code in another thread however the original issue was resolved and this is now a new issue I'm having although centered around the same code.
    The issue is that I'm populating an array with dictionary objects. each dictionary object has a key and it's value is another array of custom objects.
    I've found that the code runs without error and I end up with my array as I'm expecting however all of the dictionary objects are the same.
    I assume it's something to do with pointers and/or re-using the same objects but i'm new to obj-c and pointers so i am a bit lost.
    Any help again is very much appreciated.
    // Open the database connection and retrieve minimal information for all objects.
    - (void)initializeDatabase {
    NSMutableArray *authorArray = [[NSMutableArray alloc] init];
    self.authors = authorArray;
    [authorArray release];
    // The database is stored in the application bundle.
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"books.sql"];
    // Open the database. The database was prepared outside the application.
    if (sqlite3_open([path UTF8String], &database) == SQLITE_OK) {
    // Get the primary key for all books.
    const char *sql = "SELECT id, author FROM author";
    sqlite3_stmt *statement;
    // Preparing a statement compiles the SQL query into a byte-code program in the SQLite library.
    // The third parameter is either the length of the SQL string or -1 to read up to the first null terminator.
    if (sqlite3preparev2(database, sql, -1, &statement, NULL) == SQLITE_OK) {
    // We "step" through the results - once for each row.
    // We start with Letter A...we're building an A - Z grouping
    NSString *letter = @"A";
    NSMutableArray *tempauthors = [[NSMutableArray alloc] init];
    while (sqlite3_step(statement) == SQLITE_ROW) {
    author *author = [[author alloc] init];
    author.primaryKey = sqlite3columnint(statement, 0);
    author.title = [NSString stringWithUTF8String:(char *)sqlite3columntext(statement, 0)];
    // FOLLOWING WAS LEFT OVER FROM ORIGINAL COMMENTS IN SQLBooks example....
    // We avoid the alloc-init-autorelease pattern here because we are in a tight loop and
    // autorelease is slightly more expensive than release. This design choice has nothing to do with
    // actual memory management - at the end of this block of code, all the book objects allocated
    // here will be in memory regardless of whether we use autorelease or release, because they are
    // retained by the books array.
    // if the author starts with the Letter we currently have, add it to the temp array
    if ([[author.title substringToIndex:1] compare:letter] == NSOrderedSame){
    [tempauthors addObject:author];
    } // if this is different letter, then we need to deal with that too...
    else {
    // create a dictionary to store the current tempauthors array in...
    NSDictionary *tempDictionary = [NSDictionary dictionaryWithObject:tempauthors forKey:@"authors"];
    // add the dictionary to our appDelegate-level array
    [authors addObject:tempDictionary];
    // now prepare for the next loop...
    // set the new letter...
    letter = [author.title substringToIndex:1];
    // remove all of the previous authors so we don't duplicate...
    [tempauthors removeAllObjects];
    // add the current author as this was the one that didn't match the Letter and so
    // never went into the previous array...
    [tempauthors addObject:author];
    // release ready for the next loop...
    [author release];
    // clear up the remaining authors that weren't picked up and saved in the "else" statement above...
    if (tempauthors.count > 0){
    NSDictionary *tempDictionary = [NSDictionary dictionaryWithObject:tempauthors forKey:@"authors"];
    [authors addObject:tempDictionary];
    else {
    printf("Failed preparing statement %s
    ", sqlite3_errmsg(database));
    // "Finalize" the statement - releases the resources associated with the statement.
    sqlite3_finalize(statement);
    } else {
    // Even though the open failed, call close to properly clean up resources.
    sqlite3_close(database);
    NSAssert1(0, @"Failed to open database with message '%s'.", sqlite3_errmsg(database));
    // Additional error handling, as appropriate...
    Message was edited by: dotnetter

    Ok, so I know what the issue is now...I just don't know enough to be able to resolve it!
    it's the tempAuthors objects.
    It's an NSMutableArray which is create on the line before the start of the WHILE loop.
    Having looked through the debugger, I can see that each dictionary object is created (with different codes which I assume are memory addresses) so all is well there. However, on each iteration of the loop in the middle there is an IF...ELSE... statement which in the ELSE section is clearing all objects from the tempAuthors array and beginning to repopulate it again.
    Looking at the containing dictionary objects in the debugger I can see that the tempAuthors object that each contains has the same code (again, I'm assuming this is a memory address) - so if I understand correctly, it's the same object...I assumed that when I created the dictionary using the dictionWithObject call that I would be passing in a copy of the object, but it's referencing back to the object which I then go on to change.
    Assuming the above is correct, I've tried several "stabs in the dark" at fixing it.
    I've tried relasing the tempAuthors object within the ELSE and initialising it again via an alloc...init - but this didn't work and again looking through the debugger it looks as though it was confused as to which object it was supposed to be using on the following iteration of the WHILE loop (it tried to access the released object).
    Having read a little more about memory management can someone tell me if I'm correct in saying that the above is because the tempAuthors object is declare outside the scope of the WHILE loop yet I then try to re-instantiate it within the loop (does that make sense???).
    Sorry for the long post...the more I can understand the process the less I can hopefully stop relying on others for help so much.
    I am continuing to read up on memory management etc but just not there yet.
    Regards
    Wayne

  • Problem with arrays and comparing

    Hi,
    I am having problem accessing the array indexes.
    The program supposed to ask the user to enter the car model.
    If the car exists then it will display the message The modelname is available.
    If it doesnt exist The modelname does not exist.
    Thanks
    Car.java.........
    public class Car {
         private String regno;
         private String make;
         private String model;
         private int deposit;
         private int rate;
         public void setCar(String m, String mo, String reg, int dep, int r) {
              make = m;
              model = mo;
              regno = reg;
              deposit = dep;
              rate = r;
         public String getRegNo() {
              return regno;
         public String getmake() {
              return make;
         public String getModel() {
              return model;
         public int getdeposit() {
              return deposit;
         public int getrate() {
              return rate;
    Database.java.........
    public class Database {
    public void showDetails(){
    Car carList[] = new Car[9];
    carList[0] = new Car();
    carList[0].setCar("Toyota","Altis", "SJC2456 X", 100, 60);
    carList[1].setCar("Toyota","Vios", "SJG 9523 B", 100, 50);
    carList[2].setCar("Nissan","Latio", "SJB 7412 B", 100, 50);
    carList[3].setCar("Nissan","Murano", "SJC 8761 B", 300, 150);
    carList[4].setCar("Honda","Jazz", "SJB 4875 N", 100, 60);
    carList[5].setCar("Honda","Civic", "SJD 73269 C", 120, 70);
    carList[6].setCar("Honda","Stream", "SJL 5169 J", 120, 70);
    carList[7].setCar("Honda","Odyssey", "SJB 3468 E", 200, 150);
    carList[8].setCar("Subaru","WRX", "SJB 8234 L", 300, 200);
    carList[9].setCar("Subaru","Impressa", "SJE 8234 K", 150, 80);
    public Car findCarByModel(String findModel){
    Car car = new Car();
    for(int i = 0; i <=9; i++){
    if(car.getModel().equalsIgnoreCase(findModel)== true)
    return car; }
    } return null;
    IssueCarUi.java
    public class IssueCarUI {
    public static void main(String args[]){}
    private String requestModel;
    private Customer myCustomer;
    // Payment myPayment = new Payment();
    Rental myRental = new Rental();
    Database myDatabase = new Database();
    private int noOfDays;
    public IssueCarUI() {
    myCustomer = new Customer("", "");
    }//end Constructor
    public void createCustomer(String n, String i) {
    myCustomer.setName(n);
    myCustomer.setIC(i);
    System.out.println("Name: " + myCustomer.getName());
    System.out.println("Name: " + myCustomer.getIC());
    }// end Create customer method
    public void calculateCost(int d){
    myRental.setdays(d);
    System.out.println("Duration: 5 days");
    }// End Calculate cost
    public void showCarDetails(String requestModel) {
    requestModel=null;
    if(myDatabase.findCarByModel().equalsIgnoreCase(requestModel)==true){
    System.out.println("Model " requestModel " is available");
    }else{  System.out.println("Model " +requestModel + " not is available");}
    }// End Class
    mainmethod.java
    import java.util.Scanner;
    public class mainmethod {
    public static void main(String args[]) {
    IssueCarUI myIssue = new IssueCarUI();
    Scanner input = new Scanner(System.in);
    String name, ic,requestModel;
    System.out.print("Please enter the model to rent");
    requestModel = input.nextLine();
    myIssue.showCarDetails(requestModel);
    // System.out.print("Please Enter your name: ");
    // name = input.nextLine();
    // System.out.print("Please Enter your IC: ");
    // ic = input.nextLine();
    // myIssue.createCustomer(name, ic);
    }

    Assumption:
    * Removed setCar method and implemented the same method as a constructor for Car.
    public class Car {
      private String regno;
      private String make;
      private String model;
      private int deposit;
      private int rate;
      public Car(String m, String mo, String reg, int dep, int r) {
        make = m;
        model = mo;
        regno = reg;
        deposit = dep;
        rate = r;
      public String getRegNo() {
        return regno;
      public String getmake() {
        return make;
      public String getModel() {
        return model;
      public int getdeposit() {
        return deposit;
      public int getrate() {
        return rate;
    * When the values in the Car array are assigned in the new init() default method, they are created using the Car constructor.
    public class Database {
      //Car array is now an instance variable, rather then a local variable.
      private Car carList[]];
      //Default constructor initializes Car array and populates.
      public Database() {
        init();
      //Assign Car array with a custom Car array.
      public Database(Car carList[]) {
        this.carList = carList;
       * I highly suggest passing in as a parameter to the constructor, the car list rather then depending on this restrictive internal initialization.
       * I simply altered it in an init() method to keep it relative to your original code.
      private void init(){
        carList[] = new Car[9];
        carList[0] = new Car();
        carList[0] = new Car("Toyota","Altis", "SJC2456 X", 100, 60);
        carList[1] = new Carr("Toyota","Vios", "SJG 9523 B", 100, 50);
        carList[2] = new Car("Nissan","Latio", "SJB 7412 B", 100, 50);
        carList[3] = new Car("Nissan","Murano", "SJC 8761 B", 300, 150);
        carList[4] = new Car("Honda","Jazz", "SJB 4875 N", 100, 60);
        carList[5] = new Car("Honda","Civic", "SJD 73269 C", 120, 70);
        carList[6] = new Car("Honda","Stream", "SJL 5169 J", 120, 70);
        carList[7] = new Car("Honda","Odyssey", "SJB 3468 E", 200, 150);
        carList[8] = new Car("Subaru","WRX", "SJB 8234 L", 300, 200);
        carList[9] = new Car("Subaru","Impressa", "SJE 8234 K", 150, 80);
      public Car findCarByModel(String findModel){
        for(Car car : carList) {
          if(car.getModel().equalsIngoreCase(findModel)) {
            return car;
        return null;
    }Mel

  • What the difference between array and linklist?

    Hello all:
    I am going to ask a question about array and linklist. Can someone tell me what is the difference between them. They looks so similar. They can all contain some elements and store them in order. Is array more powerful than linklist or other way round? Where is array and linklist most used? Thanks in advance.

    Hello all:
    I am going to ask a question about array and linklist.
    Can someone tell me what is the difference between
    them. They looks so similar. They can all contain some
    elements and store them in order. Is array more
    powerful than linklist or other way round? Where is
    array and linklist most used? Thanks in advance.an array is quite different to a linked list
    a array as an object that cointains pointers to all teh members of teh array
    a linked list is actualy a group of objects that simple have a field that points to the next object (or node if you want) in teh chain
    they both have their strong points and weak points
    with an array u can access a value by simply specifying which location teh value is at where as with linked lists u ahve to iterate through the linked list until u get to the value
    there for arrays are very quick at searching
    and linked lists are very good at moving values
    blah and so on tehy are quite different
    CowMEssiah

  • Large Arrays and Memory

    I'm supposed to be working on code for a lab, and they have reported possible problems with labVIEW eating through memory on long experiments.  Someone before me tried to fix the problem but I am unsure if it is actually helping.  (I'm more familiar with languages like C++, and have not used labVIEW prior to this summer). 
    Where I believe the problem lies is with the array (within a loop).  Depending on the experiment the arrays will be of different sizes so how they handle the array is:
    -> It is an array of a cluster of 2 elements
    -> The array is wired to a shift register.
    -> The shift register is initialized prior to the loop opening by wiring the shift register to a cluster of 2 "0's".
    ->Each loop cycle they add new data (a new cluster) to the array using "Build Array"
    There are multiple of these arrays all being plotted so they use "Build Cluster Array" and then wire it to the corresponding Plot (an XY Graph).  They use this after "Build Array".
    This used to be it, so the arrays would grow large and crash the program.  Someone before me added an option to clear the arrays, but I am unsure if the way she designed it actually releases the memory since they are still reporting some problems.  The user enters a number in a control "Clear After:".  On every iteration that is a multiple of that number, the program passes the shift register an array with one element.  The array that is passed set up the same as the array passed for the initialization process. 
    My concern is that the code never specifically says delete the array or release the memory.  It feels very similar to the situation in C++ when the programmer dynamically creates an array (using new) but never deallocates the array (using delete), instead they just change where the pointer is pointing.  There the memory would still be tied up and unusable. 
    So I guess my question is, looking at the process above do I need use "Delete from Array" to release the memory and allow the program to run faster on longer experiments with large datasets or does labVIEW automatically deallocate that memory and therefore I should I be looking elsewhere in my program for processes that would slow down everything on longer experiments?
    Thanks,
    Val
    Solved!
    Go to Solution.

    I have attached a photo of the portion of code that I was referring to.  It shows 2 photos so you can see all possibilities in the 2 case statements.
    The first picture is when the cycle is adding new data points, and does not clear the array.
    The second picture shows the program passing through the array (which it does every second cycle) and then "clearing" the array.  (Which as I state above, I didn't know if that was correct).
    (None of this is actually my code, I was hired on to upgrade them from labVIEW 5.1 to labVIEW 2009.  They just asked me to look at this.  It seems to work fine on smaller length experiments on the order of a couple of hours).  If you need anything else from me, don't hesitate to ask.
    Thanks,
    Val
    Attachments:
    loop.docx ‏105 KB

Maybe you are looking for

  • SAP Business One  8.8Client throughs a .Dmp file

    Hi Experts, When we click Set Authorize Button  in Report & Layout Manager  ,SAP Business One  8.8Client throughs a .Dmp file Error and Closes Itself Immediately. Then Also When we try To Open Reports Some times It Throughs The .Dmp File Error And Cl

  • IMessage issues on contacts associated with two different mobile numbers

    Hello together, currently i am facing the following issue: I have a contact "Max Mustermann" associated with to different mobile numbers. Number 1 is a number belonging to his business mobile phone which is an iPhone. Number 2 belongs to his private

  • How to Edit someone's Template.

    Can you help me help out with Templates. Sometimes when I try to help out with coding issues it appears to me that the page is a template page which I have never used.  They have all those "instanceEdit" tags in there. That seems to me to stop me fro

  • Screen resolution yet again

    Although this forum has taught me a lot about screen resolutions, view ports etc. I am still struggling. I am on a broadscreen laptop with screen resolution 1440 x 900 - at the moment perhaps uncommon, but possibly gaining popularity. I have a relati

  • Why does, Apple suggest that I turn off firewall to use features of itunes?

    I'm just wondering why i have to turn off the only defense my mac has to use, Apple tv or Airplay? Is this safe?