Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<flow name="syncFlow">
<poll doc:name="Poll">
<fixed-frequency-scheduler frequency="1" timeUnit="HOURS"/>
<logger message="Starting poll at #[dateTime()]" doc:name="Logger"/>
</poll>
<enricher target="#[flowVars['hasTimestamp']]">
<objectstore:contains config-ref="ObjectStore" key="timestamp"/>
</enricher>
<choice doc:name="Choice">
<when expression="#[flowVars['hasTimestamp']]">
<enricher target="#[flowVars['timestamp']]">
<objectstore:retrieve config-ref="ObjectStore" key="timestamp" />
</enricher>
</when>
<otherwise>
<set-variable variableName="timestamp" value="#[server.dateTime.format(&quot;yyyy-MM-dd'T'HH:mm:ss.SSS'Z'&quot;)]" />
</otherwise>
</choice>
<sfdc:query config-ref="Salesforce" query="select Id from Contact where LastModifiedDate &amp;gt; #[flowVars['timestamp']]" />
<flow-ref name="selectNewTimestamp" />
<flow-ref name="doYourSyncMagic" />
<objectstore:store value-ref="#[flowVars['updatedTimestamp']]" key="timestamp" config-ref="ObjectStore" />
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment