(Adobe® Flex™ Data Services 2 only)
Packagemx.data
Classpublic class Conflict
InheritanceConflict Inheritance Object

The Conflict class is used to represent error that has occurred due to an update operation. Conflicts are generated for many reasons. For example, another client has updated the same property of an item. Conflicts are determined by both the remote destination and the local DataService. A conflict detected by the DataService is considered a local conflict. A conflict detected by the remote destination is a remote conflict. Custom assemblers can generate a remote conflict for any operation when processing an update. Local conflicts are determined by the ConflictDetector object. To customize local conflict detection the ConflictDetector can be extended and assigned to the DataService.conflictDetector property. All conflicts must be resolved before changes can be committed.



Public Properties
 PropertyDefined by
  cause : DataMessage
[read-only] Returns the DataMessage that caused the conflict.
Conflict
  clientObject : Object
[read-only] Returns the state of the client object (whose property was changed) at the time of the conflict.
Conflict
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  destination : String
[read-only] Returns the destination for the data service of the item involved in this conflict.
Conflict
  originalObject : Object
[read-only] Returns the state of the original client object before its properties were changed, as known at the time of the conflict.
Conflict
  propertyNames : Array
[read-only] Returns an Array of the names of the properties that were in conflict between the client change and the remote item state.
Conflict
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  resolved : Boolean
[read-only] Indicates whether this Conflict has been resolved (acceptClient() or acceptServer() has been called).
Conflict
  serverObject : Object
[read-only] Returns the value of server object whose property was to be changed.
Conflict
  serverObjectReferencedIds : Object
[read-only] If the serverObject has any properties with lazy="true", returns an Object that stores the referencedId Arrays for each lazily loaded property, using the property name as the lookup key value.
Conflict
Public Methods
 MethodDefined by
  
Conflict(dataService:ConcreteDataService, errMsg:DataErrorMessage, resolver:ConflictResolver)
Constructs an instance of a Conflict based on the specified error message
Conflict
  
Requeues the current local changes and updates the property values such that a subsequent call to DataService.commit() should succeed, causing these changes to override the previous ones.
Conflict
  
Removes the conflicting local change and applies the property values found on Conflict.serverObject to the local item.
Conflict
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Conflict
 Inherited
Returns the primitive value of the specified object.
Object
Property detail
causeproperty
cause:DataMessage  [read-only]

Returns the DataMessage that caused the conflict.

Implementation
    public function get cause():DataMessage
clientObjectproperty 
clientObject:Object  [read-only]

Returns the state of the client object (whose property was changed) at the time of the conflict.

Implementation
    public function get clientObject():Object
destinationproperty 
destination:String  [read-only]

Returns the destination for the data service of the item involved in this conflict.

Implementation
    public function get destination():String
originalObjectproperty 
originalObject:Object  [read-only]

Returns the state of the original client object before its properties were changed, as known at the time of the conflict.

Implementation
    public function get originalObject():Object
propertyNamesproperty 
propertyNames:Array  [read-only]

Returns an Array of the names of the properties that were in conflict between the client change and the remote item state. All property names are String values and exist in the public namespace.

Implementation
    public function get propertyNames():Array
resolvedproperty 
resolved:Boolean  [read-only]

Indicates whether this Conflict has been resolved (acceptClient() or acceptServer() has been called).

Implementation
    public function get resolved():Boolean

See also

serverObjectproperty 
serverObject:Object  [read-only]

Returns the value of server object whose property was to be changed.

Implementation
    public function get serverObject():Object
serverObjectReferencedIdsproperty 
serverObjectReferencedIds:Object  [read-only]

If the serverObject has any properties with lazy="true", returns an Object that stores the referencedId Arrays for each lazily loaded property, using the property name as the lookup key value.

Implementation
    public function get serverObjectReferencedIds():Object
Constructor detail
Conflict()constructor
public function Conflict(dataService:ConcreteDataService, errMsg:DataErrorMessage, resolver:ConflictResolver)

Constructs an instance of a Conflict based on the specified error message

Parameters
dataService:ConcreteDataService
 
errMsg:DataErrorMessage
 
resolver:ConflictResolver
Method detail
acceptClient()method
public function acceptClient():void

Requeues the current local changes and updates the property values such that a subsequent call to DataService.commit() should succeed, causing these changes to override the previous ones.


Example
         private function conflictHandler(event:DataConflictEvent):void
         {
             if (acceptClientCheck.selected)
             {
                  event.conflict.acceptClient();
             }
             else
             {
                  event.conflict.acceptServer();
             }
         }
      

acceptServer()method 
public function acceptServer():void

Removes the conflicting local change and applies the property values found on Conflict.serverObject to the local item.


Example
         private function conflictHandler(event:DataConflictEvent):void
         {
             if (acceptClientCheck.selected)
             {
                  event.conflict.acceptClient();
             }
             else
             {
                  event.conflict.acceptServer();
             }
         }
      

toString()method 
public function toString():String

Returns
String