uniblab icon

Untitled

uniblab | PRO | 04/18/20 04:00:52 AM UTC | 0 ⭐ | 1635 👁️ | Never ⏰ | []
XML |

5.69 KB

|

None

|

0 👍

/

0 👎

<?xml version="1.0" encoding="utf-8"?>
<WorkOrder xmlns="http://Icod.Wod" xsi:schemaLocation="http://Icod.Wod \\my-server\Icod.Wod\schema0.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    jobName="Employee feed from WorkDay"
    emailTo="[email protected]"
>
    <variables>
        <variable name="employees" value="https://[email protected]/app/human_resources/api/jcb_employees"/>
        <variable name="host" value="\\my-server\FacStaffList"/>
    </variables>
 
    <steps>
        <fileOperation xsi:type="mkDir" path="%var:host%" name="SourceXml" />
        <fileOperation xsi:type="deleteFile" path="%var:host%\SourceXml" name="*_*.xml"
            regexPattern="((Dyson)|(Hotel)|(Jcb)|(Johnson)|(Sha))_((Staff)|(Faculty))\.xml$"
        />
        <parallel>
            <steps>
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=hotel_staff&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Hotel_Staff.xml"/>
                </fileOperation>
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=sha_staff&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Sha_Staff.xml"/>
                </fileOperation>
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=johnson_staff&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Johnson_Staff.xml"/>
                </fileOperation>
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=jcb_staff&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Jcb_Staff.xml"/>
                </fileOperation>
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=dyson_staff&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Dyson_Staff.xml"/>
                </fileOperation>
 
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=sha_faculty&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Sha_Faculty.xml"/>
                </fileOperation>
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=johnson_faculty&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Johnson_Faculty.xml"/>
                </fileOperation>
                <fileOperation xsi:type="jsonToXml" path="%var:employees%/mailing_list.json?type=dyson_faculty&amp;extended_data=true"
                    rootElementName="employeeList" elementName="employee"
                    username="someLogin" password="******"
                >
                    <destination path="%var:host%\SourceXml" name="Dyson_Faculty.xml"/>
                </fileOperation>
            </steps>
        </parallel>
 
 
        <fileOperation xsi:type="mkDir" path="%var:host%" name="DestXml" />
        <parallel>
            <steps>
                <fileOperation xsi:type="mkDir" path="%var:host%" name="DestXml\Employee" />
                <fileOperation xsi:type="mkDir" path="%var:host%" name="DestXml\Job" />
            </steps>
        </parallel>
        <parallel>
            <steps>
                <fileOperation xsi:type="deleteFile" path="%var:host%\DestXml\Employee" name="*_*.xml"
                    regexPattern="((Dyson)|(Hotel)|(Jcb)|(Johnson)|(Sha))_((Staff)|(Faculty))\.xml$"
                />
                <fileOperation xsi:type="deleteFile" path="%var:host%\DestXml\Job" name="*_*.xml"
                    regexPattern="((Dyson)|(Hotel)|(Jcb)|(Johnson)|(Sha))_((Staff)|(Faculty))\.xml$"
                />
            </steps>
        </parallel>
        <parallel>
            <steps>
                <fileOperation xsi:type="xmlTransformFile"
                    path="%var:host%\SourceXml" name="*.xml"
                >
                    <destination path="%var:host%\DestXml\Employee" />
                    <xsltFile path="%var:host%" name="Employee.xslt" />
                </fileOperation>
                <fileOperation xsi:type="xmlTransformFile"
                    path="%var:host%\SourceXml" name="*.xml"
                >
                    <destination path="%var:host%\DestXml\Job" />
                    <xsltFile path="%var:host%" name="Job.xslt" />
                </fileOperation>
            </steps>
        </parallel>
 
 
        <parallel>
            <steps>
                <dbCommand connectionStringName="SalesForce" commandType="Text" commandText="delete from WorkDay.EmployeeJobStaging" />
                <dbCommand connectionStringName="SalesForce" commandType="Text" commandText="delete from WorkDay.EmployeeStaging" />
            </steps>
        </parallel>
        <parallel>
            <steps>
                <dbFileImport connectionStringName="SalesForce" namespace="WorkDay" tableName="EmployeeStaging" updateBatchSize="500">
                    <columnMapping>
                        <map from="%wod:FileNameWithoutExtension%" to="FileNameWithoutExtension"/>
                    </columnMapping>
                    <source xsi:type="xmlFile" path="%var:host%\DestXml\Employee" name="*_*.xml"
                        regexPattern="((Dyson)|(Hotel)|(Jcb)|(Johnson)|(Sha))_((Staff)|(Faculty))\.xml$"
                    />
                </dbFileImport>
                <dbFileImport connectionStringName="SalesForce" namespace="WorkDay" tableName="EmployeeJobStaging" updateBatchSize="500">
                    <columnMapping>
                        <map from="%wod:FileNameWithoutExtension%" to="FileNameWithoutExtension"/>
                    </columnMapping>
                    <source xsi:type="xmlFile" path="%var:host%\DestXml\Job" name="*_*.xml"
                        regexPattern="((Dyson)|(Hotel)|(Jcb)|(Johnson)|(Sha))_((Staff)|(Faculty))\.xml$"
                    />
                </dbFileImport>
            </steps>
        </parallel>
 
    </steps>
 
</WorkOrder>

Comments