cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Workflow Comparing Dates for Conditional

MichaelWright
1-Visitor

Workflow Comparing Dates for Conditional

I have a question regarding comparing dates in Windchill 9.1 Workflows. I've got a date that I've passed in from a soft-type and now I would like to compare it "today's" date to determine if it goes down a path or not. The main reason is we are setting up a deadline for a certain task in the workflow to be completed by this date that is being passed in. I have not received formal training on this and don't know if I'm doing it the wrong way or if there is an easier way to do this. Right now I've got an Or connector set up with the task that is due in line and then with an offset notification loop. Here is what I've scrounged up by searching the web for comparing dates.


//Checks TR attribute -Is Testing Complete by Estimated Date?
if(today.compareTo(EstCompleteDate)<0)
{
result="Yes";
}
else
{
result="No";
}

Here are the errors I'm receiving

Checking Syntax...
E:\ptc\Windchill_9.1\Windchill\temp\WfExpression106160370.java:16: java.util.Date is already defined in a single-type import
import java.sql.Date;
^
E:\ptc\Windchill_9.1\Windchill\temp\WfExpression106160370.java:18: java.util.Date is already defined in a single-type import
import java.sql.Date;
^
E:\ptc\Windchill_9.1\Windchill\temp\WfExpression106160370.java:19: java.util.Date is already defined in a single-type import
import java.sql.Date;
^
E:\ptc\Windchill_9.1\Windchill\temp\WfExpression106160370.java:54: cannot find symbol
symbol : variable today
location: class wt.workflow.expr.WfExpression106160370
if(today.compareTo(EstCompleteDate)<0)
^
4 errors
Syntax check complete.

Is there an easier way to have the date set as the deadline for the overall process so that it will send out notifications throughout the process if it is held up, or am I doing it the recommended way? Any help that can be provided will be greatly appreciated.

Thanks

1 REPLY 1

Seems like the variable "today" is not defined.

Announcements


Top Tags