Did anyone have luck example on the jobprocessor to work?
When i submit the job it says status pending and never goes on?
Solved! Go to Solution.
Did anyone have luck example on the jobprocessor to work?
When i submit the job it says status pending and never goes on?
Solved! Go to Solution.
Solved by barbara.han. Go to Solution.
Are you running JobProcessor.exe? If so, do you see your job type listed when you go to Administration -> Job Types?
Are you running JobProcessor.exe? If so, do you see your job type listed when you go to Administration -> Job Types?
on the local computer the jobserver is running? and shows like this
on the server the jobserver is running also and shows this.
i setup a jobserver user "VaultJobServer" that i typed in to the jobserver as the user to run the jobserver?
what do i do wrong?
on the local computer the jobserver is running? and shows like this
on the server the jobserver is running also and shows this.
i setup a jobserver user "VaultJobServer" that i typed in to the jobserver as the user to run the jobserver?
what do i do wrong?
You might not see the readme.txt file, which has a statement like this:
To Process a job: Go to the Explorer folder under your Vault Client install path. Edit JobProcessor.exe.config in a text or XML editor. Add
<jobHandler class="MyCompany.File.Publish" handler="JobProcessorApiSamples.FolderPublishJobHandler, JobProcessorApiSamples"/>
in the <jobHandlers> section. Save and close.
If you did above mentioned, you will see a new job type called "MyCompany.File.Publish" in the job type list, also that job will be handled by JobProcessor.exe when it runs.
Hope this helps.
You might not see the readme.txt file, which has a statement like this:
To Process a job: Go to the Explorer folder under your Vault Client install path. Edit JobProcessor.exe.config in a text or XML editor. Add
<jobHandler class="MyCompany.File.Publish" handler="JobProcessorApiSamples.FolderPublishJobHandler, JobProcessorApiSamples"/>
in the <jobHandlers> section. Save and close.
If you did above mentioned, you will see a new job type called "MyCompany.File.Publish" in the job type list, also that job will be handled by JobProcessor.exe when it runs.
Hope this helps.
That did the trick? now the jobs are added to the jobqueue but i have to pause and resume the jobserver to get the jobs running? can you explain why? and another thing is that in the code there is a bytes warning how do i get this right?
That did the trick? now the jobs are added to the jobqueue but i have to pause and resume the jobserver to get the jobs running? can you explain why? and another thing is that in the code there is a bytes warning how do i get this right?
What you need to do is please follow the instruction explained in the readme file in Job processor sample. The job type is missing in your job type list (see your previous pic), this means that job has no jobhandler so it won't be hanlded.
No need to stop/assume job server. I did't say you should do that.
that warning you showed in your pic doesn't matter, you can leave it alone.
What you need to do is please follow the instruction explained in the readme file in Job processor sample. The job type is missing in your job type list (see your previous pic), this means that job has no jobhandler so it won't be hanlded.
No need to stop/assume job server. I did't say you should do that.
that warning you showed in your pic doesn't matter, you can leave it alone.
i Did do what you told me to do - the problem was my virus scanner was bloggin the jobserver to start. when i disconnected the virus scanner it all worked. Thanks to your help
i Did do what you told me to do - the problem was my virus scanner was bloggin the jobserver to start. when i disconnected the virus scanner it all worked. Thanks to your help
Nice. Some time back, I wrote a sample which auto-fires the JobProcessor.exe after the job is posted to job queue, so no need to wait till JobProcessor.exe to run up periodly to deal with your job. I copied the code below, in case it's useful for you:
Replace the QueuePublishJobCommandHandler function in QueuePublishJobCommandExtension.vb file with the following code:
Public Sub QueuePublishJobCommandHandler(s As Object, e As CommandItemEventArgs)
'Create your own job
For Each vaultObj As ISelection In e.Context.CurrentSelectionSet
Dim file As File = m_serviceManager.DocumentService.GetLatestFileByMasterId(vaultObj.Id)
Dim param1 As JobParam = New JobParam
param1.Name = "FileVersionId"
param1.Val = file.Id.ToString()
Dim fileNameParam As New JobParam()
fileNameParam.Name = "FileName"
fileNameParam.Val = vaultObj.Label
Dim mySyncJob As Job = _
m_serviceManager.JobService.AddJob("MyCompany.File.Publish", "property sync job", New JobParam() {param1, fileNameParam}, 1)
Next
' Try to run a new instance of Job Processor
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Try
Dim mypcs As New Process
mypcs.StartInfo.FileName = "JobProcessor.exe"
mypcs.Start()
Catch ex As Exception
End Try
End Sub
Next, replace the Execute function in FolderPublishJobHandler.vb file with the following code:
Public Function Execute(context As IJobProcessorServices, job As IJob) As JobOutcome Implements IJobHandler.Execute
Dim fileMasterId As Long = Convert.ToInt64(job.Params("FileVersionId"))
Dim fileName As String = job.Params("FileName")
Try
' Do something here, e.g. PrintFiles
' Close the JobProcessor.exe
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Return JobOutcome.Success
Catch er As Exception
Return JobOutcome.Failure
End Try
End Function
Nice. Some time back, I wrote a sample which auto-fires the JobProcessor.exe after the job is posted to job queue, so no need to wait till JobProcessor.exe to run up periodly to deal with your job. I copied the code below, in case it's useful for you:
Replace the QueuePublishJobCommandHandler function in QueuePublishJobCommandExtension.vb file with the following code:
Public Sub QueuePublishJobCommandHandler(s As Object, e As CommandItemEventArgs)
'Create your own job
For Each vaultObj As ISelection In e.Context.CurrentSelectionSet
Dim file As File = m_serviceManager.DocumentService.GetLatestFileByMasterId(vaultObj.Id)
Dim param1 As JobParam = New JobParam
param1.Name = "FileVersionId"
param1.Val = file.Id.ToString()
Dim fileNameParam As New JobParam()
fileNameParam.Name = "FileName"
fileNameParam.Val = vaultObj.Label
Dim mySyncJob As Job = _
m_serviceManager.JobService.AddJob("MyCompany.File.Publish", "property sync job", New JobParam() {param1, fileNameParam}, 1)
Next
' Try to run a new instance of Job Processor
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Try
Dim mypcs As New Process
mypcs.StartInfo.FileName = "JobProcessor.exe"
mypcs.Start()
Catch ex As Exception
End Try
End Sub
Next, replace the Execute function in FolderPublishJobHandler.vb file with the following code:
Public Function Execute(context As IJobProcessorServices, job As IJob) As JobOutcome Implements IJobHandler.Execute
Dim fileMasterId As Long = Convert.ToInt64(job.Params("FileVersionId"))
Dim fileName As String = job.Params("FileName")
Try
' Do something here, e.g. PrintFiles
' Close the JobProcessor.exe
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Return JobOutcome.Success
Catch er As Exception
Return JobOutcome.Failure
End Try
End Function
I tried your code but it gives me 2 new errors? what do i do about them?
I tried your code but it gives me 2 new errors? what do i do about them?
Please just use the SDK code for adding job to the queue. My code sample was wrote for previous version.
The key code is to fire JobProcessor tafter the custom job is added to queue. Here is the code that really matter:
Public Sub QueuePublishJobCommandHandler(s As Object, e As CommandItemEventArgs)
' TODO: You can add custom job here...
' Try to run a new instance of Job Processor
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Try
Dim mypcs As New Process
mypcs.StartInfo.FileName = "JobProcessor.exe"
mypcs.Start()
Catch ex As Exception
End Try
End Sub
FolderPublishJobHandler.vb file:
Public Function Execute(context As IJobProcessorServices, job As IJob) As JobOutcome Implements IJobHandler.Execute
Try
' Handle the custom job here...
' Close JobProcessor if needed:
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Return JobOutcome.Success
Catch er As Exception
Return JobOutcome.Failure
End Try
End Function
Please just use the SDK code for adding job to the queue. My code sample was wrote for previous version.
The key code is to fire JobProcessor tafter the custom job is added to queue. Here is the code that really matter:
Public Sub QueuePublishJobCommandHandler(s As Object, e As CommandItemEventArgs)
' TODO: You can add custom job here...
' Try to run a new instance of Job Processor
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Try
Dim mypcs As New Process
mypcs.StartInfo.FileName = "JobProcessor.exe"
mypcs.Start()
Catch ex As Exception
End Try
End Sub
FolderPublishJobHandler.vb file:
Public Function Execute(context As IJobProcessorServices, job As IJob) As JobOutcome Implements IJobHandler.Execute
Try
' Handle the custom job here...
' Close JobProcessor if needed:
Dim processes() As Process = System.Diagnostics.Process.GetProcessesByName("JobProcessor")
If processes.Count > 0 Then
Dim Pcs As Process
For Each Pcs In processes
Pcs.CloseMainWindow()
Next
End If
Return JobOutcome.Success
Catch er As Exception
Return JobOutcome.Failure
End Try
End Function
Can't find what you're looking for? Ask the community or share your knowledge.