CLD - property booleans

HI
I am fairly new to Labview (Around 6 months experience of assisting someone in a cRIO project) and taught myself from NI site and textbooks. Was trying to solve one of the CLD problem scenarios- car wash and am having trouble dealing with property nodes of booleans.
Those of you who are not familiar with the car wash scenario, it has 2 wash selections and each selection goes through different number of cycles and 3 proximity sensors indicate if the car is out of position.
I used a state machine in the main vi and am sending the references of the clusters to the sub vis and invoking value change property nodes on them to update them, and used the pausable elapsed time example to keep track of time and pause the time when the vehicle is out of position. 
Attached is my attempt, and it worked just perfectly satisfying all the conditions until I tried to send the stop boolean to the sub vi to stop it. After reading lots of posts on the discussion forums, even tried changing the mechanical action to switch than latch and still the boolean property node throws an error. The sub vi has a case structure in a while loop and I am assuming everything runs in parallel (Am I correct?) 
Can anybody please suggest a way to deal with the stop button and why it is throwing an error ?
Please please ignore my error handling and the missing documentation. I promise I will work on it
--dee
Attachments:
My Car wash.llb ‏101 KB

I tried to read the stop using a global variable but still it takes a little time to stop. Before that I still want to know why the ref number to the boolean is misbehaving
Thanks
--dee
Attachments:
My Car wash.llb ‏106 KB

