Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creativecontentlabtokyo/94a1e3c851fd2cf6fb0e6aa6656f6890 to your computer and use it in GitHub Desktop.
Save creativecontentlabtokyo/94a1e3c851fd2cf6fb0e6aa6656f6890 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<actionCalls>
<name>DebugMemo</name>
<label>営業日判定結果</label>
<locationX>358</locationX>
<locationY>1164</locationY>
<actionName>NewNote</actionName>
<actionType>quickAction</actionType>
<inputParameters>
<name>Title</name>
<value>
<stringValue>営業日判定</stringValue>
</value>
</inputParameters>
<inputParameters>
<name>Body</name>
<value>
<stringValue>日付:{!$Flow.CurrentDate} 曜日判定:{!DayOfTheWeekDecimal} 営業日判定:{!BusinessDayFlag}</stringValue>
</value>
</inputParameters>
</actionCalls>
<apiVersion>50.0</apiVersion>
<assignments>
<name>SetBusinessDayFlagFalse</name>
<label>営業日フラグにFalseをセット</label>
<locationX>50</locationX>
<locationY>396</locationY>
<assignmentItems>
<assignToReference>BusinessDayFlag</assignToReference>
<operator>Assign</operator>
<value>
<booleanValue>false</booleanValue>
</value>
</assignmentItems>
<connector>
<targetReference>DebugMemo</targetReference>
</connector>
</assignments>
<assignments>
<name>SetBusinessDayFlagFalse_0</name>
<label>営業日フラグにFalseをセット</label>
<locationX>754</locationX>
<locationY>756</locationY>
<assignmentItems>
<assignToReference>BusinessDayFlag</assignToReference>
<operator>Assign</operator>
<value>
<booleanValue>false</booleanValue>
</value>
</assignmentItems>
<connector>
<targetReference>LoopHolidayRecords</targetReference>
</connector>
</assignments>
<decisions>
<description>祝日判定処理</description>
<name>ConditionJudgementHolidays</name>
<label>祝日判定処理</label>
<locationX>886</locationX>
<locationY>636</locationY>
<defaultConnector>
<targetReference>LoopHolidayRecords</targetReference>
</defaultConnector>
<defaultConnectorLabel>営業日</defaultConnectorLabel>
<rules>
<name>IsHoliday</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Flow.CurrentDate</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<elementReference>LoopHolidayRecords.ActivityDate</elementReference>
</rightValue>
</conditions>
<connector>
<targetReference>SetBusinessDayFlagFalse_0</targetReference>
</connector>
<label>祝日</label>
</rules>
</decisions>
<decisions>
<description>週末(土日)判定処理
0:日曜日、6:土曜日</description>
<name>ConditionJudgementIsWeekend</name>
<label>週末(土日)判定処理</label>
<locationX>358</locationX>
<locationY>276</locationY>
<defaultConnector>
<targetReference>GetOrgHolidayRecords</targetReference>
</defaultConnector>
<defaultConnectorLabel>平日</defaultConnectorLabel>
<rules>
<name>IsWeekend</name>
<conditionLogic>or</conditionLogic>
<conditions>
<leftValueReference>DayOfTheWeekDecimal</leftValueReference>
<operator>NotEqualTo</operator>
<rightValue>
<numberValue>0.0</numberValue>
</rightValue>
</conditions>
<conditions>
<leftValueReference>DayOfTheWeekDecimal</leftValueReference>
<operator>NotEqualTo</operator>
<rightValue>
<numberValue>6.0</numberValue>
</rightValue>
</conditions>
<connector>
<targetReference>SetBusinessDayFlagFalse</targetReference>
</connector>
<label>週末(土日)</label>
</rules>
</decisions>
<formulas>
<description>曜日判定のための変数</description>
<name>DayOfTheWeekDecimal</name>
<dataType>Number</dataType>
<expression>MOD( {!$Flow.CurrentDate} - DATE(1900, 1, 7), 7)</expression>
<scale>0</scale>
</formulas>
<interviewLabel>営業日判定フロー {!$Flow.CurrentDateTime}</interviewLabel>
<label>営業日判定フロー</label>
<loops>
<name>LoopHolidayRecords</name>
<label>祝日分繰り返し処理 (LoopHolidayRecords)</label>
<locationX>666</locationX>
<locationY>516</locationY>
<collectionReference>GetOrgHolidayRecords</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>ConditionJudgementHolidays</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>DebugMemo</targetReference>
</noMoreValuesConnector>
</loops>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordLookups>
<name>GetOrgHolidayRecords</name>
<label>組織の休日レコード取得</label>
<locationX>666</locationX>
<locationY>396</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>LoopHolidayRecords</targetReference>
</connector>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Holiday</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<start>
<locationX>232</locationX>
<locationY>0</locationY>
<connector>
<targetReference>ConditionJudgementIsWeekend</targetReference>
</connector>
<schedule>
<frequency>Once</frequency>
<startDate>2021-02-14</startDate>
<startTime>00:00:00.000Z</startTime>
</schedule>
<triggerType>Scheduled</triggerType>
</start>
<status>Active</status>
<variables>
<description>平日判定フラグ</description>
<name>BusinessDayFlag</name>
<dataType>Boolean</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>true</isOutput>
<value>
<booleanValue>true</booleanValue>
</value>
</variables>
</Flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment