Difference between revisions of "Import wojob def"
From Agility
(Created page with "<?xml version="1.0" encoding="utf-8"?> <import> <mappings classname="Control.GeneralInterface.XMLFileImport"> <table name="JobList" xpath="/JobList/woJob"> <field n...") |
|||
| Line 1: | Line 1: | ||
| + | <source> | ||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
<import> | <import> | ||
| Line 49: | Line 50: | ||
<JobList> | <JobList> | ||
" | " | ||
| + | </source> | ||
]]> | ]]> | ||
</const> | </const> | ||
Latest revision as of 13:52, 4 July 2017
<?xml version="1.0" encoding="utf-8"?>
<import>
<mappings classname="Control.GeneralInterface.XMLFileImport">
<table name="JobList" xpath="/JobList/woJob">
<field name="JobCode" xpath="JobCode"></field>
<field name="Description" xpath="Description"></field>
<field name="JobStatus" xpath="JobStatus"></field>
<field name="JobType" xpath="JobType"></field>
<field name="JobPriority" xpath="JobPriority"></field>
<field name="AssetCode" xpath="AssetCode"></field>
<field name="Craft" xpath="Craft"></field>
<field name="StartDate" xpath="StartDate"></field>
<table name="JobTask" xpath="woJobTask">
<field name="TaskCode" xpath="TaskCode"></field>
<field name="TaskDescription" xpath="Description"></field>
<field name="TaskType" xpath="TaskType"></field>
<field name="TaskStatus" xpath="TaskStatus"></field>
</table>
</table>
</mappings>
<assign classname="Control.GeneralInterface.StandardImportProcessor">
<businessobject classname="DataBO.ProcessMngt.JobBO">
<table name="woJob" sourceTable="JobList">
<mode>
<add/>
</mode>
<set>
<field name="JobTypeID">Lookup("DataBO.SystemData.JobTypeBO","syJobType","Code",#Import.JobType,"JobTypeID")</field>
<field name="PriorityID">Lookup("DataBO.SystemData.PriorityBO","syPriority","Code",#Import.JobPriority,"PriorityID")</field>
<field name="JobStatusID">Lookup("DataBO.SystemData.JobStatusBO","syJobStatus","Code",#Import.JobStatus,"JobStatusID")</field>
<field name="AssetID">Lookup("DataBO.ProcessMngt.AssetBO","pmAsset","Code",#Import.AssetCode,"AssetID")</field>
<field name="CraftID">Lookup("DataBO.Employee.CraftBO","emCraft","CraftCode",#Import.Craft,"CraftID")</field>
<field name="FullDescription">#Import.Description</field>
</set>
</table>
</businessobject>
</assign>
<resultexport>
<contents>
<const>
<![CDATA[
"<?xml version='1.0' encoding='utf-8'?>
<JobList>
"]]> </const>
<foreach table="JobList" datacontext="mappings" classname="DataBO.ProcessMngt.JobBO"> <![CDATA[ "<woJob> <CreatedJobCode>" + XmlEncode(woJob.JobCode) + "</CreatedJobCode> <JobCode>" + XmlEncode(#Import.JobCode) + "</JobCode> </woJob> " ]]> </foreach>
<const> <![CDATA[ "</JobList> " ]]> </const>
</contents> </resultexport>
</import>