I am wondering that you looked at the FileStatus property of the File object. This property is not available for Vault Workgroup and Professional; it is Vault Basic only and reflects a pending update of parent-child-related files.
The local files' status is the property VaultStatus; you need to retrieve it from the file iteration object. Then you get
the StatusImageInfo.Status that shares the information you are looking for.
The code below will run successfully as you replace the server identity, vault, and user information; also replace the path to the sample file. Copy the code to a new project consuming the Vault SDK template API-Onboarding Console Application.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ACW = Autodesk.Connectivity.WebServices;
using ACWT = Autodesk.Connectivity.WebServicesTools;
using VDF = Autodesk.DataManagement.Client.Framework;
using Autodesk.DataManagement.Client.Framework.Vault.Currency.Properties;
namespace API_Onboarding_CheckFileStatus
{
class Program
{
static void Main(string[] args)
{
#region ConnectToVault
ACW.ServerIdentities mServerId = new ACW.ServerIdentities();
mServerId.DataServer = ""; //replace value by command line args[i]
mServerId.FileServer = "";
string mVaultName = "";
string mUserName = "";
string mPassword = "";
ACW.LicensingAgent mLicAgent = ACW.LicensingAgent.Client;
ACWT.WebServiceManager mVault = null;
ACWT.UserPasswordCredentials mCred = null;
try
{
mCred = new ACWT.UserPasswordCredentials(mServerId, mVaultName, mUserName, mPassword, mLicAgent);
mVault = new ACWT.WebServiceManager(mCred);
try
{
ACW.ServerIdentities mSrvIdnts = new ACW.ServerIdentities();
///ACWT.UserIdTicketCredentials mCred = new AWT.UserIdTicketCredentials(mSrvIdnts, VaultName, UserId, Ticket);
Autodesk.Connectivity.WebServicesTools.WebServiceManager mWsMgr = new ACWT.WebServiceManager(mCred);
VDF.Vault.Currency.Connections.Connection mConnection = new VDF.Vault.Currency.Connections.Connection(
mWsMgr, mVaultName, mVault.SecurityService.SecurityHeader.UserId, mServerId.DataServer, VDF.Vault.Currency.Connections.AuthenticationFlags.Standard);
ACW.File mFile = mVault.DocumentService.FindLatestFilesByPaths(new string[] { "$/Designs/Inventor Sample Data/Fishing Rod Model/01-1136.idw" }).FirstOrDefault();
//query data, create files, folders, items... etc. here
VDF.Vault.Currency.Entities.FileIteration mFileIteration = new VDF.Vault.Currency.Entities.FileIteration(mConnection, mFile);
PropertyDefinitionDictionary mProps = mConnection.PropertyManager.GetPropertyDefinitions(VDF.Vault.Currency.Entities.EntityClassIds.Files, null, PropertyDefinitionFilter.IncludeAll);
PropertyDefinition mVaultStatus = mProps[PropertyDefinitionIds.Client.VaultStatus];
EntityStatusImageInfo status = mConnection.PropertyManager.GetPropertyValue(mFileIteration, mVaultStatus, null) as EntityStatusImageInfo;
}
catch (Exception ex)
{
throw ex;
}
//never forget to release the license, especially if pulled from Server
mVault.Dispose();
}
catch (Exception ex)
{
throw ex;
}
#endregion connect to Vault
}
}
}
Markus Koechl
Solutions Engineer PDM, Autodesk Central Europe