locked
Insert or Update using WCF API is flaging entity member for re-validation. RRS feed

  • Question

  • Hi,

    I have an API which uses the MDS WCF methods to update and insert entity members into MDS. Its working as expected. But whenever a entity member is inserted or updated, the validation flag is set to "requires re-validation" (With "?" symbol). Is there a setting which has to be set to validate the record once inserted or updated by API? Or should it be validated explicitly once the insert or update happens?

    Friday, December 21, 2012 1:01 PM

Answers

  • Thanks TDPPN..

    Anup,

    I am using EntityMembersMerge to upsert entity members and this is also not triggering the validation. Finaly i have used ValidationProcess WCF method to validate the upserted entity member.

    I was under the impression that business rules work like triggers. When an entity member is inserted / updated they would be triggered. But that does not seem to be the case. But loading entity members from ETL, (entity based staging) validation works perfectly.

    • Marked as answer by Nagesh CL Monday, January 14, 2013 10:53 AM
    Wednesday, December 26, 2012 2:35 PM

All replies

  • Hi,

    I havent tried using the API to validate an entity, but you can use the stored procedure mdm.udpValidateEntity to validate the entity as a whole. You can probably call this procedure in your code as a final step.

    Hope this helps.

    Monday, December 24, 2012 9:07 AM
  • AFAIK There is no setting of this sort.

    When you create entity member you do it  usually via

    1.ModelMembersBulkMerge

    2.EntityMembersCreate

    None of them seems to trigger validation on its own.For validating from WCF,"ValidationProcess" can be used.

    Note -  ModelMembersBulkMerge is asynchronous process which means before initiating validation, staging need to be checked for any unprocessed batch.

    Monday, December 24, 2012 2:55 PM
  • Thanks TDPPN..

    Anup,

    I am using EntityMembersMerge to upsert entity members and this is also not triggering the validation. Finaly i have used ValidationProcess WCF method to validate the upserted entity member.

    I was under the impression that business rules work like triggers. When an entity member is inserted / updated they would be triggered. But that does not seem to be the case. But loading entity members from ETL, (entity based staging) validation works perfectly.

    • Marked as answer by Nagesh CL Monday, January 14, 2013 10:53 AM
    Wednesday, December 26, 2012 2:35 PM
  • Do you ever hear about ValidationProcess?

    check a code sample

    protected bool ValidationProcessIssue()
            {
                bool result=false;
                try
                {
                    ValidationProcessRequest validationProcessRequest = new ValidationProcessRequest();
                    validationProcessRequest.ValidationProcessCriteria = new ValidationProcessCriteria();
                    validationProcessRequest.ValidationProcessCriteria.ModelId = new Identifier() { Name = ModelName };
                    validationProcessRequest.ValidationProcessCriteria.EntityId = new Identifier() { Name = EntityName };
                    validationProcessRequest.ValidationProcessCriteria.VersionId = new Identifier() { Name = VersionName };
                    validationProcessRequest.ValidationProcessOptions = new ValidationProcessOptions();
                    validationProcessRequest.ValidationProcessOptions.ReturnValidationResults = true;

                    // Process validation and get a validation issue.
                    ValidationProcessResponse validationProcessResponse = client.ValidationProcess(validationProcessRequest);

                    if (validationProcessResponse != null && validationProcessResponse.OperationResult != null)
                    {
                        Collection<Error> errors = validationProcessResponse.OperationResult.Errors;
                        if (errors.Any())
                        {
                            string err = "Validation issue: " + string.Join(";", errors.Select(x => x.Description).Distinct());
                            throw new Exception(err);
                        }
                    }
                    result = true;
                }
                catch (Exception ex)
                {
                    Logger<BaseRepository<T>>.LogException(ex.Message);
                    throw;
                }
                return result;

    hope it will help

    Wednesday, November 25, 2015 1:26 PM