Autodesk.Connectivity.Explorer.ExtensibilityTools and Jobserver

Autodesk.Connectivity.Explorer.ExtensibilityTools and Jobserver

Anonymous
Not applicable
1,788 Views
9 Replies
Message 1 of 10

Autodesk.Connectivity.Explorer.ExtensibilityTools and Jobserver

Anonymous
Not applicable

Hi

 

We use in a Job "UpdateFileProperties" of the namespace "Autodesk.Connectivity.Explorer.ExtensibilityTools". In Vault 2012 it works fine. Now in Vault 2013 only the first job does all the updates we want to. The next and all following jobs of the same type fail. We get the Errormessage "Error updating property values". The guys of coolorange get the same effect in different tests.

 

How can we handle this problem. Is there any workaround. Its very urgent, because we are actualy in an project we need this feature.

 

Gerhard

0 Likes
1,789 Views
9 Replies
Replies (9)
Message 2 of 10

Redmond.D
Autodesk
Autodesk

We released a hotfix to address this issue: http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=19844149&linkID=9261341



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes
Message 3 of 10

Anonymous
Not applicable

I'm getting the same error (Error updating property values) when using UpdateFileProperties within Job Processor.

When trying to make the same call - let's say inside of console app - it works perfectly, but not with Job Processor.

 

I really don't get it.....!! Is this a known error with Update 1?

 

 

At the moment we're using Vault Professional 2013 with Update 1.

 

0 Likes
Message 4 of 10

Redmond.D
Autodesk
Autodesk

The hotfix, which is part of update 1, fixes a specific issue where the first time you call UpdateFileProperties it works, but every time after that it fails.  If you are seeing that UpdateFileProperties fails on the first call, then the problem is something else.

 

I suggest posting your code where you initialize IExplorerUtil and where you call UpdateFileProperties.  

 

 

 



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes
Message 5 of 10

Anonymous
Not applicable

I can't explain to myself, why first job is running and all subsequent doesn't until Job Processor gets restarted.

 

So back to my code, where my Job Handler is calling a  method (UpdateProperties) of a referenced assembly (JobHelper.dll) which contains the file property update method:

 

Inside of my JobHelper.dll :

 

