-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull Request for #12 #13
base: master
Are you sure you want to change the base?
Conversation
...s Update Revision Block and Create PDF/Modules/Sample.SyncFilePropsAndUpdRevBlockModule.psm1
Show resolved
Hide resolved
$ConnectivityJobProcessorDelegateAssembly = [System.Reflection.Assembly]::Load("Connectivity.JobProcessor.Delegate") | ||
$context = $ConnectivityJobProcessorDelegateAssembly.CreateInstance("Connectivity.JobHandlers.Services.Objects.ServiceJobProcessorServices",$true, [System.Reflection.BindingFlags]::CreateInstance, $null, $null, $null, $null) | ||
$context.GetType().GetProperty("Connection").SetValue($context, $vaultConnection, $null) #need to set the Connection property on the context or else it runs into error | ||
|
||
$JobHandlerURBAssembly = [System.Reflection.Assembly]::Load("Connectivity.Explorer.JobHandlerUpdateRevisionBlock") | ||
$uRBJobHandler = $JobHandlerURBAssembly.CreateInstance("Connectivity.Explorer.JobHandlerUpdateRevisionBlock.UpdateRevisionBlockJobHandler",$true, [System.Reflection.BindingFlags]::CreateInstance, $null, $null, $null, $null) | ||
$uRBJob = New-Object Connectivity.Services.Job.UpdateRevisionBlockJob("vault",$fileForUpdRevJob.Id,$false,$false,$fileForUpdRevJob.Name) | ||
|
||
$jobOutcome = $uRBJobHandler.Execute($context,$uRBJob) #call execute to start running the job | ||
|
||
if ($jobOutcome -eq "Failure") | ||
{ | ||
throw "Failed job 'Update Revision Block'" #Failed because of issue that occured in the job | ||
} | ||
Write-Host "End 'Update Revision Block' of file '$($fileForUpdRevJob.Name)'" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the one from the metso-minerals is an insteresting alternative to this block of code. maybe we should replace this one with the other one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metso-Code is currently throwing a null-referecne error in line 855
...s Update Revision Block and Create PDF/Modules/Sample.SyncFilePropsAndUpdRevBlockModule.psm1
Outdated
Show resolved
Hide resolved
|
||
# $versionIds = @($file.Id) | ||
# $fileVersions = [Connectivity.Services.Document.DocServices]::Instance.GetFileVersionsByIDs($vaultConnection, $versionIds) | ||
# $multiSideProvider = new-object Connectivity.Explorer.JobHandlerUpdateRevisionBlock.URBJobHandlerMultiSiteSyncProvider -ArgumentList $true | ||
|
||
# $updateRevisionBlock = new-object Connectivity.Explorer.Document.ViewModel.UpdateRevisionBlock -ArgumentList $fileVersions, $false | ||
# $updateRevisionBlock.MultiSiteSyncProvider = $multiSideProvider | ||
# $updateRevisionBlock.CheckInComment = "Revision table updated by coolOrange UpdateRevisionTable" | ||
# $updateRevisionBlock.RefreshRevisionBlock() | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why this is commented. is this still in progress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I currently get a null refrence error in line 855
* code from METSO: use correct variable. Anyways, still throws error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
# Error using this code block: Exception calling "GetFileVersionsByIDs" with "2" argument(s): "1013" | ||
|
||
# $versionIds = @($fileForUpdRevJob.Id) | ||
# $fileVersions = [Connectivity.Services.Document.DocServices]::Instance.GetFileVersionsByIDs($vaultConnection, $versionIds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if you use the original $file.Id? I think here we need to investigate with different Id or master id.
No description provided.