By Barbara Han
Issue
The method for adding job is JobService.AddJob in Vault API, but I don’t know how to pass in the right parameters or the job will fail.
Solution
The valid job types for property synchronization job are:
Autodesk.Vault.SyncProperties.iam
Autodesk.Vault.SyncProperties.ipt
Autodesk.Vault.SyncProperties.ipn
Autodesk.Vault.SyncProperties.idw
Autodesk.Vault.SyncProperties.dwg
Autodesk.Vault.SyncProperties.doc
Autodesk.Vault.SyncProperties.dot
Autodesk.Vault.SyncProperties.xls
Autodesk.Vault.SyncProperties.xlt
Autodesk.Vault.SyncProperties.xla
Autodesk.Vault.SyncProperties.ppt
Autodesk.Vault.SyncProperties.pot
Autodesk.Vault.SyncProperties.ppa
Autodesk.Vault.SyncProperties.mpp
Autodesk.Vault.SyncProperties.mpt
Autodesk.Vault.SyncProperties.vsd
Autodesk.Vault.SyncProperties.vst
Autodesk.Vault.SyncProperties.dotx
Autodesk.Vault.SyncProperties.xlsx
Autodesk.Vault.SyncProperties.xltx
Autodesk.Vault.SyncProperties.xlax
Autodesk.Vault.SyncProperties.pptx
Autodesk.Vault.SyncProperties.potx
Autodesk.Vault.SyncProperties.ppax
Autodesk.Vault.SyncProperties.mppx
Autodesk.Vault.SyncProperties.mptx
Autodesk.Vault.SyncProperties.vsdx
Autodesk.Vault.SyncProperties.vstx
The valid parameters for property synchronization job are:
- FileVersionId - [required] - The File.Id value of the file to sync
- QueueCreateDwfJobOnCompletion - [optional] - If true, a DWF create job is fired when the property sync job is completed.
Here is a C# sample code that adds a property synchronization job without the need for creating DWF for the file:
JobParam param1 = new JobParam();
param1.Name = "FileVersionId";
param1.Val = "36";
jobSvc.AddJob("Autodesk.Vault.SyncProperties.ipt", "property sync job", new JobParam[] { param1 });
If you pass the QueueCreateDwfJobOnCompletion parameter as true, you would need to add a DWF create job. The following is the valid job types for DWF Create Job:
Autodesk.Vault.DWF.Create.iam
Autodesk.Vault.DWF.Create.ipt
Autodesk.Vault.DWF.Create.ipn
Autodesk.Vault.DWF.Create.idw
Autodesk.Vault.DWF.Create.dwg
The valid parameter for DWF Create Job is:
- FileVersionId - [required] - The File.Id value of the file to create the DWF from
Below C# sample code adds a property synchronization job and DWF create job:
JobParam param1 = new JobParam();
param1.Name = "FileVersionId";
param1.Val = "36";
JobParam param2 = new JobParam();
param2.Name = "QueueCreateDwfJobOnCompletion";
param2.Val = "true";
jobSvc.AddJob("Autodesk.Vault.SyncProperties.ipt", "property sync job", new JobParam[] { param1, param2 });
jobSvc.AddJob("Autodesk.Vault.DWF.Create.ipt", "DWF Create job", new JobParam[] { param1 });