public JobOutcome UpdateProperties(IJobProcessorServices context, long fileId, long userIdOfJobExecuter, LifecycleStatus status)
        {
            try
            {
                UserPasswordCredentials adminCred = new JobHelper().GetAdminCred(context);
                using (WebServiceManager _srvMgr = new WebServiceManager(adminCred))
                {
                    File file = _srvMgr.DocumentService.GetFileById(fileId);
                    // check for drawing
                    if (file.Name.ToLower().EndsWith(".idw") || file.Name.ToLower().EndsWith(".dwg"))
                    {
                        // getting PropDefInfo
                        PropDefInfo[] propDefInfo = _srvMgr.PropertyService.GetPropertyDefinitionInfosByEntityClassId("FILE", null);
                        string fullUserName = JobHelper.GetUserName(_srvMgr, userIdOfJobExecuter);
                        Dictionary<PropDef, object> properties;
						
						switch (status)
						{
							case LifecycleStatus.FromWorkToReviewed:
								//....
								// some further code
								//....
								break;
							case LifecycleStatus.FromReviewedToChecked:								
								properties = new Dictionary<PropDef, object>()
								{
									{ propDefInfo.FirstOrDefault(x => x.PropDef.DispName == "Initial Checked By").PropDef, fullUserName},
									{ propDefInfo.FirstOrDefault(x => x.PropDef.DispName == "Initial Checked Date").PropDef, DateTime.Now}
								};
								break;
							default:
								properties = new Dictionary<PropDef, object>();
								throw new JobFrameworkException("Kein übergebener Status");
						}

                        // update properties
                        IExplorerUtil explorerUtil = ExplorerLoader.LoadExplorerUtil(
                            _srvMgr.SecurityService.Url,
                            context.VaultContext.VaultName,
                            _srvMgr.SecurityService.SecurityHeader.UserId,
                            _srvMgr.SecurityService.SecurityHeader.Ticket);
                        explorerUtil.UpdateFileProperties(file, properties);

                        return JobOutcome.Success;
                    }
                    else
                    {
                        return JobOutcome.Success;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionWriter(ex);
                return JobOutcome.Failure;
            }            
        }

        private UserPasswordCredentials GetAdminCred(IJobProcessorServices context)
        {
            UserPasswordCredentials adminCred = new UserPasswordCredentials(
                    context.VaultContext.RemoteBaseUrl.ToString(),
                    context.VaultContext.VaultName,
                    "jobserver",
                    "myPassword);
            return adminCred;
        }

 

 

0 Likes
Message 6 of 10

Redmond.D
Autodesk
Autodesk

Are you sure that the first call UpdateFileProperties succeeds?

If so, then check your file versions to make sure the the update has been applied.  According to the hotfix readme, the following files should be 17.0.62.200 or higher.

  • Connectivity.Explorer.DocumentPS.dll
  • JobProcessor.exe

If that's not the problem, post the output from the Exception.



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes
Message 7 of 10

Anonymous
Not applicable

Thanks for reply Doug.

 

I'm safe as houses the UpdateFileProperties call of the first job succeeds (job is not in job queue anymore and properties are updated).

 

SP1 applied successful regarding to file versions:

  • Connectivity.Explorer.DocumentPS.dll (17.1.16.0)
  • JobProcessor.exe (17.1.16.0)

 

Via StreamWriter I extract Exception to txt file:

 

==========================================

Message: Error updating property values
Stacktrace:    at Connectivity.Explorer.ExtensibilityUtil.ExplorerUtil.UpdateFileProperties(File file, Dictionary`2 props)
   at Library_VaultJobServerHelper.JobHelper.UpdateProperties(IJobProcessorServices context, Int64 fileId, Int64 userIdOfJobExecuter, LifecycleStatus status)
InnerException:

Data &colon; System.Collections.ListDictionaryInternal
HelpLink:

==========================================

 


 

0 Likes
Message 8 of 10

Redmond.D
Autodesk
Autodesk

I just noticed something.  You supply your own username and password when creating your WebServiceManager credentials.  Try using UserIdTicketCredentials instead.  The IJobProcessorServices should have all the information you need for that type of credentials



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes
Message 9 of 10

Anonymous
Not applicable

I have to supply my own username and password when creating my WebServiceManager credentials, because I need some admin rights for updating properties. By using UserIdTicketCredentials of IJobProcessorServices there aren't proper rights for updating properties.

 

Nevertheless I have tried using UserIdTicketCredentials of IJobProcessorServices and queued up the job with admin account, but ended up in same error message -> "Error updating property values".

 

It's really enough to drive one to despair.....

0 Likes
Message 10 of 10

psaarloos
Collaborator
Collaborator

Hi,

 

We're making use of the UpdateProperties method quite a lot without any problem. I compared you're code against ours and I detected two differences:

 

1) We're only updating text properties. Is the problem maybe being causes by updating a date property? You could try to update text properties only to make sure the date property isn't causing the problem.

 

2) In your code you call the LoadExplorerUtil for every job. In our code we created a public property like below. It checks if the ExplorerUtil is loaded already. If so, it returns the existing ExplorerUtil.

 

private IExplorerUtil _explorerUtil;

public IExplorerUtil ExplorerUtil

        {      

get

        {               

if (this._explorerUtil == null)

        {

this._explorerUtil = ExplorerLoader.LoadExplorerUtil(RemoteBaseUrl, VaultName, UserId, Ticket);

        }      

return this._explorerUtil;

        }

        }

 

Hope this information helps you to solve the problem.

 

Regards,

Pim Saarloos

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes