Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
- xslt for option A to support Boomerang chaining.
- Validate Only mode
  • Loading branch information
swhitley committed May 14, 2022
1 parent 4408ce4 commit efd6cd7
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 34 deletions.
6 changes: 1 addition & 5 deletions Boomerang/.classpath
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_261">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.workday.cloud.jst.server.runtimeTarget.wdscl/Workday Runtime">
<attributes>
<attribute name="owner.project.facets" value="cc.ws.cloud.assembly"/>
Expand All @@ -16,5 +11,6 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
45 changes: 32 additions & 13 deletions Boomerang/ws/WSAR-INF/assembly-diagram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<element href="assembly.xml#WorkdayOutRest"/>
</visualProperties>
<visualProperties x="1513" y="553">
<element href="assembly.xml#GetXSLTDocument"/>
<element href="assembly.xml#ReportTransformation"/>
</visualProperties>
<visualProperties x="1012" y="319">
<element href="assembly.xml#Route"/>
Expand All @@ -91,9 +91,15 @@
<visualProperties x="840" y="1316">
<element href="assembly.xml#ErrorHandler_FileToMessage"/>
</visualProperties>
<visualProperties x="1612" y="728">
<element href="assembly.xml#GetXSLTDocumentIfExists"/>
</visualProperties>
<visualProperties x="510" y="478">
<element href="assembly.xml#ErrorHandler_GetXSLT"/>
</visualProperties>
<decorations x="10" y="-3" width="427" height="51" font="Arial|16|3" fontColor="1" type="TEXT" text="Boomerang"/>
<decorations x="18" y="1419" width="-1" height="-1" font="Segoe UI|18|1" type="TEXT" text=""/>
<decorations x="18" y="47" width="638" height="42" font="MS Sans Serif|10|1" fontColor="1" type="TEXT" text="v1.0.0"/>
<decorations x="18" y="47" width="638" height="42" font="MS Sans Serif|10|1" fontColor="1" type="TEXT" text="v1.2.0"/>
<connections type="routesTo" sourceAnchorX="1.0" sourceAnchorY="0.6756756756756757" targetAnchorX="0.03488372093023256" targetAnchorY="0.25">
<source href="assembly.xml#StartHere"/>
<target href="assembly.xml#Initialize"/>
Expand All @@ -114,10 +120,6 @@
<source href="assembly.xml#//@beans/@mixed.1/@mixed.3/@mixed.3"/>
<target href="assembly.xml#ErrorHandler"/>
</connections>
<connections type="routesTo" sourceAnchorX="1.0" sourceAnchorY="0.20833333333333334" targetAnchorX="0.09174311926605505" targetAnchorY="0.65625">
<source href="assembly.xml#GetEventDocument"/>
<target href="assembly.xml#StoreTheFile"/>
</connections>
<connections type="routesTo" sourceAnchorX="1.0" sourceAnchorY="0.11764705882352941" targetAnchorX="0.4369369369369369" targetAnchorY="0.4864864864864865">
<source href="assembly.xml#WebServiceRequest"/>
<target href="assembly.xml#ProcessSOAPWebService"/>
Expand All @@ -142,10 +144,6 @@
<source href="assembly.xml#Put_Totals"/>
<target href="assembly.xml#StoreCloudLog"/>
</connections>
<connections type="routesTo" sourceAnchorX="0.8853211009174312" sourceAnchorY="1.0" targetAnchorX="0.35403726708074534" targetAnchorY="0.07777777777777778">
<source href="assembly.xml#GetDocuments"/>
<target href="assembly.xml#DocumentSource"/>
</connections>
<connections type="routesTo" sourceAnchorX="0.918918918918919" sourceAnchorY="1.0" targetAnchorX="0.3005181347150259" targetAnchorY="0.6486486486486487">
<source href="assembly.xml#//@beans/@mixed.1/@route.0/@subRoute.0"/>
<target href="assembly.xml#GetEventDocuments"/>
Expand All @@ -164,10 +162,10 @@
</connections>
<connections type="routesResponseTo" sourceAnchorX="0.8823529411764706" sourceAnchorY="1.0" targetAnchorX="0.010615711252653927" targetAnchorY="0.16666666666666666">
<source href="assembly.xml#WorkdayOutRest"/>
<target href="assembly.xml#GetXSLTDocument"/>
<target href="assembly.xml#ReportTransformation"/>
</connections>
<connections type="routesTo" sourceAnchorX="1.0" sourceAnchorY="0.2604166666666667" targetAnchorX="0.026785714285714284" targetAnchorY="0.53125">
<source href="assembly.xml#GetXSLTDocument"/>
<source href="assembly.xml#ReportTransformation"/>
<target href="assembly.xml#StoreTheFile"/>
</connections>
<connections type="routesResponseTo" sourceAnchorX="0.7464788732394366" sourceAnchorY="1.0" targetAnchorX="0.272" targetAnchorY="0.40540540540540543">
Expand Down Expand Up @@ -220,6 +218,22 @@
<source href="assembly.xml#FileToMessage"/>
<target href="assembly.xml#ForEach"/>
</connections>
<connections type="routesTo" sourceAnchorX="0.7857142857142857" sourceAnchorY="1.0" targetAnchorX="0.08254716981132075" targetAnchorY="0.088">
<source href="assembly.xml#GetDocuments"/>
<target href="assembly.xml#GetXSLTDocumentIfExists"/>
</connections>
<connections type="routesTo" sourceAnchorX="1.0" sourceAnchorY="0.144" targetAnchorX="0.2727272727272727" targetAnchorY="0.05421686746987952">
<source href="assembly.xml#GetXSLTDocumentIfExists"/>
<target href="assembly.xml#DocumentSource"/>
</connections>
<connections type="routesTo" sourceAnchorX="1.0" sourceAnchorY="0.232" targetAnchorX="0.25925925925925924" targetAnchorY="0.136">
<source href="assembly.xml#GetEventDocument"/>
<target href="assembly.xml#StoreTheFile"/>
</connections>
<connections type="routesTo" sourceAnchorX="0.373134328358209" sourceAnchorY="1.0" targetAnchorX="0.6868131868131868" targetAnchorY="0.3783783783783784">
<source href="assembly.xml#//@beans/@mixed.1/@mixed.61/@mixed.3"/>
<target href="assembly.xml#ErrorHandler_GetXSLT"/>
</connections>
<swimlanes x="18" y="103" name="Main">
<elements href="assembly.xml#StartHere"/>
<elements href="assembly.xml#Initialize"/>
Expand All @@ -234,6 +248,7 @@
</swimlanes>
<swimlanes x="20" y="348" name="Get Documents">
<elements href="assembly.xml#GetDocuments"/>
<elements href="#//@swimlanes.13"/>
<elements href="assembly.xml#DocumentSource"/>
<elements href="#//@swimlanes.9"/>
<elements href="#//@swimlanes.8"/>
Expand Down Expand Up @@ -266,7 +281,7 @@
<swimlanes x="491" y="494" orientation="VERTICAL">
<elements href="assembly.xml#GetEventDocument"/>
<elements href="assembly.xml#GetInputDocument"/>
<elements href="assembly.xml#GetXSLTDocument"/>
<elements href="assembly.xml#ReportTransformation"/>
</swimlanes>
<swimlanes x="477" y="506" name="" orientation="VERTICAL">
<elements href="#//@swimlanes.11"/>
Expand All @@ -284,4 +299,8 @@
<elements href="assembly.xml#FileToMessage"/>
<elements href="assembly.xml#ErrorHandler_FileToMessage"/>
</swimlanes>
<swimlanes x="148" y="477" orientation="VERTICAL">
<elements href="assembly.xml#GetXSLTDocumentIfExists"/>
<elements href="assembly.xml#ErrorHandler_GetXSLT"/>
</swimlanes>
</wdnm:Diagram>
57 changes: 41 additions & 16 deletions Boomerang/ws/WSAR-INF/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@
xmlns:xdiff="urn:com.workday/esb/xdiff"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<cc:assembly id="WorkdayAssembly" version="2021.10">
<cc:assembly id="WorkdayAssembly" version="2022.10">
<cc:workday-in id="StartHere" routes-to="Initialize">
<cc:integration-system name="Boomerang">
<cloud:param name="a - Event Document Name Contains">
<cloud:type>
<cloud:simple-type>text</cloud:simple-type>
</cloud:type>
</cloud:param>
<cloud:param name="a - Custom Transformation">
<cloud:type>
<cloud:class-report-field description="Repository Document" type="WID" singular="false">1265f2f1996d4325b898f2eafc88b589</cloud:class-report-field>
</cloud:type>
</cloud:param>
<cloud:param name="b - Input Document">
<cloud:type>
<cloud:class-report-field description="Repository Document" type="WID" singular="false">1265f2f1996d4325b898f2eafc88b589</cloud:class-report-field>
Expand Down Expand Up @@ -47,9 +52,14 @@
<cloud:class-report-field description="Web Service API Version" type="WID" singular="true">c3709e92a44647e29a49074d917a4609</cloud:class-report-field>
</cloud:type>
<cloud:default>
<cloud:reference description="v36.0" type="WID">555040d77d971000318dea3c359301c7</cloud:reference>
<cloud:reference description="v38.1" type="WID">a1fec0c52911100020608187720d54d3</cloud:reference>
</cloud:default>
</cloud:param>
<cloud:param name="Validate Only">
<cloud:type>
<cloud:simple-type>boolean</cloud:simple-type>
</cloud:type>
</cloud:param>
</cc:integration-system>
</cc:workday-in>
<cc:async-mediation id="Initialize" routes-to="Call_GetDocuments" handle-downstream-errors="true">
Expand All @@ -68,14 +78,17 @@
<cc:expression>props['input.document.wid'] = (props['input.document.wids'] != empty ? props['input.document.wids'].get(0) : null)</cc:expression>
<cc:expression>props['input.document.entry'] = (props['input.document.wid'] != null ? lp.getID('b - Input Document', 'Document_ID', props['input.document.wid']) : null)</cc:expression>
<cc:expression>props['input.document.file.name'] = (props['input.document.wid'] != null ? lp.getDescriptor('b - Input Document', props['input.document.wid']) : null)</cc:expression>
<cc:expression>props['validate.only'] = lp.getSimpleData('Validate Only')</cc:expression>
<cc:expression>props['validate.only.text'] = (props['validate.only'] == 1 ? &quot;Yes&quot; : &quot;No&quot;)</cc:expression>

</cc:eval>
<cc:eval id="LParams2">
<cc:expression>props['custom.xslt.wids'] = lp.getWIDs('c - Custom Transformation')</cc:expression>
<cc:expression>vars['custom.transform.string'] = (lp.getWIDs('c - Custom Transformation') != empty ? 'c - Custom Transformation' : 'a - Custom Transformation')</cc:expression>
<cc:expression>props['custom.xslt.wids'] = (lp.getWIDs(vars['custom.transform.string'].text) != empty ? lp.getWIDs(vars['custom.transform.string'].text) : null)</cc:expression>
<cc:expression>props['custom.xslt.wid'] = (props['custom.xslt.wids'] != empty ? props['custom.xslt.wids'].get(0) : null)</cc:expression>
<cc:expression>props['custom.xslt.entry'] = (props['custom.xslt.wid'] != null ? lp.getID('c - Custom Transformation', 'Document_ID', props['custom.xslt.wid']) : null)</cc:expression>
<cc:expression>props['custom.xslt.file.name'] = (props['custom.xslt.wid'] != null ? lp.getDescriptor('c - Custom Transformation', props['custom.xslt.wid']) : null)</cc:expression>
<cc:expression>props['custom.xslt.reference'] = lp.getReferenceData('c - Custom Transformation', 'Document_ID')</cc:expression>
<cc:expression>props['custom.xslt.entry'] = (props['custom.xslt.wid'] != null ? lp.getID(vars['custom.transform.string'].text, 'Document_ID', props['custom.xslt.wid']) : null)</cc:expression>
<cc:expression>props['custom.xslt.file.name'] = (props['custom.xslt.wid'] != null ? lp.getDescriptor(vars['custom.transform.string'].text, props['custom.xslt.wid']) : null)</cc:expression>
<cc:expression>props['custom.xslt.reference'] = lp.getReferenceData(vars['custom.transform.string'].text, 'Document_ID')</cc:expression>
<cc:expression>props['report.name'] = (lp.getWIDs('c - Custom Report') != empty ? lp.getReferenceData('c - Custom Report', 'Custom_Report_ID').replace(' ', '_') : null)</cc:expression>
<cc:expression>props['report.input'] = (lp.getWIDs('c - Custom Report') != empty ? 'customreport2/' + context.getCustomerId() + '/' + parts[0].xpath('string(//wd:ID[@wd:type=&quot;Custom_Report_ID&quot;]/@wd:parent_id)') + '/' + props['report.name'] : null)</cc:expression>
<cc:expression>props['web.service.application'] = lp.getDescriptor('Web Service', lp.getWIDs('Web Service').get(0)).replace(' (Public)','').replace(' ','_')</cc:expression>
Expand Down Expand Up @@ -126,7 +139,7 @@ context.getProperty('Detail') = @{context.getProperty('Detail')}</cc:text>
</cc:local-out>
<cc:local-in id="LocalError" routes-to="Log-Error"/>
<cc:send-error id="Handle-Unexpected-Errors" routes-to="Surface-Critical-Error-to-Integration-Event"/>
<cc:local-in id="GetDocuments" routes-to="DocumentSource"/>
<cc:local-in id="GetDocuments" routes-to="GetXSLTDocumentIfExists"/>
<cc:local-out id="Call_GetDocuments" store-message="none" routes-response-to="Call_ProcessDocument" endpoint="vm://Boomerang/GetDocuments"/>
<cc:local-out id="ErrorHandler" store-message="both" routes-response-to="Put_Totals" endpoint="vm://Boomerang/LocalError">

