Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Pull Request for #12 #13

wants to merge 3 commits into from

Conversation

TollJulian
Copy link

No description provided.

@TollJulian TollJulian requested a review from wgyalpo August 2, 2023 10:49
Comment on lines 831 to 846
$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)'"
}
Copy link
Collaborator

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.

Copy link
Author

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

Comment on lines 847 to 858

# $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()

}

Copy link
Collaborator

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?

Copy link
Author

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
Copy link
Collaborator

@wgyalpo wgyalpo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wgyalpo wgyalpo self-requested a review August 30, 2023 08:16

# 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)
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants