Using Assoc Arrays in OBPM 10GR3 for 25 million comparisons

Can we use Associative arrays in OBPM 10GR3 to do 25 million comparisons or even more than that?
I have two assoc arrays which I compare with each other 25 million times by looping them one inside the other.
For e.g.
for(int i = 0; i < 5000; i++)
for(j=0; j < 5000; j++)
if(i==j)
logMessage ("The value is equal");
when I try to do that, I get an error:-
Persistence Data error.
I get this error:-
Error while persisting the transaction data: 'An error occurred while accesing the database. Detail:SQL statement: 'unknown' ' Details: An error occurred while accesing the database. Detail:SQL statement: 'unknown' Caused by: Unexpected exception while enlisting XAConnection java.sql.SQLException: Transaction rolled back: Transaction timed out after 302 seconds BEA1-25BFB4A4F3934EFC9C00 at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1418) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1330) at weblogic.jdbc.wrapper.JTAConnection.getXAConn(JTAConnection.java:189) at weblogic.jdbc.wrapper.JTAConnection.checkConnection(JTAConnection.java:64) at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92) at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:482) at fuego.jdbc.FaultTolerantConnection.prepareStatement(FaultTolerantConnection.java:541) at fuego.server.persistence.jdbc.JdbcServerActivityPersMgr.insertInstanceEvent(JdbcServerActivityPersMgr.java:913) at fuego.server.persistence.Persistence.storeInstanceEvent(Persistence.java:944) at fuego.server.execution.EngineExecutionContext.persistEvents
So can we use such a big comparison on OBPM 10GR3. If yes, how?

Don't use ASSOC Arrays. Use SETs.
Also increase the JTA timeout in Weblogic to like say 600 seconds.