Expand Down Expand Up @@ -156,11 +169,12 @@ context.getProperty('Detail') = @{context.getProperty('Detail')}</cc:text>
<cc:log-message>
<cc:line-separator/>
<cc:text>props['record.count'] = @{props['record.count']}&#xD;
vars['data.request'] = @{vars['data.request'].text}</cc:text>
vars['data.request'] = @{vars['data.request'].text}&#xD;
props['validate.only'] = @{props['validate.only']}</cc:text>
<cc:line-separator/>
</cc:log-message>
</cc:log>
<cc:cloud-log id="CloudLog" level="info" message="Web Service Request #@{props['record.count']}" message-details="@{vars['data.request'].text}"/>
<cc:cloud-log id="CloudLog" level="info" message="Web Service Request #@{props['record.count']} - Validate Only: @{props['validate.only.text']}" message-details="@{vars['data.request'].text} "/>
</cc:request-steps>
<cc:response-steps>
</cc:response-steps>
Expand All @@ -182,17 +196,18 @@ vars['data.request'] = @{vars['data.request'].text}</cc:text>
<cc:expression>props['file.name'] = (vars['wd.retrieve.variable'].fileName.contains(props['event.document.contains']) == true ? vars['wd.retrieve.variable'].fileName : null)</cc:expression>
</cc:eval>
<cc:copy execute-when="props['file.name'] != empty" id="Copy" input="variable" input-variable="wd.retrieve.variable"/>
<cc:xslt execute-when="props['custom.xslt.entry'] != null" id="XsltIfExists" output="message" input="message" url="mctx:vars/xslt.file"/>
</cc:steps>
<cc:send-error id="SendError" routes-to="ErrorHandler_GetDocuments"/>
</cc:async-mediation>
<cc:workday-out-soap id="ProcessSOAPWebService" application="@{props['web.service.application']}" version="@{props['web.service.version']}"/>
<cc:workday-out-soap id="ProcessSOAPWebService" execute-when="props['validate.only'] != true" application="@{props['web.service.application']}" version="@{props['web.service.version']}"/>
<cc:splitter id="ForEach">
<cc:sub-route name="WebServiceRequest" routes-to="WebServiceRequest"/>
<cc:xpath-splitter xpath="/*/*/*"/>
</cc:splitter>
<cc:local-in id="ProcessDocument" routes-to="FileToMessage"/>
<cc:local-out id="Call_ProcessDocument" store-message="none" routes-response-to="Put_Totals" endpoint="vm://Boomerang/ProcessDocument"/>
<cc:async-mediation id="ResultLog" execute-steps-when="props['error.flag'] == false">
<cc:async-mediation id="ResultLog" execute-steps-when="props['error.flag'] == false &amp;&amp; props['validate.only'] != true">
<cc:steps>
<cc:cloud-log id="CloudLog" level="info" message="Web Service Request Success - Request #@{props['record.count']}" message-details=" "/>
</cc:steps>
Expand Down Expand Up @@ -239,16 +254,15 @@ vars['data.request'] = @{vars['data.request'].text}</cc:text>
</cc:steps>
<cc:send-error id="SendError" routes-to="ErrorHandler_GetDocuments"/>
</cc:async-mediation>
<cc:workday-out-rest id="WorkdayOutRest" routes-response-to="GetXSLTDocument" extra-path="@{props['report.input']}"/>
<cc:async-mediation id="GetXSLTDocument" routes-to="StoreTheFile">
<cc:workday-out-rest id="WorkdayOutRest" routes-response-to="ReportTransformation" extra-path="@{props['report.input']}"/>
<cc:async-mediation id="ReportTransformation" routes-to="StoreTheFile">
<cc:steps>
<cc:eval id="SetDocumentParams">
<cc:expression>props['file.count'] = props['file.count'] + 1</cc:expression>
<cc:expression>props['file.name'] = props['report.name'] + &quot;.txt&quot;</cc:expression><cc:expression>props['index.of.separator'] = props['custom.xslt.entry'].indexOf(&quot;/&quot;)</cc:expression><cc:expression>props['custom.xslt.collection'] = props['custom.xslt.entry'].substring(0, props['index.of.separator'])</cc:expression><cc:expression>props['custom.xslt.entry'] = props['custom.xslt.entry'].substring( props['index.of.separator'] + 1)</cc:expression></cc:eval>
<cc:expression>props['file.name'] = props['report.name'] + &quot;.txt&quot;</cc:expression></cc:eval>
<cc:validate-exp id="ValidateFileName">
<cc:expression failure-message="The 'Custom Transformation' has not been specified.">props['file.name'] != empty</cc:expression>
<cc:expression failure-message="The 'Report File' has not been specified.">props['file.name'] != empty</cc:expression>
</cc:validate-exp>
<cc:retrieve id="RetrieveXSLTDocument" output="variable" output-variable="xslt.file" collection="@{props['custom.xslt.collection']}" entry="@{props['custom.xslt.entry']}"/>
<cc:xslt id="Xslt" output="message" input="message" url="mctx:vars/xslt.file"/>
</cc:steps>
<cc:send-error id="SendError" routes-to="ErrorHandler_GetDocuments"/>
Expand All @@ -270,6 +284,17 @@ vars['data.request'] = @{vars['data.request'].text}</cc:text>


