Skip to content

Instantly share code, notes, and snippets.

@dandiep
Created August 1, 2012 22:59
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 dandiep/3231416 to your computer and use it in GitHub Desktop.
Save dandiep/3231416 to your computer and use it in GitHub Desktop.
Invoice search
<objectstore:config name="Objectstore" partition="default" doc:name="Objectstore"/>
<flow name="PollForNewInvoices">
<poll frequency="10000">
<!-- Get the last invoice synced -->
<objectstore:retrieve config-ref="Objectstore" key="lastInvoiceId" defaultValue-ref="#[-1]" doc:name="Get Last Invoice ID"/>
</poll>
<!-- search for invoices with an ID greater than lastInvoiceId -->
<flow-ref name="GetUpdatedInvoices"/>
<!-- Update the last invoice synced -->
<objectstore:store config-ref="Objectstore" key="lastInvoiceId" value-ref="#[payload[payload.size() - 1].id]" overwrite="true" doc:name="Objectstore"/>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment