t_user.html
This code sample describes how to design the Web page that is displayed when the creator of a workflow map edits a custom display step in the Workflow Designer. You edit a custom display step on the Custom Display Step Definition page, which is accessed by double-clicking the task's icon or by right-clicking the task's icon, and then clicking Edit.
;;webscript t_user( Assoc data ) <!-- File: custmod/t_user.html --> ;;oscript{ Integer i List durationInfo String checked String dueDuration Dynamic taskInfo = data.TaskInfo //Set up the URLs that define the links on the Step Definition //page (for example, the Map Editor link which jumps back to //the Workflow Designer). String nextURL = Str.Format( \ "%1?func=wfp.TaskEdit&MapID=%2&TaskID=%3&NextURL=%4", \ .URL(), \ data.MapID, \ data.TaskID, \ Web.Escape( data.NextURL ) ) String chooseUserURL = .url() + Str.Format( \ "?func=wfp.TaskUserSet&MapID=%1&TaskID=%2&PerformerID=%3" + \ "&nextURL=%4", \ data.MapID, \ data.TaskID, \ taskInfo.PerformerID, \ Web.Escape( nextURL ) ); //Set up the contents of the Group Options list. List flags = { $WFMain.WFConst.kWFGroupStandard, \ $WFMain.WFConst.kWFGroupExpand, \ $WFMain.WFConst.kWFGroupExpandFull } List flagLabels = { [WebWFP_HTMLLabel.MemberAccept], \ [WebWFP_HTMLLabel.OneLevelExpand], \ [WebWFP_HTMLLabel.FullExpand] } ;;} //Set up the information that is displayed on the General tab of //the Custom Display Step Definition page. This includes the //title, the performer, the group options, the step instructions, //the name of the callback script to run, the workflow event that //triggers the callback script, the template to use, the //duration, and the start date. <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="1"> //Set up the Step Name field. <TR> <TD bgcolor="#CCCCCC" NOWRAP><FONT FACE="'[WebDsp_Font.SansSerif]'" size="2"> '[WebWFP_HTMLLabel.StepName_]' </FONT></TD> <TD> <IMG SRC="`.ModImg( 'custmod' )``data.Gif`" WIDTH="16" HEIGHT="16" ALIGN="BOTTOM" BORDER="0" VALIGN="TOP" HALIGN="RIGHT"> <INPUT TYPE="TEXT" NAME="Title" SIZE="33" VALUE="`taskInfo.Title`" MAXLENGTH="255" ONCHANGE="markTaskEditDirty();"> <INPUT TYPE="HIDDEN" NAME="PerformerID" VALUE="`taskInfo.PerformerID`"> </TD> </TR> //Set up the Assigned To field. <TR> <TD bgcolor="#CCCCCC" NOWRAP><FONT FACE="`[WebDsp_Font.SansSerif]`" size="2"> `[WebWFP_HTMLLabel.AssignedTo_]` </FONT></TD> <TD> <A HREF="`chooseUserURL`" ONCLICK="if ( leaveTaskEdit() )taskEditGo( '`%LchooseUserURL`' ); else return false;"> <B>`[WebWFP_HTMLLabel.UserOrGroupColon]`</B> </A> <IMG SRC="`.Img()``data.PerformerInfo.Gif`" WIDTH="16" HEIGHT="16" ALIGN="BOTTOM" BORDER="0" VALIGN="TOP" HALIGN="RIGHT"> ;if ( data.PerformerInfo.KnownUser ) ;;call <.HTMLPrefix() + 'douserdialog.html'>( data.PerformerInfo.ID, data.PerformerInfo.Name ) ;else `%Ldata.PerformerInfo.Name` ;end </TD> </TR> //Set up the Group Options field. <TR> <TD bgcolor="#CCCCCC" NOWRAP>< FONT FACE="`[WebDsp_Font.SansSerif]`" size="2"> `[WebWFP_HTMLLabel.GroupOptions_]` </FONT></TD> <TD> <SELECT NAME="GroupFlags" ONCHANGE="markTaskEditDirty();"> ;for i = 1 to Length( flags ) ;if ( taskInfo.EXATTS.GroupFlags == flags[ i ] ) <OPTION VALUE="`flags[ i ]`" SELECTED>`flagLabels[ i ]` ;else <OPTION VALUE="`flags[ i ]`">`flagLabels[ i ]` ;end ;end </SELECT> </TD> </TR> //Set up the Instructions field. <TR> <TD bgcolor="#CCCCCC" NOWRAP valign="TOP"><FONT FACE="`[WebDsp_Font.SansSerif]`" size="2"> `[WebWFP_HTMLLabel.Instructions_]` </FONT></TD> <TD> <TEXTAREA NAME="Instructions" ROWS="6" COLS="45" WRAP="SOFT" ONCHANGE="markTaskEditDirty();">`taskInfo.Instructions`</TEXTAREA> </TD> </TR> //Set up the Script to run field. <TR> <TD bgcolor="#CCCCCC" NOWRAP valign="TOP">< FONT face="Arial, Helvetica, sans-serif" size="2"> Script to run: </FONT></TD> <TD> <SELECT NAME="CustTaskScript" ONCHANGE="markTaskEditDirty();"> ;String scriptName ;List scriptsList = $Custmod.UtilityPkg.ListScripts() <OPTION><None> ;for scriptName in scriptsList <OPTION `( taskInfo.ExAtts.CustTaskScript == scriptName ) ? 'selected':''`>`scriptName` ;end </SELECT> <BR> //Set up the Step Becomes Ready and Step Is Done radio //buttons. <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="1"> <TR> <TD>Script runs when:</TD> <TD> ;checked = ( taskInfo.ExAtts.RunScript == 'ReadyCB' ) ? "CHECKED" : "" <INPUT TYPE="RADIO" NAME="RunScript" `checked` VALUE="ReadyCB ONCLICK="markTaskEditDirty();">Step Becomes Ready <BR> ;checked = ( taskInfo.ExAtts.RunScript == 'DoneCB' ) ? "CHECKED" : "" <INPUT TYPE="RADIO" NAME="RunScript" `checked` VALUE="DoneCB" ONCLICK="markTaskEditDirty();">Step Is Done </TD> </TR> </TABLE> </TD> </TR> //Set up the Template to use field. <TR> <TD bgcolor="#CCCCCC" NOWRAP valign="TOP"><FONT face="Arial, Helvetica, sans-serif" size="2"> Template to use: </FONT></TD> <TD> <SELECT NAME="CustTaskTemplate" ONCHANGE="markTaskEditDirty();"> ;String templateName ;List templatesList = $Custmod.UtilityPkg.ListTemplates() <OPTION><None> ;for templateName in templatesList <OPTION `( taskInfo.customData.CustTaskTemplate == templateName ) ? 'selected':''`>`templateName` ;end </SELECT> </TD> </TR> //Set up the Duration field. ;;oscript{ if IsDefined( taskInfo.DueDuration ) durationInfo = $LLIAPI.FormatPkg.ConvertFromSeconds( \ taskInfo.DueDuration ) dueDuration = $LLIAPI.FormatPkg.ValToString( \ durationInfo[2] ) else durationInfo = { TRUE, 0 } end ;;} <TR> <TD bgcolor="#CCCCCC" NOWRAP><FONT FACE="`[WebDsp_Font.SansSerif]`" size="2"> `[WebWFP_HTMLLabel.Duration_]` </FONT></TD> <TD> <INPUT TYPE="TEXT" NAME="Duration" VALUE="`dueDuration`" SIZE="5" ONCHANGE="markTaskEditDirty();"> ;checked = ( durationInfo[ 1 ] ) ? "" : "" <INPUT TYPE="RADIO" NAME="DurationUnits" `checked` VALUE="Days" ONCLICK="markTaskEditDirty();">`[WebWFP_HTMLLabel.Days]` ;checked = ( !durationInfo[ 1 ] ) ? "CHECKED" : "" <INPUT TYPE="RADIO" NAME="DurationUnits" `checked` VALUE="Hours" ONCLICK="markTaskEditDirty();">`[WebWFP_HTMLLabel.Hours]` </TD> </TR> //Set up the Start Date field. <TR> <TD bgcolor="#CCCCCC" NOWRAP><FONT FACE="`[WebDsp_Font.SansSerif]`" size="2"> `[WebWFP_HTMLLabel.StartDate_]` </FONT></TD> <TD NOWRAP> ;;call <.htmlPrefix() + 'datefield.html'>( 'StartDate', taskInfo.StartDate, TRUE, TRUE ) </TD> </TR> //Set up the Action field, which contains the Add to Workflow //Definition button. <TR> <TD bgcolor="#CCCCCC" NOWRAP><FONT FACE="`[WebDsp_Font.SansSerif]`" size="2"> `[WebDoc_HTMLLabel.Action_]` </FONT></TD> <TD> <INPUT TYPE="Submit" VALUE="`[WebWFP_HTMLLabel.AddToWorkflowDefinitionButtonLabel]`"> </TD> </TR> </TABLE> ;;end