SYNC Operation
The
SYNC operation provides access to the client application by synchronizing data with
SmartOffice.
SmartIntegrator parses the requests XML, retrieves the RMA logic and then runs the objects one by one.
Tags
<rma>
<phase>
<query>
<logic_step>
<return>
<objects>
Control Attributes
Attribute |
Description |
match |
Specifies the single match operation |
ambiguity |
Specifies the ambiguity operation |
no-match |
Specifies the no match operation |
insufficient-data |
The input object does not have the required properties for RMA |
Control attributes applies to <rma>, <phase> and <logic_step>.
Operations
The SYNC request supports the following operation(s).
Attribute |
Description |
ignore |
Ignore the processing or do nothing. |
insert |
Insert the object(s). |
update |
Update the object(s). |
delete |
Delete the object(s). |
return |
Return the object information to the client. |
exit |
Exit from the current step. |
PhaseID?/StepID |
The specified phase/step will be run. |
The SYNC has two child elements <rma/> and <objects/>.
- <rma/> contains RMA information. The RMA logic was split into phases. The RMA will have one or more than one <phase/> element. The RMA logic begins with one of the phases and determines which one is the starting phase.
- <phase/> contains the single query (condition) and more than one logical step. The phase has two child elements <query/> and <logic_step/>.
- <query/> contains the condition element and operation attributes. Based on this condition, it will retrieve the data from the database.
- <logic_step/> contains the condition information.
- <objects/> contains the object(s) element, along with the main object and properties information.
Request XML
<request version='1.0'>
<header>
<office/>
<user/>
<password/>
</header>
<sync>
<rma object="Contact" start="phase1" match="update" ambiguity="return" no-match="insert" insufficent-data="return">
<phase id="phase1">
<query no_match="phase2" match="update" ambiguity="step1">
<condition>
<expr prop="LastName" op="eq">
<v type="ref">Contact.LastName</v>
</expr>
</condition>
</query>
<logic_step id="step1" ambiguity="return">
<condition>
<expr prop="FirstName" op="eq">
<v type="ref">Contact.FirstName</v>
</expr>
</condition>
</logic_step>
</phase>
<phase id="phase2">
<query no_match="insert" match="update" ambiguity="return">
<condition>
<expr prop="TaxID" op="eq">
<v type="ref">Contact.TaxID</v>
</expr>
</condition>
</query>
</phase>
<return>
<Contact>
<LastName/>
<FirstName/>
</Contact>
</return>
</rma>
<objects>
<Contact>
<LastName>Ackerman</LastName>
<FirstName>Kathleen</FirstName>
<TaxID>559-65-8750</TaxID>
<WebAddresses>
<WebAddress>
<WebAddressType>1</WebAddressType>
<Address>jpkrishna@yahoo.com</Address>
</WebAddress>
</WebAddresses>
<Phones>
<Phone>
<Number>585-3505</Number>
</Phone>
</Phones>
</Contact>
<Contact>
<LastName>Ackerman</LastName>
<TaxID>559658750</TaxID>
</Contact>
</objects>
</sync>
</request>
Response XML
<response version="1.0">
<header>
<sessionClosed/>
</header>
<sync>
<Contact _status="updated" _type="obj" id="Contact.1.29">
<WebAddresses _type="objs">
<WebAddress _status="inserted" _type="obj" id="WebAddress.1.9"/>
</WebAddresses>
<Phones _type="objs">
<Phone _status="inserted" _type="obj" id="Phone.1.15"/>
</Phones>
</Contact>
<return _status="insufficent-data" total="7">
<Contact _type="obj" id="Contact.1.21">
<LastName>Ackerman</LastName>
<FirstName>Joseph</FirstName>
</Contact>
<Contact _type="obj" id="Contact.1.22">
<LastName>Ackerman</LastName>
<FirstName>Joseph</FirstName>
</Contact>
<Contact _type="obj" id="Contact.1.23">
<LastName>Ackerman</LastName>
<FirstName>Joseph</FirstName>
</Contact>
<Contact _type="obj" id="Contact.1.24">
<LastName>Ackerman</LastName>
<FirstName>Joseph</FirstName>
</Contact>
<Contact _type="obj" id="Contact.1.26">
<LastName>Ackerman</LastName>
<FirstName>Joseph</FirstName>
</Contact>
<Contact _type="obj" id="Contact.1.27">
<LastName>Ackerman</LastName>
<FirstName>Joseph</FirstName>
</Contact>
<Contact _type="obj" id="Contact.1.29">
<LastName>Ackerman</LastName>
<FirstName>Kathleen</FirstName>
</Contact>
</return>
</sync>
<_status>OK</_status>
<!-- Cost 2773 mill seconds. -->
</response>
For more on data synchronization, check out the
TwoWayContactSycnronization White Paper.
--
DavidEshelbrenner - 13 Aug 2012