Publié Fri, 17 Feb 2023 03:37:00 GMT par Tom Depiera
I'm writing a web service that I'm hoping to use in conjunction with Workflow Designer. 

The desired outcome is to input a doc id in the workflow, along with other necessary parameters, and have the document automatically merge the layers. 

However, I can't figure out how to actually get the merge to happen. I believe that I need section numbers for the document, but I'm not sure where to go from here. Here's my code so far:
  1.      public string mergeLayers(string uri, string userName, string passWord, string DWDocID, string fileCabinetName)
  2.         {
  3.             var message = "";
  4.             try
  5.             {
  6.                 ServiceConnection sc = ConnectToDocuWare(uri, userName, passWord);
  7.                 message = "Connected";
  8.                 var org = sc.Organizations[0];
  9.                 var fileCabinets = org.GetFileCabinetsFromFilecabinetsRelation().FileCabinet;
  10.                 var fileCabinet = fileCabinets.Where(f => f.Name == fileCabinetName).FirstOrDefault();
  11.                 var dialogInfoItems = fileCabinet.GetDialogInfosFromSearchesRelation();
  12.                 var dialog = dialogInfoItems.Dialog[0].GetDialogFromSelfRelation();
  13.                 var result = RunQuery(dialog, DWDocID);
  14.                 var doc = getDoc(result, dialog, DWDocID);
  15.                 var sections = doc.Sections;
  16.                 try
  17.                 {
  18.                     message = "trying merge";
  19.                     foreach (var s in sections)
  20.                     {
  21.                         new MergeAnnotationsParameters()
  22.                         {
  23.                             SectionNumber = int.Parse(s.Id)
  24.                         };
  25.                         message = "success";
  26.                                 
  27.                     }
  28.                 }
  29.                 catch (Exception ex)
  30.                 {
  31.                     message = ex.ToString();
  32.                 }
  33.             }
  34.             catch (Exception ex)
  35.             {
  36.                 message = ex.ToString();
  37.             }
  38.             return message;
  39.         }
Publié Sat, 18 Feb 2023 18:23:31 GMT par Charles McCollister
Tom,
Here's a modification of something we had which borrows code from the examples, knowledgebase, and some of Joe Kaufman's code he posted a bunch of years ago. The example code will merge the layers in all of the sections (if it has multiple sections) of a document with a particular name ("blankPage1"), which is presumed to be in the query results.
Charles
Publié Tue, 21 Feb 2023 15:22:03 GMT par Tom Depiera
awesome, thanks!

You must be signed in to post in this forum.