Results 1 to 5 of 5
  1. #1
    mawright is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default Error: Cannot Find Symbol

    I am having an issue with some Java. I am completely new to Java, and unfortunately we don't have anyone in our local IT department that can help me with this coding. What we are using is PTC's Windchill 9.1 and I am trying to set up a workflow within that to pull information from a documents attributes when it is created. I have been using a coding from a previous Workflow that is accomplishing the same thing but from a different location. The code that I have right now is:

    wt.fc.QueryResult qr = null;
    wt.doc.WTDocument cn = (wt.doc.WTDocument)qr.nextElement();
    qr = null;
    wt.doc.WTDocument cr = (wt.doc.WTDocument)qr.nextElement();
    ext.generic.util.IBAUtil objHelper = new ext.generic.util.IBAUtil(cr);
    ProjectEngineer=objHelper.getIBAValue("ProjectEngi neer");
    Samples=objHelper.getIBAValue("Samples");
    TestReportFormat=objHelper.getIBAValue("TestReport Format");

    The Error that I am getting is:

    Checking Syntax...
    E:\ptc\Windchill_9.1\Windchill\temp\WfExpression10 6119107.java:34: cannot find symbol
    symbol : variable ProjectEngineer
    location: class wt.workflow.expr.WfExpression106119107
    ProjectEngineer=objHelper.getIBAValue("ProjectEngi neer");
    ^
    E:\ptc\Windchill_9.1\Windchill\temp\WfExpression10 6119107.java:35: cannot find symbol
    symbol : variable Samples
    location: class wt.workflow.expr.WfExpression106119107
    Samples=objHelper.getIBAValue("Samples");
    ^
    E:\ptc\Windchill_9.1\Windchill\temp\WfExpression10 6119107.java:36: cannot find symbol
    symbol : variable TestReportFormat
    location: class wt.workflow.expr.WfExpression106119107
    TestReportFormat=objHelper.getIBAValue("TestReport Format");
    ^
    3 errors
    Syntax check complete.

    I'm sure that this is something simple, but me not knowing exactly what I'm looking at kind of makes this tough. Any help or information you guys can provide, I would greatly appreciate.

    Thanks.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,017
    Rep Power
    10

    Default

    The error is saying that you're trying to use a variable that you have no initialized.
    You can't do this:

    Java Code:
    x = 7;
    But you can do this:
    Java Code:
    int x;
    x = 7;
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    mawright is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    Okay, that makes sense, I'll give it a shot and see if everything works then. Thanks.

  4. #4
    mawright is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    Okay, so I threw in code right above it that said

    int ProjectEngineer;

    and now I get this error. I did this for all 3 variables I'm trying to pull so it's the same error for all 3

    E:\ptc\Windchill_9.1\Windchill\temp\WfExpression10 6119107.java:37: incompatible types
    found : java.lang.String
    required: int
    ProjectEngineer=objHelper.getIBAValue("ProjectEngi neer");

  5. #5
    mawright is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    Alright, I think I figured out what the issue is. It was the fact that I need to define the variable, but since we are using Windchill, there is a different way to define the variable than by doing it in the window, so I think I may have that portion figured out now, but thank you for showing me that that was what needed to happen.

Similar Threads

  1. Cannot find symbol Error
    By new_Java in forum New To Java
    Replies: 3
    Last Post: 02-18-2011, 12:23 AM
  2. Cannot find symbol error
    By rajivjoshi in forum New To Java
    Replies: 3
    Last Post: 05-31-2010, 11:13 AM
  3. error cannot find symbol
    By jcoon3 in forum New To Java
    Replies: 3
    Last Post: 09-27-2009, 11:56 PM
  4. Replies: 9
    Last Post: 10-18-2008, 09:26 PM
  5. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •