Title: Process Variables
Description: variable not printing
forestearly - January 30, 2006 09:21 PM (GMT)
We have a .flo that is looking at different hire dates to perform a different emails.
The problem is that one of the variables is not printing on the email-
<!datediff> Days <!TargetEmployees_ADJ_HIRE_DATE> <!userlevel> <!TargetEmployees_EMPLOYEE>-<!TargetEmployees_FIRST_NAME> <!TargetEmployees_LAST_NAME> <!TargetEmployees_SUPERVISOR_FULL_NAME>
Everything prints except the <!datediff>
We have an Assign node that contains the following definition for datediff:
datediff=SinceToday(today,adjhiredatePF)
The adjhiredatePF is appearing in the logs:
adjhiredatePF = Mon Jul 04 2005 00:00:00 GMT-0500 (CDT)
I assume that pflow knows what today=today() means
but I can't find anything about SinceToday defined...
In plain english - datediff should be the difference between today's date and the adjhiredatePF .... or SinceToday=today-hiredate.
What needs to happen so that <!datediff> printes?
Thanks!
forestearly - January 30, 2006 09:38 PM (GMT)
I keep digging...and it looks like there is a Function:DateDiff in pflow.js
that calculates the difference in days between 2 dates -
/************************************************************
Function: DateDiff
Purpose: Calculates the difference in days between two
JavaScript dates (absolute value)
************************************************************/
function DateDiff(jsDate1,jsDate2)
{
var time1 = jsDate1.getTime();
var newDate1 = new Date(time1);
var time2 = jsDate2.getTime();
var newDate2 = new Date(time2);
//gdw - the DateDiff function ignores time
newDate1.setHours(0);
newDate1.setMinutes(0);
newDate1.setSeconds(0);
newDate1.setMilliseconds(0);
newDate2.setHours(0);
newDate2.setMinutes(0);
newDate2.setSeconds(0);
newDate2.setMilliseconds(0);
var x = newDate1.getTime();
var y = newDate2.getTime();
var temp = x - y;
//gdw - return the absolute value
if (temp < 0) temp = temp*(-1);
//gdw - there are 86400000 milliseconds in a day
days = temp/86400000;
//days = '' + days;
return days;
}
But I'm not sure how that relates to "SinceToday"
lawtech - January 31, 2006 03:05 PM (GMT)
Forest,
It appears that :
"SinceToday" appears to be a user defined function that is missing from the pflow.jsfile. The creator of this Flow probably added the function to the pflow.js
file that was on his/her's desktop PC so for their testing everything worked fine.
The fix: copy and overwrite the file of the server, edit the file on the server
to include this and any new functions.
Hope this helps.
mthedford - January 31, 2006 04:01 PM (GMT)
Make sure that you make copies of the file in both locations and document it well within the files - PC and Server. They will get replaced with CCS patches and the functions will need to be re-applied to the new files.
forestearly - February 1, 2006 08:32 PM (GMT)
Thanks, that is exactly what I needed!
I inhereted the .flo and wasn't aware of the modification to the .js file.
Does anyone have a good example of how multiple branches can be linked together to provide more conditions than the ten provided on the form?
mthedford - February 1, 2006 08:54 PM (GMT)
Give me some more specifics on what you are wanting to accomplish and I can give a better answer, but it can be done.
In short, depending on what you are testing for and if it can be broken down in ranges or if you need to test for other conditions based on what the result of the first test, then YES you can have nested Branch Nodes.