<cc:set name="Summary" value="'Process Document Error - File #' + props['file.count']"/><cc:set name="Detail" value="context.errorMessage"/></cc:local-out>
<cc:async-mediation id="GetXSLTDocumentIfExists" routes-to="DocumentSource" execute-steps-when="props['custom.xslt.entry'] != null">
<cc:steps>
<cc:eval id="SetDocumentParams"><cc:expression>props['index.of.separator'] = props['custom.xslt.entry'].indexOf(&quot;/&quot;)</cc:expression><cc:expression>props['custom.xslt.collection'] = props['custom.xslt.entry'].substring(0, props['index.of.separator'])</cc:expression><cc:expression>props['custom.xslt.entry'] = props['custom.xslt.entry'].substring( props['index.of.separator'] + 1)</cc:expression></cc:eval>
<cc:retrieve id="RetrieveXSLTDocument" output="variable" output-variable="xslt.file" collection="@{props['custom.xslt.collection']}" entry="@{props['custom.xslt.entry']}"/>
</cc:steps>
<cc:send-error id="SendError" routes-to="ErrorHandler_GetXSLT"/>
</cc:async-mediation>
<cc:local-out id="ErrorHandler_GetXSLT" store-message="none" endpoint="vm://Boomerang/LocalError">
<cc:set name="Summary" value="'Get Documents Error - File #' + props['file.count']"/>
<cc:set name="Detail" value="context.errorMessage"/>
</cc:local-out>
</cc:assembly>

</beans>

0 comments on commit efd6cd7

Please sign in to comment.