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;
}