function variantCanBeUpdated(oVariant, sLayer) {
			var bSameLayer = oVariant.getLayer() === sLayer;
			var sPackageName = oVariant.getFlexObjectMetadata().packageName;
			var bNotTransported = !sPackageName || sPackageName === "$TMP";
			// in case changes were already done within the layer, no update of the variant can be done to safeguard the execution order
			var bIsChangedOnLayer = oVariant.getChanges().some(function(oChange) {
				return oChange.getLayer() === sLayer;
			});
			return oVariant.getPersisted() && bSameLayer && bNotTransported && !bIsChangedOnLayer && isVersionIndependentOrInDraft(oVariant, mPropertyBag);
		}
Updates a variant; this may result in an update of the variant or the creation of a change.

@param {object} mPropertyBag - Object with parameters as properties
@param {string} mPropertyBag.reference - Flex reference of the application
@param {string} mPropertyBag.persistencyKey - Key of the variant management
@param {string} mPropertyBag.id - ID of the variant
@param {string} [mPropertyBag.packageName] - ID of the package in which the update should be transported - only valid for sap-ui-layer=VENDOR use case
@param {string} [mPropertyBag.transportId] - ID of the transport in which the update should be transported
@param {object} [mPropertyBag.revert=false] - Flag if the update is a revert operation
@param {object} [mPropertyBag.name] - Title of the variant
@param {object} [mPropertyBag.content] - Content of the new change
@param {object} [mPropertyBag.favorite] - Flag if the variant should be flagged as a favorite
@param {boolean} [mPropertyBag.visible] - Flag if the variant should be set visible
@param {object} [mPropertyBag.executeOnSelection] - Flag if the variant should be executed on selection
@param {object} [mPropertyBag.contexts] - Map of contexts that restrict the visibility of the variant
@param {string[]} [mPropertyBag.contexts.role] - List of roles which are allowed to see the variant
@param {sap.ui.fl.Layer} mPropertyBag.layer - Layer in which the variant removal takes place;
@param {string} [mPropertyBag.adaptationId] - ID of the context-based adaptation
@param {boolean} [mPropertyBag.forceCreate] - Parameter that forces a new change to be created
this either updates the variant from the layer or writes a change to that layer.
@returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The updated variant