function createNewVariant(oSourceVariant, mPropertyBag) {
		var mProperties = {
			id: mPropertyBag.newVariantReference,
			variantName: mPropertyBag.title,
			contexts: mPropertyBag.contexts,
			layer: mPropertyBag.layer,
			adaptationId: mPropertyBag.adaptationId,
			reference: oSourceVariant.getFlexObjectMetadata().reference,
			generator: mPropertyBag.generator,
			variantManagementReference: mPropertyBag.variantManagementReference,
			executeOnSelection: mPropertyBag.executeOnSelection
		};
		if (mPropertyBag.layer === Layer.VENDOR) {
			mProperties.user = "SAP";
		}
		if (mPropertyBag.currentVariantComparison === 1) {
			// in case a user variant should be saved as a PUBLIC variant, but refers to a PUBLIC variant,
			// the references dependencies must be followed one more time
			if (mPropertyBag.sourceVariantSource.instance.getLayer() === mPropertyBag.layer) {
				mProperties.variantReference = mPropertyBag.sourceVariantSource.instance.getVariantReference();
			} else {
				mProperties.variantReference = oSourceVariant.getVariantReference();
			}
		} else if (mPropertyBag.currentVariantComparison === 0) {
			mProperties.variantReference = oSourceVariant.getVariantReference();
		} else if (mPropertyBag.currentVariantComparison === -1) {
			mProperties.variantReference = mPropertyBag.sourceVariantReference;
		}

		return FlexObjectFactory.createFlVariant(mProperties);
	}
Saves a function that will be called after a variant has been applied with the new variant as parameter.
The function also performs a sanity check after the control has been rendered.
If the passed variant control ID does not match the responsible variant management control, the callback will not be saved.
Optionally this function is also called after the initial variant is applied without a sanity check.

@param {object} mPropertyBag - Object with parameters as properties
@param {string} mPropertyBag.control - Instance of the control
@param {string} mPropertyBag.vmControlId - ID of the variant management control
@param {function} mPropertyBag.callback - Callback that will be called after a variant has been applied
@param {boolean} mPropertyBag.callAfterInitialVariant - The callback will also be called after the initial variant is applied
@returns {Promise} Promise that resolves after the sanity check