Similar Messages

  • Using Primitive Arrays in JPA

    Is it possible to persist and store arrays of primitive types using the Java Persistence API? If so, is there any special annotation that the array requires?

    Don't use ASSOC Arrays. Use SETs.
    Also increase the JTA timeout in Weblogic to like say 600 seconds.

  • Not using an array of strings

    how do I write a java method without using an array of strings?
    for example:
    import java.io.File;
    public class rename
    public static void main(String[] args)
    File src = new File(args[0]);
    File dst = new File("c:\\temp\\temp.txt");
    boolean wasRenamed = src.renameTo(dst);
    I don't want to have main use an array of strings but I want rename to work as a class

    This is what I changed it to and am getting an -- Exception in thread "main" java.lang.NoSuchMethodError: main
    Sorry this is my first java program
    import java.io.File;
    class App {
         private App() {
              super();
         static final public void main(final String[] args) {
              switch (args.length) {
                   case 1:
                        try {
                             Rename rename = new Rename();
                             rename.rename("c:\\felss\\charles.txt.bak"); // see, it's kind of silly to have same names for class and method
                             System.exit(0);
                        catch (Throwable e) {
                             e.printStackTrace();
                             System.exit(1);
                        break;
                   default:
                        System.err.println("Usage: java App [new name]");
                        System.exit(1);
    public class Rename {
         public Rename() {
              super();
         final public void rename(final String newName) {
              File src = new File(newName);
              File dst = new File("c:\\felss\\charles.txt");
              boolean done = src.renameTo(dst);
    }

  • Internet Explorer CLOSE Button for OBPM 10GR3 Presentations

    Hi all,
    I am using OBPM 10GR3 presentations with a POPUP window.
    I already have a close button to close the presentation. This is a Global Interactive Activity which displays the dashboards.
    The Global Interactive Activity contains a screenflow and inside the screenflow I have a Interactive Component Call to call the presentation.
    Now the presentation opens smoothly and everything is displayed.. When we hit the CLOSE button everything goes away and when we open it again it again comes back to the previous Interactive Component Call and restarts.
    BUT
    When we Close the window itself instead of using the CLOSE button of the presentations, and we re-open, we get the previous data.
    This is because we do not hit the CLOSE button of the presentation instead hit the IE WINDOW CLOSE button on the top right hand corner besides the minimize maximize button.
    Therefore the call is still inside the screenflow inside the Global Interactive Activity and therefore it waits for the user to hit the CLOSE button of the presentations otherwise does not close.
    How can we resolve this issue?
    How can we make sure, that if the user closes the IE WINDOW itself using the CLOSE button, it closes the presentation itself and when re-opened displays the previous presentation?

    Hi,
    First of all this is a training issue with the user. It is not advisable not to press the close button of the IE.
    Nevertheles you can disable to close button of the presentaion.
    You can remove the x from dialogs by doing this. Open the executionDialog.xhtml file in the <OraBPMEnterpriseHomeDirectory>\webapps\workspace\jsf\common directory (both Studio and Enterprise have this file).
    Change the text on line 81 from this:
    <oc:Dialog verticalAlign="top" offsetY="40" backColor="#D4E1EB" borderColor="#517B9E"
    borderStyle="solid" borderWidth="1px" id="executionDialog#{componentBean.id}"
    title="#{fn:getMsg('EXECUTION')}" broadcastName="executionDialog#{componentBean.id}"
    maximized="#{componentBean.executionDialogMaximized}" width="#{componentBean.executionDialogWidth}"
    height="#{componentBean.executionDialogHeight}" titleBarCssClass="bpmWorkspaceDialogHeader"
    displayMaximizeButton="true"
    modal="false" jsObjectName="executionDialog#{componentBean.id}">
    to this:
    <oc:Dialog verticalAlign="top" offsetY="0" backColor="#FFFFFF" borderColor="#FFFFFF"
    borderStyle="solid" borderWidth="1px" id="executionDialog#{componentBean.id}"
    title="#{fn:getMsg('EXECUTION')}" broadcastName="executionDialog#{componentBean.id}"
    maximized="#{componentBean.executionDialogMaximized}" width="#{componentBean.executionDialogWidth}"
    height="#{componentBean.executionDialogHeight}" titleBarCssClass="bpmWorkspaceDialogHeader"
    displayMaximizeButton="true"
    displayCloseButton="false" modal="false" jsObjectName="executionDialog#{componentBean.id}">
    This change does a couple things. The addition of the text "displayCloseButton="false"" removes the x button that is causing the undesired results you're getting and setting the colors to #FFFFFF changes the light blue border around dialog boxes to white.
    Bibhu

  • Use column in 2d array as page number for 3d array

    I have a 2D array coming from a database containing (I simplify a bit for this example)
    column 0: plot number
    column 1: x values
    column 2: corresponding y values
    to be able to process everything and later put it in a graph, i would like to convert it into a 3d array where the page number is the plot number (so column 0) from my original array. I tried two different approaches you can see in the attachment, both give unwanted results:
    1. the resulting array contains two pages with only x2 and y2 for each plot
    2. the resulting array contains two pages with only x1 and y1 for each plot
    What am i doing wrong here?
    As a second difficulty the order in the example 2d array is logical (x1 of plot 1, x1 of plot 2, x2 of plot1.....) .
    The order in the actual array might just as well be as the example in the second attachment
    Thanks!
    Attachments:
    bad order.PNG ‏2 KB
    Move column to page.PNG ‏18 KB

    Attached (LV 8.0) is something I quickly whipped up using the above 2 assumptions as being true. I did not fully test this, so be sure to put it through its paces.
    Your solutions centered on using Insert Into Array. The reason this won't work is because your first x/y pair could be from plot 1 (the second page). But, you cannot insert a second page into an empty array.  I opted for pre-creating the 3D array and then using Replace Array Subset. 
    OK, I posted this before I got the notification that you answered my questions. Given that, then how is one supposed to know the order of the X/Y pairs? Obviously, your example used strings for demonstration. Presumably the real values will be numbers. In this case, how is one supposed to know where to place the new X/Y pair?
    Corollary: Arrays must be rectangular. This means that if plot 0 has 3 XY pairs, but plot 1 has 5, then the 3D array MUST have 5 rows for each page. This means you will have empty rows on page 0. Given this, you are better off creating an array of clusters. Each cluster would contain your XY pairs as a 2D array, and each one can have different number of rows, as shown in this figure:
    Message Edited by smercurio_fc on 03-11-2009 10:43 AM
    Attachments:
    2D Array to 3D Array.vi ‏17 KB
    Example_VI_FP.png ‏5 KB

  • Return value for Direct OBPM SQL Query in OBPM 10GR3

    Hi all,
    I use a direct SQL Query provided by OBPM 10GR3 in my automatic activity to select certain elements from the db. The query is as follows:-
    foreach (element in
    SELECT id FROM TESTTABLE WHERE requestId = 732 and status = 1 )
    // statements
    logMessage("-- The id is-->" +element.id);
    This only returns when the id is found in the db but returns nothing when not found in db?
    How can I always get a return value? atleast a true or false, so that I can put IF statements?
    Because if it returns nothing, the loop does not execute {}? So we cannot put something like:-
    foreach (element in
    SELECT id FROM TESTTABLE WHERE requestId = 732 and status = 1 )
    logMessage("-- The id is-->" +element.id);
    if(element.id == null)
    logMessage("-- Id Not Found -->" );
    else
    logMessage("-- Id Found -->");
    How can I always get a return value from my OBPM direct query ?
    Remember , I am not using DynamicSQL in this case?

    Hi,
    Set a Boolean flag value to False before the SQL query.
    Some thing like:
    boolean flag = false;
    foreach (element in
    SELECT id FROM TESTTABLE WHERE requestId = 732 and status = 1 )
    logMessage("-- The id is-->" +element.id);
    flag = true;
    if(flag) {
    logMessage("-- Id Found -->" );
    else
    logMessage("-- Id Not Found -->");
    Hope the above logic would work fine.
    Bibhu
    Edited by: Bibhuti Bhusan on Sep 2, 2011 11:48 AM

  • Should I be using 2D arrays for this problem (or) how do I go about solving

    An array is being used to represent an organizational hierarchy. This is done by using the array subscript to map to the employee-id and the value in each element to represent the employee-id of the supervisor of the employee.
    For example the first element in the array maps to the supervisor of employee-id 1, the second element maps to the supervisor of employee id 2. The corresponding value for the top person in the organization is set to -1.
    For example the following array ?
    7 5 7 10 -1 7 5 2 2 5
    translates to the following hierarchical structure -
    ? employee 5 is the top boss
    ? employees 2, 7, and 10 report to employee 5
    ? employees 8 and 9 report to employee 2
    ? employees 1, 3 and 6 report to employee 7
    ? employee 4 reports to employee 10
    The following diagram represents the organization structure
    5
    + --- 2
    | + --- 8
    | + --- 9
    |
    + --- 7
    | + --- 1
    | + --- 3
    | + --- 6
    |
    + --- 10
    + --- 4
    5 is at level 1 in the organization.
    2, 7 and 10 are at level 2
    1, 3, 4, 6, 8, 9 are at level 3
    Given an array of size N (the employee-ids being 1 to N), write a program to find the number of people in level L, where the top person in the organization is at level 1.

    Database is overkill!
    heres your assignment
    package myjava.demo;
    class DemoLevel{
         class LevelData{
            int members[];
            int size = 0;
            int level = 0;
            public String toString() { return "Level: " + level + " Size: " + size;}
        LevelData getNextLevel(int data[],LevelData current){
            LevelData nextlevel = new LevelData();
            nextlevel.level = current.level + 1;
            nextlevel.members = new int[data.length];
            for(int i = 0; i< data.length;i = i + 1){
                if(data[i] != -1 && current.members[data[i]-1] != 0){ //data[i] indicates i's parent. this ask if its a member of current
                    nextlevel.members[i] = data[i]-1; //store its parent. not needed in this algo. but better then true and false
                    nextlevel.size = nextlevel.size + 1;
                }else{ nextlevel.members[i] = 0;}
            return nextlevel;
        LevelData getFirstLevel(int data[]){
            LevelData firstlevel = new LevelData();
            firstlevel.level = 1;
            firstlevel.members = new int [data.length];
            for(int i = 0; i < data.length;i = i + 1){
                if(data[i] == -1){
                    firstlevel.members[i] =   -1;
                    firstlevel.size = firstlevel.size + 1;
                }else { firstlevel.members[i] = 0;}
            return firstlevel;
        void execute(){
            int data[] = { 7, 5, 7, 10, -1, 7, 5, 2, 2, 5};
            LevelData current = getFirstLevel(data);
            System.out.println(current);
            while(current.size != 0)
                current = getNextLevel(data,current);
                System.out.println(current);
    public class Demo {
        public static void main(String[] args) {
            DemoLevel dl = new DemoLevel();
            dl.execute();

  • Error while deploying a project to the OBPM 10GR3 Server

    Hi all,
    I am trying to deploy my current project to the OBPM 10GR3 server and it gives me the following exception. I am not sure what is this exception.
    The project compiles well in Studio 10GR3.
    Cannot publish the project.
    'close' is not a function. Caused by: 'close' is not a function.
    Does anybody know what is the exception?

    Got it..
    I was using Fuego.Sql.DynamicSQL.close(Iterator)
    For a an executeUpdate query which returns an int.
    But I used it in a method and did not use that method inside my process or screenflow.
    But it did not give me any error/exception while compiling it in Studio.
    It gave me an exception while publishing in Enterprise.
    This is strange.
    It should have given me an error/exception while compiling itself rather than while publishing in Enterprise.

  • Problem while Introspecting a Web-Service in OBPM 10GR3 studio

    I get the following problem while Introspecting a Web-Service in OBPM 10GR3 studio:-
    Introspecting...
    downloading /test-ws/testc?wsdl [Error] Instrospection exception: Web Service WSDL parse exception: HTTPS hostname wrong: should be <test-01.test.net>...
    Any idea why?
    It runs well in a browser, eclipse and SOAP UI?

    have you create the destination?
    do  you use the wizard to generate code?
    usually there is catch clause for this line of code
    wdContext.currentRequest_SERVICE_MDM_LOOKUPElement().modelObject().execute();
    Edited by: John Wu on Dec 16, 2010 11:51 PM

  • Text File opened in Wordpad cannot be parsed on OBPM 10GR3

    Hi all,
    Text File opened in Wordpad cannot be parsed on OBPM 10GR3
    Why is that?
    I use the following code to parse a file:-
    textFile = TextFile();
    textFile.open(name : "C:\testFile.txt");
    logMessage("---Does file exist?--> " + textFile.exists);
    foreach (line in textFile.lines) {
    logMessage("-- The LINE is-->" + line);
    pinBlockProcessing.linesCount = pinBlockProcessing.linesCount + 1;
    pinBlockProcessing.deviceIdentifierArray[] = line;
    textFile.close();

    Hi all,
    I also used other two methods to parse such a file which can be opened in Wordpad but not in Notepad.
    1) I used Java.Util.Scanner
    2) I also created and compiled a program/package/class which gets a file and parses it using Java.Util.Scanner using Java in Eclipse.
    I created a JAR out of it and tried to use this JAR in my process by introspecting it and then passing the file to be parsed to the methods in this JAR file.
    But this did not work either. Although the program does work in plain Java in Eclipse. It compiles and parses a a file which can be opened in Wordpad but not in Notepad.
    My program for both these methods was :-
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.Scanner;
    public class Test{
    public static void main(String args[]) throws IOException {
    FileReader fin = new FileReader("./testFile.txt");
    Scanner src = new Scanner(fin);
    src.useDelimiter("\n");
    while (src.hasNext()) {
    System.out.println(src.next());
    fin.close();
    This does not work either.
    All programs and methods work when a text file can be opened in NotePad.
    What could be possible solution in OBPM 10GR3?
    It is something to do with Carriage Return and generating a file in UNIX which when opened in Notepad shows one straight horizontal line and when opened in Wordpad shows vertical lines.

  • Aborting an Automatic Activity from OBPM 10GR3 workspace

    Hi all,
    I can abort Interactive Activities from the OBPM 10GR3 workspace just by selecting that instance, the selecting the action as ABORT from the BULK ACTIONS on the right hand side and the entire instance is aborted.
    But how do I abort Automatic Activities from the OBPM 10GR3 workspace?
    When my instance arrives at an automatic activity, I am unable to abort it from the BPM workspace.
    There is no option when you right click an Automatic Activity and select RUNTIME , which says, "If enabled, the instance can be aborted by the user".
    So how do we do that ( from the OBPM 10GR3 Workspace)?

    The "If enabled, the instance can be aborted by the user" needs to be selected when you abort via PAPI...
    Since aotumatic activitys do not appear in the workspace you cannot abort them from there.
    You can connect via PAPI, find the instance and abort it from another instance.
    Even though must automatic activitys are built so they finish before you can even go and abort them.
    I think its a strange design to have an aotumatic activity that is up long enough for you to cancel it but as i said above...
    1) Select abortable on the activity.
    2) Find the instance and abort
    Fuego.Papi.InstanceFilter ifilter = new InstanceFilter();
    ProcessService.connectTo(url : Fuego.Server.directoryURL, user :<username>, password : <password>);
    ifilter.create(processService : ProcessService);
    ifilter.searchScope = new SearchScope(participantScope : ParticipantScope.ALL , statusScope : StatusScope.ONLY_INPROCESS);
    //Notice i write public variable and not instance variable
    ifilter.addAttributeTo(variable : <public variable (such as description or one of your own)>, comparator : Comparison.<the one that fits you>, value : <value>);
    Fuego.Papi.Instance[] cInstances = ProcessService.getInstancesByFilter(filter : ifilter);
    foreach (instance in cInstances)
    //Second type of filtering (checking current activity and process), you can check just the activity name if its a unique name
    if (instance.activityName == <aotumatic activity name> && instance.processId.contains(regexp : '/<process name>/'))
    instance.abort();
    I use a similer code snippet to remove Interactive activities.
    Just notice that you filter only the instances you really want to take down.

  • How to install a plugin in OBPM 10GR3

    How do we install a plugin in OBPM 10GR3. Any steps that you guys know of?
    I want to install a plugin which actually needs to be installed for eclipse but since OBPM 10GR3 is built on top of eclipse, I think I can install it in OBPM 10GR3..
    Please guide through the process.?

    BPM Studio (10g) is just a plugin for eclipse. To install other plugins, just use the Help - Software Updates - Find and Install
    HTH,
    -Kevin

  • Should I use Standard C++ Containers and Stuff for games and other real time activities?

    Hello,
    I'm a C++ developer using VS 2012 and VS 2010 for developing AAA titles. I have read about not using STL and other stuff provided in the standard headers that come with VS. I read most of the stuff on the websites based on game programming and some
    are really from the people well known in the industry. I have seen cases where they wont even use vector, list, map and others and not even use utility functions and algorithms. In such cases they write those containers and stuff themselves which has almost
    the same interface and so much of debug and implementation time spent on such huge code.
    I have two questions:
    1: Isn't the C++ implementation that comes with VS optimized for the platform for better performance? Isn't it using some intrinsic functions that people on the client end doesn't know about and supplying their own implementation would indeed be
    more slower in basic container operations such as insert, remove, find, swap, copy? Lets assume that we supply our own custom allocators for faster memory management to every container that we use. Also, they take care of fragmentation, alignment and stuff.
    Why develop custom containers with almost same interface, why not spend that time on writing allocators and other stuff that might actually help?
    2: There are times when we include a lot, a lot, of unnecessary stuff through the standard headers in a huge code base. Unnecessary, because we only needed a thing or two from such huge headers including other huge headers and so on. Now, I know templates
    aren't instantiated unless used, same goes for the members functions inside them and blah blah. Since, these are precompiled headers, it is safe to assume that there is no compile time hit for that unnecessary stuff. My question is, is there any hidden effect
    of such inclusions on code size (executable) that grows with the huge growth of the code base? In my opinion there shouldn't be, but I wanna know I'm not mistaken just in case. 

    Hi
    I can tell you a story about one of our projects. We had to implement a block management system for harddisks (like the parts of file systems that allocate, free blocks and do the bookkeeping stuff). Now, one guy was convinced, that we should use the STL,
    because it's easy to use and very well optimized and things like that. An other one said, that he would implement it by hand. So we decided to do both for a little test. The result was, that the hand implemented thing was much easier to write and much faster...
    and the one using STL saw, that some classes were so slow, that he couldn't believe it... he then tryed to build some classes by hand and exchange them (e.g. array classes and stuff like that) and it was way faster than the STL and he wrote them in minutes
    (!)... since then nobody wanted to use STL again... we don't even try it. It ended that we wrote our own string and array classes and stuff like that... easy little things that we understand. Now it's easy to use and fast and still flexible, because we know
    what it's doing...
    ... but, that's just a story about our development and of course, we're often programming very close to the hardware and also using assembler languages often... so, I don't know what this tells us... you have to decide :-)
    Rudolf

  • How to change the frequency of pulse train on the fly using an array of values?

    Hi all!
    First I want to thank U for the great job you are doing for this forum.
    Iam still busy trying to control a stepper motor, by sending pulses from my E-series 6024 to a compumotor s6- stepper Driver. I've managed to get it working. I desperately need to control the motor using the values from an array. I believe we can use two approaches for that:
    1st - I can get an array of the "numbers of pulses". Each element must run for 10 milliseconds. Using that we can calculate the array of frequencies to send the number of pulses within 10 milliseconds for each specific element. Could we use the arrays of "number of pulses" and frequencies in a "finite pulse train " and up
    date with each element every 10 millisecond?
    2nd - Or Could we use of the frequency array in a "continuous pulse train vi" and update it every 10 milliseconds?
    Please note that I must use the values as they are.
    Can someone please built a good example for me? Your help will be appreciated.
    Regards
    Chris
    Attachments:
    number_of_steps.txt ‏17 KB
    frequency.txt ‏15 KB

    Tiano,
    I will try to better explain the paragraph on LabVIEW. The original paragraph reads ...
    "While in a loop for continuous pulse train generation, make two calls to Counter Set Attribute.vi to set the values for "pulse spec 1" (constant 14) and "pulse spec 2" (constant 15). Following these calls you would make a call to Counter Control.vi with the control code set to "switch cycle" (constant 7). The attached LabVIEW programs demonstrate this flow."
    You can make two calls to Counter Set Attribute or you can make a call to Set Pulse Specs which, if you open this VI, you will see that it is just making two calls to Counter Set Attribute. What you are doing with the Counter Set Attribute VIs is setting two registers called "pulse s
    pec 1" and "pulse spec 2". These two registers are used to configure the frequency and duty cycle of your output frequency.
    The example program which is attached to this Knowledge Base demonstrates how to change the frequency of a continuous generation on the fly. Why continuous? Because changing the frequency of a finite train would be easy. When the train completes it's finite generation you would just change the frequency and run a finite train again. You would not care about the time delay due to reconfiguration of the counter.
    If you would like to change the frequency of the pulse train using a knob, this functionality will have to be added in the while loop. The while loop will be continuously checking for the new value of the knob and using the knob value to set the pulse specs.
    LabVIEW is a language, and as with learning all new languages (spoken or programatic) there is a lot of learning to be accomplished. The great thing is that LabVIEW is much easier than mo
    st languages and the learning curve should be much smaller. Don't fret, you'll be an expert before you know it. Especially since you're tackling a challenging first project.
    Regards,
    Justin Britten

  • Using Variables/Arrays from one class in another

    Hello all,
    First, to explain what I am attempting to create, is a program that will accept input of employee names and hours worked into an array. The first class will accept a command line argument when invoked. If the argument is correct, it will call another class that will gather information from the user via an input box. After all names and hours have been input for employees, this class will calculate the salary based upon the first letter of each employee name and print the total hours, salary, etc. for each employee.
    What I need to do now is to split the second class into two: one that will gather the data and another that will calculate and print the data. Yes, this is an assignment. However, I am trying to learn and I have gotten this far, but I am stuck on how to get a class to be able to use an array/variables from another class.
    I realize the below code isn't exactly cleaned up...yet.
    Code for AverageSalaryGather class:
    import javax.swing.JOptionPane; // uses class JOptionPane
    import java.lang.reflect.Array;     
    import java.math.*;
    public class AverageSalaryGather {
         public static void gatherData() {     
              char[] alphaArray = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z'};
              String[][] empInfoArray = new String[100][4];
              String[] empNameArray = new String[100];
              String finalOutput = "Name - Rate - Hours - Total Pay\n";
              String averageHoursOutput = "Average Hours Worked:\n";
              String averageSalaryOutput = "Average Hourly Salary:\n";
              String averageGroupSalaryOutput = "Average Group Salary:\n";
                        String[] rateArray = new String[26];
                        char empNameChar = 'a';
              int empRate = 0;
              int payRate = 0;
                        for (int i = 0; i < 26; i++) {
                   payRate = i + 5;
                   rateArray[i] = Integer.toString(payRate);
                        int countJoo = 0;
              while (true) {
                   String namePrompt = "Please enter the employee name: ";
                   String empName = JOptionPane.showInputDialog(namePrompt);
                                  if (empName == null | empName.equals("")) {
                        break;
                   else {
                        empInfoArray[countJoo][0] = empName;
                        for (int i = 0; i < alphaArray.length; i++) {
                             empNameChar = empName.toLowerCase().charAt(0);
                                                      if (alphaArray[i] == empNameChar) {
                                  empInfoArray[countJoo][1] = rateArray;
                                  break;
                        countJoo++;
              // DecimalFormat dollarFormat = new DecimalFormat("$#0.00");
              for (int i = 0; i < empInfoArray.length; i++) {
                   if (!(empInfoArray[i][0] == null)) {
                        String hourPrompt = "Please enter hours for " + empInfoArray[i][0] + ": ";
                        String empHours = JOptionPane.showInputDialog(hourPrompt);
                        int test = 0;
                        empInfoArray[i][2] = empHours;
                        // convert type String to double
                        //double tmpPayRate = Double.parseDouble(empInfoArray[i][1]);
                        //double tmpHours = Double.parseDouble(empInfoArray[i][2]);
                        //double tmpTotalPay = tmpPayRate * tmpHours;
                        // create via a string in empInfoArray
                             BigDecimal bdRate = new BigDecimal(empInfoArray[i][1]);
                             BigDecimal bdHours = new BigDecimal(empInfoArray[i][2]);
                             BigDecimal bdTotal = bdRate.multiply(bdHours);
                             bdTotal = bdTotal.setScale(2, RoundingMode.HALF_UP);
                             String strTotal = bdTotal.toString();
                             empInfoArray[i][3] = strTotal;
                        //String strTotalPay = Double.toString(tmpTotalPay);
                        //empInfoArray[i][3] = dollarFormat.format(tmpTotalPay);
                        else {
                             break;
              AverageSalaryCalcAndPrint averageSalaryCalcAndPrint = new AverageSalaryCalcAndPrint();
              averageSalaryCalcAndprint.calcAndPrint();
    Code for AverageSalaryCalcAndPrint class (upon compiling, there are more than a few complie errors, and that is due to me cutting/pasting the code from the other class into the new class and the compiler does not know how to access the array/variables from the gatherData class):
    import javax.swing.JOptionPane; // uses class JOptionPane
    import java.lang.reflect.Array;
    import java.math.*;
    public class AverageSalaryCalcAndPrint
         public static void calcAndPrint() {     
              AverageSalaryGather averageSalaryGather = new AverageSalaryGather();
              double totalHours = 0;
              double averageHours = 0;
              double averageSalary = 0;
              double totalSalary = 0;
              double averageGroupSalary = 0;
              double totalGroupSalary = 0;
              int countOfArray = 0;
              for (int i = 0; i < empInfoArray.length; i++) {
                   if (!(empInfoArray[0] == null)) {
                        totalSalary = totalSalary + Double.parseDouble(empInfoArray[i][1]);
                        totalHours = totalHours + Double.parseDouble(empInfoArray[i][2]);
                        totalGroupSalary = totalGroupSalary + Double.parseDouble(empInfoArray[i][3]);
                        countOfArray = i;
              averageHours = totalHours / (countOfArray + 1);
              averageSalary = totalSalary / (countOfArray + 1);
              averageGroupSalary = totalGroupSalary / (countOfArray + 1);
              String strAverageHourlySalary = Double.toString(averageSalary);
              String strAverageHours = Double.toString(averageHours);
              String strAverageGroupSalary = Double.toString(averageGroupSalary);
              for (int i = 0; i < empInfoArray.length; i++) {
                   if (!(empInfoArray[i][0] == null)) {
                        finalOutput = finalOutput + empInfoArray[i][0] + " - " + "$" + empInfoArray[i][1] + "/hr" + " - " + empInfoArray[i][2] + " - " + "$" + empInfoArray[i][3] + "\n";
              averageHoursOutput = averageHoursOutput + strAverageHours + "\n";
              averageSalaryOutput = averageSalaryOutput + strAverageHourlySalary + "\n";
              averageGroupSalaryOutput = averageGroupSalaryOutput + strAverageGroupSalary + "\n";
              JOptionPane.showMessageDialog(null, finalOutput + averageHoursOutput + averageSalaryOutput + averageGroupSalaryOutput, "Totals", JOptionPane.PLAIN_MESSAGE );

    Call the other class's methods. (In general, you
    shouldn't even try to access fields from the other
    class.) Also you should be looking at an
    instance of the other class, and not the class
    itself, generally.Would I not call the other classes method's by someting similar as below?:
    AverageSalaryCalcAndPrint averageSalaryCalcAndPrint = new AverageSalaryCalcAndPrint();
              averageSalaryCalcAndprint.calcAndPrint(); Well... don't break down classes based on broad steps
    of the program. Break them down by the information
    being managed. I'm not expressing this well...Could you give an example of this? I'm not sure I'm following well.
    Anyway, you want one or more objects that represent
    the data, and operations on that data. Those
    operations include calculations on the data. Other
    classes might represent the user interface, and
    different output types (say, a file versus the
    console).Yes, the requirements is to have a separate class to gather the data, and then another class to calculate and print the data. Is this what you mean in the above?

Maybe you are looking for

  • How can I use two different page orientations in the same document?

    I am trying to have both portrait and landscape page orientations in the same document.  Pages doesn't seem to like this.  Is there a way?

  • Start Adobe Photoshop CS4

    Is it at all possible to start adobe photoshop cs4 automatically when I start up windows 7? instead of starting the application manually.

  • Problem with ecc 6.0

    hi experts,    I had installed ecc 6.0 ,    while installation i had selected EP, ep core and Process      Integration component also. i want to configure the SAP XI , how can i do it plz help me Edited by: kavitha l on Jan 17, 2008 5:53 AM

  • Multiple URL services in CCM 5.x

    Hi sir, i am using CCM 5.x with extension mobility with "enterprise parameter" option. Now i want to use one more service (paging) which use the same service URL. if i define paging service through phone- phone service and subscribe my phone with tha

  • 500 Internal Sever Error...rejected by he HTTP filter

    Hi All, I'm new to OBIEE 11g (so bear with me) and running into an issue with action links and looking for help. I have an action link on a dashboard which navigates to BI content, specifically a Pivot Table Analysis. When I select this link I'm gett