Similar Messages

  • Set ALV Cell visibility property

    Hi,
    I would have 2 tables for ALV. One table consists of the data to be bound to the ALV. The other table would have the read only property(boolean) filled for each of the ALV cells.
    I would want to set the property of each ALV cell using the second table. How do i do that?
    Currently i am just testing it for few attributes statically using the below code.
    DATA lo_nd_date_table TYPE REF TO if_wd_context_node.
    DATA lo_el_date_table TYPE REF TO if_wd_context_element.
    DATA: lt_ele_set TYPE wdr_context_element_set.
    navigate from <CONTEXT> to <DATE_TABLE> via lead selection
      lo_nd_date_table = wd_context->get_child_node( name = wd_this->wdctx_date_table ).
    lt_ele_set = lo_nd_date_table->get_elements( ).
      LOOP AT lt_ele_set INTO lo_el_date_table.
          lo_el_date_table->set_attribute_property(
               attribute_name = 'WK02'                                 -
    > Attribute Name (Column Name)
               property       = if_wd_context_element=>e_property-read_only
               value          =  'X' ).
    << Similarly for other attributes>>
    ENDLOOP.
    I have inserted this code at the end. Initially few other properties were set to the cells.
    This seems to be not working.
    Regards,
    Rekha
    Edited by: Rekha Gopinath on Sep 8, 2009 10:40 AM

    Hi Lekha,
    In my case, the columns represents dates. The rows represent projects. So, only those row cells are editable where the project is valid.
    1. I have created READ_ONLY attribute for the date node (table).
    2. I am filling the READ_ONLY to abap_true or abap_false based on the following condition.
       Even if one of the projects is not valid for a date, then READ_ONLY = ABAP_TRUE. This means, even if one cell is set to abap_true, then READ_ONLY is set to abap_true.
    3. I modify the date node and bind it with the READ_ONLY set row wise.
    Loop at the data and set read only
      navigate from <CONTEXT> to <DATE_TABLE> via lead selection
      lo_nd_date_table = wd_context->get_child_node( name = wd_this->wdctx_date_table ).
      CALL METHOD lo_nd_date_table->get_static_attributes_table
        IMPORTING
          table  = lt_date_table    .
      LOOP AT lt_date_table INTO ls_date_table.
        lv_tabix = sy-tabix.
          READ TABLE wd_this->gt_prop INTO ls_prop INDEX lv_tabix.
          IF sy-subrc EQ 0.
            IF ls_prop-wk01 = abap_true OR         
              ls_prop-wk02 = abap_true OR
              ls_prop-wk03 = abap_true OR
              ls_prop-wk04 = abap_true OR
              ls_prop-wk05 = abap_true OR
              ls_prop-wk06 = abap_true OR
              ls_prop-wk07 = abap_true OR
              ls_prop-wk08 = abap_true OR
              ls_prop-wk09 = abap_true OR
              ls_prop-wk10 = abap_true OR
              ls_prop-wk11 = abap_true OR
              ls_prop-wk12 = abap_true OR
              ls_prop-wk13 = abap_true OR
              ls_prop-wk14 = abap_true OR
              ls_prop-wk15 = abap_true.
              ls_date_table-read_only = abap_true.
            ELSE.
              ls_date_table-read_only = abap_false.
            ENDIF.
          ENDIF.
        MODIFY lt_date_table FROM ls_date_table INDEX lv_tabix TRANSPORTING read_only.
      ENDLOOP.
      CALL METHOD lo_nd_date_table->bind_table
        EXPORTING
          new_items            = lt_date_table
          set_initial_elements = abap_true.
    4. I loop through the column reference and use the code mentioned earlier.
              CREATE OBJECT lr_input
                EXPORTING
                  value_fieldname = lv_id.
              lo_column->set_cell_editor( value  = lr_input ).
              lr_input->set_read_only_fieldname( value = 'READ_ONLY' ).
    The expected output is different from the input i had mentioned earlier for Row 1, row 2, Row 3 and row 4. Here, i would get all the rows as non editable except for Row 3.
    I would want to set all columns based on condition.
    Regards,
    Rekha

  • Can't update in mysql

    I am using JSP and MYSQL with a bean that does my database work.
    my search.jsp looks up records, when I click edit it sends the values to my inventory_admin.jsp
    When I make the changes to the data, the data is not saved in the database.
    Please, look see!
    <!--search.jsp-->
    <jsp:useBean id="inventoryBean" scope="session" class="mybeans.inventoryBean" />
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%// Do search with bean.
         String s = request.getParameter("searchField");
         int searchId = -1;
         if(s != null)
              try
                   searchId = Integer.parseInt(s);
              catch(NumberFormatException e) {}
         //Do actual search with bean
         boolean rc = false;
         if(searchId != -1)
              rc = inventoryBean.findByPrimaryKey(searchId);
              %>
    <form action="search.jsp" method="post" enctype="application/x-www-form-urlencoded">
    <h2 align="center">Software Inventory </h2>
    <p align="center"> </p>
    <p>Lookup:
    <input name="searchField" type="text" id="searchField">
    <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
         //Output 'not found' message if needed
         if(rc == false)
              out.println("<P><B>Product not found</B></P>");
    %>
    <table width="25%" border="0">
    <tr>
    <td>Item ID:</td>
    <td><jsp:getProperty name="inventoryBean" property="itemid" /></td>
    </tr>
    <tr>
    <td>Product Name:</td>
    <td><jsp:getProperty name="inventoryBean" property="item" /></td>
    </tr>
    <tr>
    <td>Platform:</td>
    <td><jsp:getProperty name="inventoryBean" property="platform" /></td>
    </tr>
    <tr>
    <td>Serial:</td>
    <td><jsp:getProperty name="inventoryBean" property="serial" /></td>
    </tr>
    <tr>
    <td>Description:</td>
    <td><jsp:getProperty name="inventoryBean" property="description" /></td>
    </tr>
    </table>
    <p>&nosave=yes">EDIT</a></p>
    <p align="center"> </p>
    </body>
    </html>
    <!--inventory_admin.jsp-->
    <jsp:useBean id="inventoryBean" scope="session" class="mybeans.inventoryBean" />
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%-- Copy all form variables at once into the bean--%>
    <jsp:setProperty name="inventoryBean" property="*" />
    <%
         boolean saveResult = false;
         boolean notSaved = false;
         //Save our changes
         String s = request.getParameter("nosave");
         if(s == null || s.equals("yes") == false)
    saveResult = inventoryBean.update();
         else
              notSaved = true;
         //Do search with bean
         s = request.getParameter("itemid");
         int searchId = -1;
         if(s != null)
              try
                   searchId = Integer.parseInt(s);
              catch(NumberFormatException e) {}
         //Do actual search with Bean
         boolean rc;
         if(searchId != -1)
              rc = inventoryBean.findByPrimaryKey(searchId);
    %>
    <h2 align="center">Software Inventory - Edit Mode</h2>
    <FORM action="inventory_admin.jsp" method="post" enctype="application/x-www-form-urlencoded">
    <table width="25%" border="0">
    <tr>
    <td>ITEMID</td>
    <td><jsp:getProperty name="inventoryBean" property="itemid" /></td>
    </tr
    <tr>
    <td>Product Name:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="item" />"></td>
    </tr>
    <tr>
    <td>Platform:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="platform" />"></td>
    </tr>
    <tr>
    <td>Serial:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="serial" />"></td>
    </tr>
    <tr>
    <td>Description:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="description" />"></td>
    </tr>
    </table>
    <%
         if(notSaved == false)
              if(saveResult == true)
                   out.println("Changes saved");
              else
                   out.println("Changes NOT saved");
    %>
    <p><input type="submit" name="Submit" value="Submit"></p>
    <p align="center"> </p>
    </FORM>
    </body>
    </html>
    //inventory.java
    Here is the Bean Im using:
    // inventoryBean.java - Simple database bean for table products
    package mybeans; // Our custom 'package'.
    import mybeans.DBConfigInfo; // Import helper classes
    import mybeans.DBWorker; // for simpler database programming.
    // Import other packages here.
    import java.sql.*; // For database access.
    import java.util.Hashtable; // For findRecords().
    public class inventoryBean
    private boolean isBeanDataValid = false; // Set when bean contains valid data.
    private boolean isDBError = false; // Stores whether there was a processing error.
    private String dbErrorMsg = "(No error)";
    private DBWorker dbWorker; // Helper object for JDBC programming.
    // Attributes
    private String item = "";
    private String platform = "";
    private String serial = "";
    private String description = "";
    private int itemid = 0; // Primary key field
    public void clear()
    // Clears data in all your properties to 'empty' state.
    item = "";
    platform = "";
    serial = "";
    description = "";
    itemid = 0; // Primary key field
    // Accessor Methods
    public void setItem(String newItem) { item = newItem; }
    public String getItem() { return item; }
    public void setPlatform(String newPlatform) { platform = newPlatform; }
    public String getPlatform() { return platform; }
    public void setSerial(String newSerial) { serial = newSerial; }
    public String getSerial() { return serial; }
    public void setDescription(String newDescription) { description = newDescription; }
    public String getDescription() { return description; }
    public void setItemid(int newItemid) { itemid = newItemid; }
    public int getItemid() { return itemid; }
    // Operations
    // Default constructor.
    public inventoryBean()
    // Create a helper object to work with database.
    // DO NOT DELETE THIS CODE.
    dbWorker = new DBWorker();
    // Database Operations
    // Built-in methods:
    public boolean findByPrimaryKey(int searchId)
    // Use this method to find 1 record by primary key for your table.
    // (After this call, all fields will be loaded into your properties.)
    // Clear existing data, if any.
    clear();
    isBeanDataValid = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "SELECT item, platform, serial, description, " +
    "itemid " +
    "FROM products " +
    "WHERE itemid=" + searchId;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Get a result set.
    ResultSet rs = st.executeQuery(sql);
    // 5) Move to first record
    if(rs.next())
    // 6) Retrieve fields into your properties using JDBC get??? methods.
    item = rs.getString("item");
    platform = rs.getString("platform");
    serial = rs.getString("serial");
    description = rs.getString("description");
    itemid = rs.getInt("itemid");
    // 7) Ensure non-null String fields with dbWorker.safeStr()
    item = dbWorker.safeStr(item);
    platform = dbWorker.safeStr(platform);
    serial = dbWorker.safeStr(serial);
    description = dbWorker.safeStr(description);
    // Set result code.
    isBeanDataValid = true;
    // 8) Close all DB objects.
    rs.close();
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in findByPrimaryKey (" + e.getMessage() + ")");
    return isBeanDataValid;
    // Update a record
    public boolean update()
    // Use this to update a record by a primary key.
    boolean resultCode = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "UPDATE products SET item=" + dbWorker.sqlStr(item) + "," +
    "platform=" + dbWorker.sqlStr(platform) + "," +
    "serial=" + dbWorker.sqlStr(serial) + "," +
    "description=" + dbWorker.sqlStr(description)+
    " WHERE itemid=" + itemid;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Run action query.
    int rowsAffected = st.executeUpdate(sql);
    // 5) See if we succeeded (1 recorded affected).
    if(rowsAffected == 1)
    resultCode = true;
    else
    System.out.println("Warning: Can't update in update()!");
    // 6) Close all DB objects.
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in update (" + e.getMessage() + ")");
    return resultCode;
    // Delete a record
    public boolean delete(int deleteId)
    // Use this to delete a record by a primary key.
    boolean resultCode = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "DELETE FROM products WHERE itemid=" + deleteId;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Run action query.
    int rowsAffected = st.executeUpdate(sql);
    // 5) See if we succeeded (1 recorded affected).
    if(rowsAffected == 1)
    resultCode = true;
    else
    System.out.println("Warning: Can't delete ID #" + deleteId + " in delete()!");
    // 6) Close all DB objects.
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in delete (" + e.getMessage() + ")");
    return resultCode;
    // Insert a new record.
    public boolean insert(String newItem, String newPlatform, String newSerial, String newDescription,
    int newItemid)
         // Use this to update a record by a primary key.
    boolean resultCode = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql="INSERT INTO products(item, platform, serial, description, " +
    "itemid) " +
    "VALUES(" + dbWorker.sqlStr(newItem) + "," + dbWorker.sqlStr(newPlatform) + "," + dbWorker.sqlStr(newSerial) + "," + dbWorker.sqlStr(newDescription) + "," +
    newItemid + ")";
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Run action query.
    int rowsAffected = st.executeUpdate(sql);
    // 5) See if we succeeded (1 recorded affected).
    if(rowsAffected == 1)
    resultCode = true;
    else
    System.out.println("Warning: Can't update in insert()!");
    // 6) Close all DB objects.
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in insert (" + e.getMessage() + ")");
    return resultCode;
    public int findMaxPrimaryKey()
    // Use this method to find the current max. value for a primary key
    // in the database for a given table.
    int retVal = -1;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return -1;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "SELECT MAX(itemid) FROM products";
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Get a result set.
    ResultSet rs = st.executeQuery(sql);
    // 5) Move to first record
    if(rs.next())
    // 6) Retrieve fields into your properties using JDBC get??? methods.
    retVal = rs.getInt(1); // Get first and only column.
    // 7) Close all DB objects.
    rs.close();
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in findMaxPrimaryKey (" + e.getMessage() + ")");
    return retVal;
    public Hashtable findRecords(String filter, String orderBy)
    // Use this method to return a Hashtable filled with
    // one or more records. You can specified a 'filter'
    // for finding records and 'orderBy' will determine the sort order.
    Hashtable retVal = new Hashtable();
    retVal.put("ROWCOUNT", "0");
    retVal.put("COLUMNCOUNT", "0");
    retVal.put("STATUS", "EMPTY");
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return retVal;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "SELECT item, platform, serial, description, " +
    "itemid " +
    "FROM products " +
    "WHERE " + filter + " " +
    "ORDER BY " + orderBy;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Get a result set.
    ResultSet rs = st.executeQuery(sql);
    int rowCount = 0;
    // 5) Move to first record (and then next) record.
    while(rs.next())
    // 6) Retrieve fields into your properties using JDBC get??? methods.
    String thisItem = rs.getString("item");
    String thisPlatform = rs.getString("platform");
    String thisSerial = rs.getString("serial");
    String thisDescription = rs.getString("description");
    int thisItemid = rs.getInt("itemid");
    // 7) Ensure non-null String fields with dbWorker.safeStr()
    thisItem = dbWorker.safeStr(thisItem);
    thisPlatform = dbWorker.safeStr(thisPlatform);
    thisSerial = dbWorker.safeStr(thisSerial);
    thisDescription = dbWorker.safeStr(thisDescription);
    // 8) Load this row into our Hashtable.
    // The convention here is to pack each row's column name with an ID
    // indicating the row. "ProjectId" + "0" = "ProjectId0" ===mapped to===> Value
    // Put this record into Hashtable.
    retVal.put("item" + rowCount, thisItem);
    retVal.put("platform" + rowCount, thisPlatform);
    retVal.put("serial" + rowCount, thisSerial);
    retVal.put("description" + rowCount, thisDescription);
    retVal.put("itemid" + rowCount, "" + thisItemid);
    rowCount++;
    // 9) Close all DB objects.
    rs.close();
    st.close();
    dbWorker.close(); // Connection too.
    // Write info to our hashtable--Since this container hold virtually anything,
    // you can put in whatever 'metadata' you want about your result set.
    retVal.put("ROWCOUNT", "" + rowCount);
    retVal.put("COLUMNCOUNT", "5");
    retVal.put("STATUS", "OK");
    catch(SQLException e)
    System.out.println("Error in findRecords (" + e.getMessage() + ")");
    retVal.put("STATUS", "ERROR");
    return retVal;
    //============================================================
    // DO NOT CHANGE THE CODE BELOW.
    //============================================================
    public boolean isValid()
    // Does bean contain real data?
    return isBeanDataValid;
    public boolean isError()
    // Returns true if there was a DB error.
    return isDBError;
    public String getErrorMsg()
    // Returns error message, if any.
    return dbErrorMsg;
    //=====================================================================
    // TODO: Remember to comment out main() with /* */ for production code!
    //=====================================================================
    // TEST DRIVER CODE
    public static void main(String[] args)
    // Test driver code goes here.
    String beanName = "inventoryBean";
    String tableName = "products";
    boolean isDataValidationError = false;
    // Exercise CRUD functionality of this bean.
    System.out.println("==============================================================");
    System.out.println("Starting Test Driver for bean " + beanName + "....");
    System.out.println("==============================================================");
    // Create bean.
    inventoryBean myBean = new inventoryBean();
    // Create a new record.
    int newId = myBean.findMaxPrimaryKey();
    newId++;
    boolean rc = myBean.insert("e", "t", "g", "R",
    newId);
    if(rc)
    System.out.println("SUCCESS: Inserted new record #= " + newId + ".");
    else
    System.out.println("ERROR! Can't insert record #= " + newId + ".");
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    return;
    // Retrieve a record
    rc = myBean.findByPrimaryKey(newId);
    if(rc)
    System.out.println("SUCCESS: Record #" + newId + " found.");
    else
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    System.out.println("ERROR! Record #" + newId + " NOT found.");
    // Simulate using set??? accessor methods with test data.
    // (Note: We don't change the primary key.)
    int testItemid = newId;
    System.out.println("Testing set???() accessor methods....");
    System.out.println("Setting Record #" + newId + " to:");
    System.out.println(" inventoryBean.setItem(testItem); // = R");
    myBean.setItem(testItem);
    System.out.println(" inventoryBean.setPlatform(testPlatform); // = Y");
    myBean.setPlatform(testPlatform);
    System.out.println(" inventoryBean.setSerial(testSerial); // = E");
    myBean.setSerial(testSerial);
    System.out.println(" inventoryBean.setDescription(testDescription); // = k");
    myBean.setDescription(testDescription);
    System.out.println(" inventoryBean.setItemid(testItemid); // = " + newId);
    myBean.setItemid(testItemid);
    // Call update.
    rc = myBean.update();
    if(rc)
    System.out.println("SUCCESS: Record #" + newId + " updated.");
    else
    System.out.println("ERROR! Record #" + newId + " NOT updated.");
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    return;
    // Requery and validate each field.
    rc = myBean.findByPrimaryKey(newId);
    if(rc)
    System.out.println("SUCCESS: Updated Record #" + newId + " found.");
    else
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    System.out.println("ERROR! Record #" + newId + " NOT found");
    // Simulate using get??? accessor methods.
    // Validate updated values against test values.
    System.out.println("Validating Record #" + newId + ":");
    String testData;
    String actualItem = myBean.getItem();
    testData = "R";
    if(testData.equals(actualItem))
    System.out.println(" OK: inventoryBean.getItem() = actualItem");
    else
    System.out.println(" ERROR! inventoryBean.getItem() returned [" + actualItem + "] instead of [R]");
    isDataValidationError = true;
    String actualPlatform = myBean.getPlatform();
    testData = "Y";
    if(testData.equals(actualPlatform))
    System.out.println(" OK: inventoryBean.getPlatform() = actualPlatform");
    else
    System.out.println(" ERROR! inventoryBean.getPlatform() returned [" + actualPlatform + "] instead of [Y]");
    isDataValidationError = true;
    String actualSerial = myBean.getSerial();
    testData = "E";
    if(testData.equals(actualSerial))
    System.out.println(" OK: inventoryBean.getSerial() = actualSerial");
    else
    System.out.println(" ERROR! inventoryBean.getSerial() returned [" + actualSerial + "] instead of [E]");
    isDataValidationError = true;
    String actualDescription = myBean.getDescription();
    testData = "k";
    if(testData.equals(actualDescription))
    System.out.println(" OK: inventoryBean.getDescription() = actualDescription");
    else
    System.out.println(" ERROR! inventoryBean.getDescription() returned [" + actualDescription + "] instead of [k]");
    isDataValidationError = true;
    int actualItemid = myBean.getItemid();
    if(actualItemid == newId)
    System.out.println(" OK: inventoryBean.getItemid() = actualItemid");
    else
    System.out.println(" ERROR! inventoryBean.getItemid() returned [" + actualItemid + "] instead of [" + newId + "]");
    isDataValidationError = true;
    // Cleanup with delete.
    rc = myBean.delete(newId);
    if(rc)
    System.out.println("SUCCESS: Record #" + newId + " deleted.");
    else
    System.out.println("ERROR! Record #" + newId + " NOT deleted.");
    // Now test out findRecords() for up to 100 records.
    Hashtable data = myBean.findRecords("itemid > 0", "itemid");
    String s = (String)data.get("STATUS");
    if(s != null && s.equals("OK"))
    s = (String)data.get("ROWCOUNT");
    int rowCount = Integer.parseInt(s);
    if(rowCount > 100) // Just output first 100 records.
    rowCount = 100;
    System.out.println("SUCCESS: Returning " + rowCount + " records (100 max.) using findRecords():");
    for(int i = 0; i < rowCount; i++)
    System.out.println(" Row #" + i + "=" +
    data.get("item" + i) + ", " +
    data.get("platform" + i) + ", " +
    data.get("serial" + i) + ", " +
    data.get("description" + i) + ", " +
    data.get("itemid" + i));
    else
    System.out.println("ERROR! No rows returned using findRecords()!");
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    return;
    if(isDataValidationError == false)
    // Print final success message.
    System.out.println("================================================================================");
    System.out.println("VALIDATION SUCCESS! Bean " + beanName + " passed all automated tests.");
    System.out.println("================================================================================");
    else
    System.out.println("====================================================================================");
    System.out.println("ERROR! Tests completed but bean " + beanName + " had a data validation error.");
    System.out.println("====================================================================================");

    Couple of pointers.
    1 - use [ code ] tags to post code
    2 - that is WAY too much code for more than a cursory glance. You're lucky the problem was easy to spot.
    Your problem lies in your edit JSP form:
    <td>Product Name:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="item" />"></td>Note that the name of the input field is different from the jsp property you are populating it with.
    In fact, all of your input fields have a name of "description"
    I would recommend on your inventory_admin.jsp page that you put the following debugging code to make sure that the parameter values come through and are set correctly.
      out.println("name = param: " + request.getParameter("name") + "bean = " + inventoryBean.getName() + "<BR>");
      out.println("description = param:" + request.getParameter("description") + "bean = " + inventoryBean.getDescription() + "<BR>");
      ...

  • Why in COM, set smth true, stays true even after System.exit?

    I am using "Jacob" to do COM calls. When I alter the "ShowAll" property of Word.Application and I set it to true, it will then forever be true even if I exit the application AND quit the word application. If I set it to false, the same thing happens, it will always be so. The code to call/set this is:
    (NOTE: This uses classes I made to wrap the Dispatch calls)
    Word wordApp = new Word();
    Documents docs = wordApp.getDocuments();
    Document doc = docs.open("D:\\JavaProjects\\Test.doc");
    //GET VIEW
    View wordView = wordApp.getActiveWindow().getView();
    //PRINT THE VIEW PROPERTIES
    System.out.println("Show All: " + wordApp.getActiveWindow().getView().isShowAll());
    System.out.println("Show Paragraphs: " + wordApp.getActiveWindow().getView().isShowParagraphs());
    //SET THE VIEW PROPERTIES
    wordView.setShowAll(false);
    wordView.setShowParagraphs(true);
    //PRINT THEM AGAIN
    System.out.println("Show All: " + wordApp.getActiveWindow().getView().isShowAll());
    System.out.println("Show Paragraphs: " + wordApp.getActiveWindow().getView().isShowParagraphs());
    doc.close(Document.DO_NOT_SAVE);
    wordApp.quit(new Variant[] {});
    System.exit(0);The actual Dispatch calls are:
    //NO IDEA WHY THIS IS, BUT SHOWALL = TRUE IS -1, AND FALSE IS 0
    private final static int SHOW_ALL_TRUE = -1;
    private final static int SHOW_ALL_FALSE = 0;
    /** SETSHOWPARAGRAPHS **
    * Sets the property (boolean) ShowParagraphs.
    public void setShowParagraphs(boolean showParagraphs)
         Dispatch.put(this, "ShowParagraphs", new Boolean(showParagraphs));
    /** ISSHOWPARAGRAPHS **
    * Returns Boolean of whether or not this is set to show paragraphs.
    public boolean isShowParagraphs()
         return getBooleanValue(Dispatch.get(this, "ShowParagraphs"));
    private boolean getBooleanValue(Variant variantBoolean)
         //MAKE IT AN INTEGER AND GET ITS int VALUE
         int intVariant = new Integer(variantBoolean.toString()).intValue();
         //RETURN IF IS SHOW ALL
         return (intVariant == View.SHOW_ALL_TRUE);
    }I'm wondering if the problem is that I get back either -1 or 0 and if maybe that means something else?

    1: Properties persistence is not a DEFECT but a FEATURE . It was implemented in MS Word so users could change MS word WITHOUT HAVING TO DO IT EACH TIME THEY START IT UP.
    2: Don't you intialise all your variables in your code after you instanciated them ? I am sure you do so and therefore the persitence feature you described should not be annoying you at all. It is not necessary to intialise variables in the BASIC langage but that does not mean you should not do it.
    3: (-1) was chosen arbitrary by Microsoft as the TRUE value for Boolean datatype and 0 the value for FALSE when they designed Visual Basic. This is not a problem if you write code properly
    I recommend you test bool variable in any langages using the following test:
    (myBool <> 0)
    HAVE A THINK ABOUT IT
    Finally,
    you need to understand what you are working with before you complain about it.
    Argument for Argument sake is not good and if you think MS word is a bad program just don't use it. go and write your own word processor in JAVA.
    GOOD LUCK
    I WISH TO APOLOGISE FOR ANY POSSIBLE SPELLING OR GRAMMATICAL MISTAKES I COULD HAVE MADE IN THIS REPLY. ENGLISH NOT BEING MY FIRST LANGUAGE.

  • Making SOAP calls to a 3rd party Web service with PeopleCode

    Hi everyone :) I'm new to PS and have two questions (the first is most important):
    1. Are there any good resources for using PeopleCode to make SOAP (or even GET/POST) requests to Web services hosted outside a PS environment? I found [this page|http://www.zutshigroup.com/site/tech/peoplesoft_soap_example], but it doesn't appear to connect to a remote WSDL.
    2. How does development work, exactly? I'm used to the standard web languages where you launch a local dev server like IIS, launch an IDE, build code, and view the output in a browser. Does the PS model work like this?
    I am a developer for a company who offers Web services and am soon going to be remotely connecting to another company's PS dev environment to develop some sample code for them that integrates our services with their PS. I have no experience with the platform and due to the complexity of the PS installation won't be able to try it out before I begin developing. I would like to get as good a feel for this platform as I can before the meeting.
    I appreciate any information you can give me on sample code resources, workflow concepts, etc, but my question is primarily about SOAP requests. I can research the rest.
    Thank you!
    Edited by: user10655996 on Nov 26, 2008 3:09 PM

    Hi,
    Not sure if that App Package is available in versions below 9. But, I think it should be available since PS internally does use the same App Class for integrating with Tax softwares like Vertex and Taxware. Also that example is used when one does not want to make use of any IB Objects...
    You can definitely go ahead and make use of Standard IB Objects to Consume and Provide a Web Service in PS...
    Would like to know, if PS is the Consumer or the Provider?
    If PS is the Consumer then you can have a look at the code below ...
    import PT_IB_UDDI:UDDIException;
    class XMETHODS
    method XMETHODS();
    method AssignConnInfo();
    method IBInfoMethods();
    method IBInfoIBConnectorMethods();
    method WriteRequest(&ReqXML As XmlDoc);
    method WriteResponse(&ResXML As XmlDoc);
         * Helper function to throw appropriate exeception whenever ConnectorRequest returns null response.
    method HandleNullSoapResponse(&soapMs As XmlDoc, &ul As string);
    method HandleSoapFault(&soapReq As XmlDoc, &soapFaultNode As XmlNode);
    method CreateSOAPDocument();
    property Message req;
    property Message res;
    property boolean b;
    property string url;
    property string UserName;
    property string Str_Process;
    property string Str_TransID;
    property string Str_SourceNode;
    property string Str_ReqNodeName;
    property string Str_ReqNodeDescr;
    property string Str_ConnectorClass;
    property string Str_ConnectorName;
    property string Str_PathInfo;
    private
    rem Constant &NULL_SOAP_RESPONSE = 15301;
    Constant &NULL_SOAP_RESPONSE = 16022;
    Constant &BAD_RESPONSE_STATUS = 15303;
    Constant &NON_XML_RESPONSE = 15304;
    end-class;
    /* Constructor */
    method XMETHODS
    %This.CreateSOAPDocument();
    end-method;
    method IBInfoMethods
    &UserName = &req.IBInfo.OrigUser;
    &Str_Process = &req.IBInfo.OrigProcess;
    &Str_TransID = &req.IBInfo.TransactionID;
    &Str_SourceNode = &req.IBInfo.SourceNode;
    &Str_ReqNodeName = &req.IBInfo.RequestingNodeName;
    rem &Str_ReqNodeDescr = &req.IBInfo.RequestingNodeDescription;
    end-method;
    method IBInfoIBConnectorMethods
    &Str_ConnectorClass = &req.IBInfo.IBConnectorInfo.ConnectorClassName;
    &Str_ConnectorName = &req.IBInfo.IBConnectorInfo.ConnectorName;
    &Str_PathInfo = &req.IBInfo.IBConnectorInfo.PathInfo;
    end-method;
    method WriteRequest
    /+ &ReqXML as XmlDoc +/
    Local File &ppfile1 = GetFile("C:\temp\XMETHODS_SOAP_" | %Datetime | ".out", "W", %FilePath_Absolute);
    &ppfile1.WriteString(&ReqXML.GenFormattedXmlString());
    &ppfile1.Close();
    end-method;
    method WriteResponse
    /+ &ResXML as XmlDoc +/
    Local File &ppfile = GetFile("C:\temp\XMETHODS_MESSAGE_" | %Datetime | ".out", "W", %FilePath_Absolute);
    &ppfile.WriteString(&xml.GenFormattedXmlString());
    &ppfile.Close();
    end-method;
    method HandleNullSoapResponse
    /+ &soapMs as XmlDoc, +/
    /+ &ul as String +/
    Local PT_IB_UDDI:UDDIException &ex = create PT_IB_UDDI:UDDIException(&NULL_SOAP_RESPONSE);
    &ex.DefaultText = "There is no reply from the Web server hosting the Web Service at '%1'.";
    &ex.SetSubstitution(1, &ul);
    &ex.SoapRequest = &soapMs.GenFormattedXmlString();
    throw &ex;
    end-method;
    method HandleSoapFault
    /+ &soapReq as XmlDoc, +/
    /+ &soapFaultNode as XmlNode +/
    Local PT_IB_UDDI:UDDIException &ex = create PT_IB_UDDI:UDDIException(0);
    &ex.SoapRequest = &soapReq.GenFormattedXmlString();
    &ex.InitFromSoapFault(&soapFaultNode);
    throw &ex;
    end-method;
    method AssignConnInfo
    &req.IBInfo.IBConnectorInfo.ConnectorClassName = "HttpTargetConnector";
    /* Specifies OutBound Request */
    &b = &req.IBInfo.IBConnectorInfo.AddConnectorProperties("Method", "POST", %HttpProperty);
    &b = &req.IBInfo.IBConnectorInfo.AddConnectorProperties("Content-Type", "text/xml", %Header);
    &b = &req.IBInfo.IBConnectorInfo.AddConnectorProperties("SOAPUpContent", "Y", %HttpProperty);
    &b = &req.IBInfo.IBConnectorInfo.AddConnectorProperties("Authorization", "Basic cHJhc2hhbnQ6cHJha2FzaA==", %Header);
    /* End Point */
    &url = "http://webservices.daelab.net/datesservice/datesservice.wso";
    rem &url = GetURL(URL.XMETHODS_MONTH);
    &b = &req.IBInfo.IBConnectorInfo.AddConnectorProperties("URL", &url, %HttpProperty);
    end-method;
    method CreateSOAPDocument
    REMARK ENDPOINT = "http://webservices.daelab.net/datesservice/datesservice.wso";
    rem Local Message &req, &res;
    Local SOAPDoc &soap;
    Local XmlDoc &xml;
    rem Local boolean &b;
    Local integer &i;
    Local XmlNode &node;
    Local number &num;
    rem Local string &UserName;
    rem Local string &Str_Process, &Str_SourceNode, &Str_ReqNodeName;
    rem Local string &Str_ConnectorClass, &Str_ConnectorName;
    rem Local string &Str_PathInfo;
    Local array of XmlNode &nodes;
    &req = CreateMessage(Operation.XMETHODS, %IntBroker_Request);
    &soap = CreateSOAPDoc();
    /* set the Month Number */
    &num = Z_EXAMPLE_WRK.ACCESS_ID.Value;
    If &num <= 0 Or
    None(&num) Or
    &num >= 13 Then
    &num = 1;
    End-If;
    Local string &soapstr = GetHTMLText(HTML.XMETHODS, &num); /* SOAP 1.1 */
    rem Local string &soapstr = GetHTMLText(HTML.XMETHODS_12, &num); /* SOAP 1.2 */
    Local boolean &bool = &soap.ParseXmlString(&soapstr);
    &xml = &soap.XmlDoc;
    * Test Whether we can send a PSNONXML format for SOAP Requests - AND YES WE CAN SEND THAT
    Local string &encoded = Substitute(&xml.GenXmlString(), "<?xml version=""1.0""?>", "<?xml version=""1.0"" encoding=""UTF-8""?>");
    /* Encode the XML as a PSNONXML String and create the XML again */
    Local string &nonXmlData = "<?xml version=""1.0""?><data psnonxml=""yes""><![CDATA[" | &encoded | "]]></data>";
    rem %This.WriteRequest(&xml);
    /* Assign the Request to a Page Field */
    Z_EXAMPLE_WRK.XML_TESTI.Value = &xml.GenFormattedXmlString();
    /* Assign Connector and relevant Properties */
    %This.AssignConnInfo();
    /* Assign the XML Object to a Message Object */
    &xml = CreateXmlDoc(&nonXmlData);
    rem Z_EXAMPLE_WRK.XML_TESTI.Value = &xml.GenFormattedXmlString();
    rem %This.WriteRequest(&xml);
    &req.SetXmlDoc(&xml);
    /*IBInfo Methods */
    %This.IBInfoMethods();
    /* IBConnectorInfo Methods */
    %This.IBInfoIBConnectorMethods();
    rem &res = CreateMessage(Operation.XMETHODS_RESP, %IntBroker_Response);
    &res = %IntBroker.ConnectorRequest(&req);
    /* Additional Error Handling */
    If &res = Null Then /* Throw exception */
    %This.HandleNullSoapResponse(&xml, &url);
    End-If;
    /* Check for soap faults */
    &xml = &res.GetXmlDoc();
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body>
              <soap:Fault>
    If &xml <> Null Then
    Local array of XmlNode &faultNodes = &xml.DocumentElement.GetElementsByTagNameNS("http://schemas.xmlsoap.org/soap/envelope/", "Fault");
    If &faultNodes <> Null And
    &faultNodes.Len > 0 Then
    %This.HandleSoapFault(&xml, &faultNodes [1]);
    End-If;
    End-If;
    /* Check response Status */
    If &res.ResponseStatus <> 0 Then
    Local PT_IB_UDDI:UDDIException &ex1 = create PT_IB_UDDI:UDDIException(&BAD_RESPONSE_STATUS);
    &ex1.SetSubstitution(1, NumberToString("", &res.ResponseStatus));
    &ex1.SoapRequest = &xml.GenFormattedXmlString();
    throw &ex1;
    End-If;
    If &xml = Null Then
    /* Some error in returned object. Does not look like valid Xml */
    Local PT_IB_UDDI:UDDIException &ex2 = create PT_IB_UDDI:UDDIException(&NON_XML_RESPONSE);
    &ex2.SoapRequest = &xml.GenFormattedXmlString();
    throw &ex2;
    End-If;
    /* retrieve the response */
    &xml = &res.GetXmlDoc();
    Z_EXAMPLE_WRK.XMLLINKDTD.Value = &xml.GenFormattedXmlString();
    %This.WriteResponse(&xml);
    end-method;
    Thanks
    Prashant

  • Is flash playing?

    I have spent a lot of time trying to find out if it is
    possible to detect if a flash 8 file is playing or if it has
    stoped. Basicly I need a property (boolean) in the MovieClip class
    like "isPlaying". In earlyer versions of flash I have extended the
    play - stop - gotoAndPlay - gotoAndStop functions and applied code
    that sets a boolean value, but I have not succeeded in doing so in
    Flash8. There are several solutions like using onEnterFrame, and
    intervals to check for diffrences in _current frame, but I'm
    looking for a more "clean" code. In my project I am loading several
    swf's therefore I cannot create an extended version of the
    MovieClip, unless it is possible to modify the class files in "Firs
    Run\Classes\FP8"
    I was supprised not to fint much about this issue, please let
    me be adviced if you have any experiences in this concern.

    I guess it is possible, but I still dont see how.
    In my project I have to flash files, a main file which I
    embed in html, and a "sub" file which is beeing loaded into a
    container. In earlyer versions of my project I had a code in the
    first keyframe of the sub file, which was simular to this:
    this.play_org = function = play;
    play = function () {
    this.play_org();
    this.m_bPlaying=true;
    I olso had simular to the above code for stop - gotoAndPlay -
    gotoAndStop. The main flash file checks on diffrent intervals if
    the sub movieclip is playing, and triggers diffrent events based on
    the result.
    The old code does not work in flash 8, so I have to find
    another way/code. Do you know if it is possible to re-write the
    code in the folder "Firs Run\Classes\FP8" that adds the above
    functionality to all flash files I create?

  • Waiting for class instatiation

    What is the best way to achieve the following:
    My _root timeline reaches frame 10 labeled init. On this
    frame their are
    several MovieClips on the stage, and a couple are attached at
    run time.
    Each of these MovieClips is defined by a class and each
    contains a doInit()
    function.
    First off, is a class Object instantiated when an instance of
    it appears on
    the Stage or is attached, is that right? Second, say I have 6
    different
    instances of these MovieClips and each is running a doInit
    function... what
    is the best way to alert another function (a function that
    will actually
    move these MovieClips onto the Stage with _x, _y and _alpha
    Tweening) after
    all of my classes doInit() function are done.
    I figured I could create an instance property (Boolean) in
    each class to
    define its completion status called isInited... then have a
    timer loop
    checking the return values of all the classes for some method
    like
    getIsInited() and only running my Tween functions at that
    time then delting
    itself.
    But, I also figure there is a way to do it with a
    listener/broadcaster
    solution. It makes a lot more sense to me to have the classes
    either inited
    in a chain with the final one broadcasting a message, or have
    each one
    broadcast a message and only run when all have been
    broadcast... does this
    make any sense?
    I have not done to much with listerners expept for movieclip
    loaders. Is
    this a job for adBroadcast?
    Thanks for any help.

    "SMB" <[email protected]> wrote in message
    news:ecl7of$ce7$[email protected]..
    > What is the best way to achieve the following:
    >
    > My _root timeline reaches frame 10 labeled init. On this
    frame their are
    > several MovieClips on the stage, and a couple are
    attached at run time.
    > Each of these MovieClips is defined by a class and each
    contains a
    > doInit() function.
    >
    > First off, is a class Object instantiated when an
    instance of it appears
    > on the Stage or is attached, is that right? Second, say
    I have 6
    > different instances of these MovieClips and each is
    running a doInit
    > function... what is the best way to alert another
    function (a function
    > that will actually move these MovieClips onto the Stage
    with _x, _y and
    > _alpha Tweening) after all of my classes doInit()
    function are done.
    >
    > I figured I could create an instance property (Boolean)
    in each class to
    > define its completion status called isInited... then
    have a timer loop
    > checking the return values of all the classes for some
    method like
    > getIsInited() and only running my Tween functions at
    that time then
    > delting itself.
    >
    > But, I also figure there is a way to do it with a
    listener/broadcaster
    > solution. It makes a lot more sense to me to have the
    classes either
    > inited in a chain with the final one broadcasting a
    message, or have each
    > one broadcast a message and only run when all have been
    broadcast... does
    > this make any sense?
    >
    > I have not done to much with listerners expept for
    movieclip loaders. Is
    > this a job for adBroadcast?
    >
    > Thanks for any help.
    >
    I just thought of something and tried it. I removed a couple
    of component
    comboBoxes from a MovieClip instance on the Stage that acts
    as a selection
    interface. It seems that when I do my Tweens, the load is too
    much and the
    Tween is not seen. Any ideas here?

  • Problem matching two objects

    This is my code
    import java.util.Vector;
    public class Matching {
         public Matching() {
         public Vector getMatch(int custID, Vector allCustomer, Vector allHouses) {
              //Vector allCustomers;
              //allCustomers = client.getCustomers;
              //Vector allHouses;
              //allHouses = properties.getHouses;
              Customer customer = new Customer();
              Property house = new Property();
              boolean priceMatch; priceMatch = false;
              boolean typeMatch; typeMatch = false;
              boolean bedroomsMatch; bedroomsMatch = false;
              boolean parkingMatch; parkingMatch = false;
              int matchCounter; matchCounter = 0;
              boolean overallMatch; overallMatch = false;
              Vector matches = new Vector(0);
              if ( allCustomer.size() > 0 ) {
                   customer = (Customer) allCustomer.elementAt(custID);
              System.out.println("Customer Name is: "+customer.name);
              house = (Property) allHouses.elementAt(0);
              int i; i = 0;
              //while (customer.name != null) {     
                   matches.addElement(customer);
                   while (i < allHouses.size()) {
                        house = (Property) allHouses.elementAt(i);
                        i++;
                        try {
                             int customerPrice;
                             customerPrice = Integer.valueOf(customer.price).intValue();
                             int housePrice;
                             housePrice = Integer.valueOf(house.price).intValue();
                             int highPrice;
                             highPrice = customerPrice + ((customerPrice / 100) * 10);
                             int lowPrice;
                             lowPrice = customerPrice - ((customerPrice / 100) * 10);
                             if ((housePrice < highPrice) && (housePrice > lowPrice)) {
                                  priceMatch = true;
                        catch ( NullPointerException e ) {
                             //The price field was blank
                             priceMatch = false;
                        catch ( NumberFormatException e ) {
                             //the price field was blank
                             priceMatch = false;
                        if ( (house.parking != null) && (customer.parking != null) ){
                             parkingMatch = true;
                        }else{
                             parkingMatch = false; }
                        try {
                             if (customer.type.equals(house.type)) {
                                  typeMatch = true;
                        catch ( NullPointerException e ) {
                             typeMatch = false;
                   catch ( NumberFormatException e ) {
                             typeMatch = false;
                        try {
                             if (customer.bedrooms.equals(house.bedrooms)) {
                                  bedroomsMatch = true;
                        catch ( NullPointerException e ) {
                             bedroomsMatch = false;
                        catch ( NumberFormatException e ) {
                             bedroomsMatch = false;
         //if ((priceMatch == true) && (typeMatch == true)) {
         //     overallMatch = true;
         //     }else{
         //          overallMatch = false; }
                   if (priceMatch == true) {
                   matchCounter++; }
                   if (typeMatch == true) {
                   matchCounter++; }
                   if (bedroomsMatch == true) {
                   matchCounter++; }
                   if (parkingMatch == true) {
                   matchCounter++; }
                        if (matchCounter == 4) {
                        overallMatch = true;
                   }else{
                   overallMatch = false; }
                                                 //continue
                             if (overallMatch == true) {
                                  matches.addElement(house);
                                  overallMatch = false;
                                  typeMatch = false;
                                  priceMatch = false;
                                  bedroomsMatch = false;
                                  parkingMatch = false;
    matchCounter = 0;
                        //i ++;
                        //house = (Property) allHouses.elementAt(i);
         return matches;
    This class gets two objects (a house and a customer) and then matches them based on criteria, puts the objects in a vector and then sends it to another class to be used in a report. If i turn the rest of the code into comments so that i am only matching the house and customer with one criteria (e.g. is the house type the same as the customer type), then it works correctly and produces a vector with one customer and all the houses which have the same type. however whenever i try and match the houses with the customer based on two or more criteria, then it picks houses which dont necessarily match this criteria.
    any help would be greatly appreciated as i am really stuck and dont know who to turn to
    thanx

    import java.util.Vector;
    public class Matching {
    public Matching() {
    public Vector getMatch(int custID, Vector allCustomer, Vector allHouses) {
    //Vector allCustomers;
    //allCustomers = client.getCustomers;
    //Vector allHouses;
    //allHouses = properties.getHouses;
    Customer customer = new Customer();
    Property house = new Property();
    boolean priceMatch; priceMatch = false;
    boolean typeMatch; typeMatch = false;
    boolean bedroomsMatch; bedroomsMatch = false;
    boolean parkingMatch; parkingMatch = false;
    int matchCounter; matchCounter = 0;
    boolean overallMatch; overallMatch = false;
    Vector matches = new Vector(0);
    if ( allCustomer.size() > 0 ) {
    customer = (Customer) allCustomer.elementAt(custID);
    System.out.println("Customer Name is: "+customer.name);
    house = (Property) allHouses.elementAt(0);
    int i; i = 0;
    //while (customer.name != null) {
    matches.addElement(customer);
    while (i < allHouses.size()) {
    house = (Property) allHouses.elementAt(i);
    i++;
    try {
    int customerPrice;
    customerPrice = Integer.valueOf(customer.price).intValue();
    int housePrice;
    housePrice = Integer.valueOf(house.price).intValue();
    int highPrice;
    highPrice = customerPrice + ((customerPrice / 100) * 10);
    int lowPrice;
    lowPrice = customerPrice - ((customerPrice / 100) * 10);
    if ((housePrice < highPrice) && (housePrice > lowPrice)) {
    priceMatch = true;
    catch ( NullPointerException e ) {
    //The price field was blank
    priceMatch = false;
    catch ( NumberFormatException e ) {
    //the price field was blank
    priceMatch = false;
    if ( (house.parking != null) && (customer.parking != null) ){
    parkingMatch = true;
    }else{
    parkingMatch = false; }
    try {
    if (customer.type.equals(house.type)) {
    typeMatch = true;
    catch ( NullPointerException e ) {
    typeMatch = false;
    catch ( NumberFormatException e ) {
    typeMatch = false;
    try {
    if (customer.bedrooms.equals(house.bedrooms)) {
    bedroomsMatch = true;
    catch ( NullPointerException e ) {
    bedroomsMatch = false;
    catch ( NumberFormatException e ) {
    bedroomsMatch = false;
    //if ((priceMatch == true) && (typeMatch == true)) {
    // overallMatch = true;
    // }else{
    // overallMatch = false; }
    if (priceMatch == true) {
    matchCounter++; }
    if (typeMatch == true) {
    matchCounter++; }
    if (bedroomsMatch == true) {
    matchCounter++; }
    if (parkingMatch == true) {
    matchCounter++; }
    if (matchCounter == 4) {
    overallMatch = true;
    }else{
    overallMatch = false; }
    //continue
    if (overallMatch == true) {
    matches.addElement(house);
    overallMatch = false;
    typeMatch = false;
    priceMatch = false;
    bedroomsMatch = false;
    parkingMatch = false;
    matchCounter = 0;
    //i ++;
    //house = (Property) allHouses.elementAt(i);
    return matches;
    }

  • Query regarding Application Classes.

    While going through the Application classes, I've come accross a code where a Property is defined without a name as follows.
    class BusinessUnitOptions
    property boolean get;
    end-class;
    Can anybody tell me how it works and what is the concept behind it?
    Thanks & Regards,
    Saurabh

    Actually Saurabh, PeopleCode is usually quite strict about the use of keywords. For example, error is a keyword. As such, error cannot be a method of a class. On the other hand, just for a test, I created a class with the methods get(), class(), private(), boolean(), Record(), and CreateRecord() and was able to call those methods from a test program. I tried creating methods named if and error, but those keywords won't compile. Just for fun, I tried creating functions named boolean, class, and private. The functions compile, but I can only call boolean. Even though the class and private functions compile, the code that calls them wont.
    Even though it works, I strongly discourage the practice of using reserved words for method and function names. I'm sure you already know this, but I just want to make it clear to all who read this thread.

  • Populating values in Boolean Property

    Hi ,
    I am working on version 11.1.2 . I have created a Boolean property - 'Country Flag' . Made that property as Defined , Boolean and Local Node.
    I am trying to import a file with this property value as 'TRUE' . But in the imported hierarchy , this boolean property does not show up any value(True / False).
    The below is the file i am trying to import-
    [hier]
    Product|P000000
    [relation]
    P000000|NA|Total Product|True
    P100000|P000000|Cars|True
    P110000|P100000|Hatchback|False
    P121000|P110000|Yaris|True
    P121100|P121000|Yaris - 3 Door Liftback|False
    The last value does not get populated in the hierarchy in DRM.
    Please help in this
    Thanks.
    Edited by: user10979332 on Jun 22, 2011 10:18 PM

    Hi ,
    I visited the link - http://otndnld.oracle.co.jp/document/products/epm/111200/E-17236/epm.1112/drm_1112000_readme.pdf
    Its mentioned there that this is known issue
    Defect no - 9450750
    Imported hierarchy-level properties of type Boolean do not get set.
    But in my case I created a local node property and not a hierarchy level property so does this defect applies to local node properties as well?
    Thanks for the clarification in advance!!
    Edited by: user10979332 on Jun 26, 2011 9:13 PM

  • Use of boolean property node in LabView 6i

    I am running LabView 6i version 6.0.2.
    I am using a reference to a front panel boolean control to stop the execution of a state machine in a subVI.  The subVI has a property node linked to this reference.  This property node shows that it is "Bool", but when I set the property node's element to "value", the value is not a boolean type.  I can't figure out how to set the boolean property node's element so that I can read the state of the boolean control.  How should I configure this?  

    The data type of the value property is a variant.  It is possible to convert a variant to a boolean, but you probably don't want to do that.
    The reason is that you have the mechanical action of the boolean set to "latch ...", and that means that the value property isn't very useful.
    Change the mechanical action to "switch ...", then the value property will be a boolean.
    Note that this means that you will probably have to reset the boolean programatically after the user clicks on it.

  • CF9 Service not starting - error parsing boolean property notifyclientonalert

    Hi, I clean installed CF9 (after uninstalling CF8) on win2003 32bit and all was workign fine, however after a server restart the CF9 Application service refuses to start automatically or manually. I am getting an error in windows event logs saying see Coldfsuion logs, but there is nothing in these logs, not very helppful!  any ideas apart from a reinstall?
    After reinstalling I get the same problme, but this tuime in coldfusion server log I get the following error message
    "Error","jrpp-2","11/17/11","16:21:59",,"Monitor service: Error parsing boolean property notifyclientonalert, using default false"
    thanks
    Oli

    Hi Oli,
    Suggest try start CF from CMD prompt. Run cmd as an admin, CD ColdFusion9\bin\ , type CFSTART press enter. Some detail of what happens?
    HTH, Carl.

  • Add boolean property to user details

    I have created a km property with type "Boolean" and render "boolean" but UME card displays that property as text field.
    Portal: EP7.0SP16
    Does anybody know is it possible to render custom attribute(booleans) as checkbox?

    Hi
    You can add custom attributes for users in UME configuration.Separate each property with ;.
    These custom property only supports string ,so you need to convert them explicitly in your code.
    Regards

  • Boolean property export issue in DRM

    Hi All,
    We have a boolean property in DRM. In DRM 1.1.2, when we export this property to Database, it populates value as -1 for True and 0 for false.
    But in DRM 1.2.2, the values appear as TRUE/FALSE in the column in the database. Is this an expected change in the DRM behaviour?
    This is causing problems in our integration logic.
    Any help on this would be appreciated.
    Thanks & Regards,
    Prasad

    Hi Shashank,
    With the latest patch .306 and a series of prior ones , its more like the Character encoding sets have started working in DRM and they will slip in special characters here and there, I have faced this with the latest releases of DRM.
    It would be advisable to use US ASCII encoding or Western European Windows.. that should solve your issue.
    If you have to make changes on all the exports and if they are too many in number then search xml tag
    <drm:CodePage>20127</drm:CodePage>
    and make sure the code page is 20127 which represents US ASCII.

  • Use property nodes to change the state of a boolean through time

    I want to be able to switch the value from a boolean control, using property nodes, so that if the time elapsed is equal to 0,1 ,2 ,3 s, it should be false and if the time is equal o.5,1.5,2.5 s, the value should be true.
    Can some one tell me how to do this with propert nodes or with any other method?
    Thanks in advance!

    -Check this link for ideas on how to make loop run for specific period of time.
    http://forums.ni.com/t5/LabVIEW/how-to-make-a-loop-run-for-specific-period-of-time/td-p/1641018
    -To change value using property node>>right click boolean>>create>>Property node>>value>> Change it to write.
    -Forget about specific period of time, first learn to change the value of boolean programmatically.
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13

Maybe you are looking for

  • Can i transfer eBooks from laptop to iPad

    I was wondering if I buy an eBook on my laptop, can I then transfer that file onto my iPad?

  • BDC by screen input not by file

    Dear frinds, I want to create a bdc (for changing bin in material) screen by using this user will enter material and storage location  etc... and  can change bin  directly by  input record on screen without using xls or txt file . Please provide samp

  • Funky window in iTunes 9 with missing sides

    I am missing parts of my window in iTunes 9. I am missing the bottom of the window as well as the right hand side. The minimize, maximize and exit buttons are missing. I have to use File, Exit to close the application. Also when i try to scroll throu

  • HT6154 need tech support for my iPhone 4 s

    Need technical support for my iPhone 4s, just have a couple questions if you don't mind helping me.

  • Any update on Windows PV Drivers for 3.0.2?

    I have an outstanding SR on this (SR 3-4973876887) - opened two weeks ago. We seem to be experiencing intermittent performance issues with the 2.2.2 PV drivers. We'll be getting 30MB/s, restart the guest, and get 100MB/s. Guest VMs running Windows 20