Import wojob def

From Agility
Revision as of 13:51, 4 July 2017 by Sosenka (Talk | contribs) (Created page with "<?xml version="1.0" encoding="utf-8"?> <import> <mappings classname="Control.GeneralInterface.XMLFileImport"> <table name="JobList" xpath="/JobList/woJob"> <field n...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<?xml version="1.0" encoding="utf-8"?> <import>

 	<mappings classname="Control.GeneralInterface.XMLFileImport">	
<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>
<field name="TaskCode" xpath="TaskCode"></field> <field name="TaskDescription" xpath="Description"></field> <field name="TaskType" xpath="TaskType"></field> <field name="TaskStatus" xpath="TaskStatus"></field>

</mappings>

<assign classname="Control.GeneralInterface.StandardImportProcessor"> <businessobject classname="DataBO.ProcessMngt.JobBO">

<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>

</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>