2022.2

Table Of Contents
Tip: HoveroverthenameofascriptintheScriptspanetohighlightpartsofthetemplatethatare
affectedbythescript.
l
TheMy name isscriptlooksforanelementthathastheID:hero.Insidethatelementitlooksfor
thetext:@name@andreplacesthatwitheitherthedefaultname("JohnDoe")orthenamegiven
intheURL.
l
TheYearscriptputsthecurrentyearinthefooter.
Formoreinformationaboutwritingscripts,see:"Writingyourownscripts"onpage808.
Tip: Youdon'thavetowriteascriptyourselfifyoujustwanttoinsertsomedatadirectlyintothe
template.Youcouldsimplydrag-and-dropthedataonthetemplateoruseawizard(see:"Vari-
abledatainthetext"onpage708).
The Workflow configuration
Theproject'sWorkflowconfiguration,Serving a Web Page.OL-workflow,containsjustoneprocess.
ItisasimpleOLConnectWebprocess(see"WebprocesseswithOLConnecttasks"onpage174).
TheNodeJSServerInputtask'sHTTP actionissettohello.Thismeansthatthisprocesswillbe
invokedwheneversomeonetriestoaccesstheWorkflowserverwiththisURL:http://{server's
address}/hello.
TheDeletetaskisanOutputtaskthatdoesnothing,actually;itdoesn'tevenremoveanything.
However,thisstepisusefulwhenrunningtheprojectstepbystepinDebugmode.Ifitwouldn'tbefol-
lowedbyanothertask,theCreateWebContenttaskwouldnotreturnitsoutputtotheWorkflowpro-
cess,whereitcanbeviewed(clickView as HTML).
The data mapping configuration
WhenthebrowsersendstherequesttoWorkflow,theWorkflowprocessstartsandputstherequest
intoXML,includingthevaluesthatweregivenintheURL.Toextractthosevaluesfromthe'jobfile'(the
XML)theprocessusesadatamappingconfiguration,madewiththeDataMapper:WEB_HELLO Data.
Toopenthedatamappingconfiguration,selectFile > OpenfromthemenuandbrowsetotheCon-
figurations\Resourcesfolder.
Tocreatethedatamappingconfiguration,theinputdataneededtobesavedtoafilefirst(see"Saving
inputassampledata"onthepreviouspage).
ThesampledatafileislocatedintheConfigurations\Datafolder,butyouwillalsoseeitwhenyou
openthedatamappingconfigurationitself:
Formoreinformationaboutdatamappingconfigurationssee"TheDataMapper"onpage198.
Page 166