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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

Set Date Attribute to (Assigned Date + 5 Days) Using Workflow Transition Code in Windchill

JM_11022027
3-Newcomer

Set Date Attribute to (Assigned Date + 5 Days) Using Workflow Transition Code in Windchill

I need to get the Assigned Date from My Task once the activity is started. Using the self variable, I can retrieve the WFAssignment object that contains all task details. From this, I want to take the Assigned Date, add 5 days to it, and then set that new date to a date attribute using IBA.

Can anyone help me with example code that should be written in the Transition tab of the workflow for this?

4 REPLIES 4

Very doable.

I’ve done similar for a company that wanted to reset due dates on tasks.

And for companies that wanted to send an alert 5 days before something was due.

 

Custom code for sure but it is doable.

Can you please share the example code it will be helpful to implement it in the workflow 

Here is something I did that validated need by date on change request in workflow:

java.util.Calendar c=java.util.Calendar.getInstance();
c.add(java.util.Calendar.DATE,21);
java.util.Date n=((wt.change2.WTChangeRequest2)primaryBusinessObject).getNeedDate();
if(n == null)
{
result="null";
}
else if (c.getTimeInMillis() < (n.getTime()))
{ 
  result="ok";
}
else
{
  result="notOK";
}

Can we get the date attribute from a part and set the IBA value from the workflow transition tab without writing any logic in Java files? I need to write everything inside the transition tab of the Start activity.

Announcements
Top Tags