API for Export for/Update from external review #2

Hi,

After the first attempt to export/update external review via API, I have started to use SDL Studio 2014.

It has the proper automated tasks for these, and the export is working properly. However, I can't get to work the update method: it throws the following error:

Unexpected exception when configuring file multiFileConverter for task 'Update from External Review': Expecting element 'ArrayOfExternalReviewMappingItem' from namespace 'http://schemas.datacontract.org/2004/07/Sdl.ProjectApi.Settings'.. Encountered 'Element'  with name 'ArrayOfExternalReviewMappingItem', namespace 'http://schemas.datacontract.org/2004/07/Sdl.ProjectAutomation.Settings'. .

While, I think I properly fill the ExternalReviewMappingItems of the ImportFromReviewTaskSettings settings group before calling the RunAutomaticTask like this way (C#, and UpdateXliffAndreviewedFilepaths is a string Dictionary):


                ISettingsBundle settings = project.GetSettings(trgLanguage);
                
                ImportFromReviewTaskSettings impSettings = settings.GetSettingsGroup<ImportFromReviewTaskSettings>();

                foreach (string xliff in UpdateXliffAndreviewedFilepaths.Keys)
                {
                    impSettings.ExternalReviewMappingItems.Value.Add(new ExternalReviewMappingItem(xliff, project.GetProjectInfo().Id, UpdateXliffAndreviewedFilepaths[xliff]));
                }
                impSettings.Backup.Value = false;
                impSettings.ConfirmationLevel.Value = ConfirmationLevel.Translated;
                project.UpdateSettings(trgLanguage, settings);

                AutomaticTask task = project.RunAutomaticTask(targetFileIDs,
                        AutomaticTaskTemplateIds.UpdateFromExternalReview);
                checkAutomaticTask(task);

The online API documentation of the new external review automatic tasks are very short without any examples. Could you please advice to solve this issue?


Best regards,

 Barnabás

Parents Reply
  • Hello,

    I'm not working on a plugin. It's a windows form application.

    Should I then use
    Sdl.ProjectAutomation.Settings.ExternalReviewMappingItem (using this gives an error)
    or
    Sdl.ProjectApi.Settings.ExternalReviewMappingItem (this one builds and runs, but doesn't update)

    My question was also about the redundancy of information.
    do you need to fill in the target in the mappingItem.Language = targetlang?

    Because once you start the automatic task, you have to give the ids of the targetfiles.
    AutomaticTask update = SDLProj.RunAutomaticTask(targetFiles.GetIds(), AutomaticTaskTemplateIds.UpdateFromExternalReview

    I guess they need to match? Or can you leave the mappingItem.Language empty?

    In any case, my code runs and builds, but it doesnt update the translation units.
    Maybe there is a step missing in my code, I don't know why it's not working. I have used other AutomaticTasks before without problems.



    Thanks.
Children