Start a new topic

Determining the State of a Source File from a File Link

 Is it possible for PowerJobs to determine the State of a source file by using a file link if both files are located somewhere in VAULT?  The requirement is to initiate a PowerJobs process based on the State of the file link, and then continue processing conditional upon the State of the source file itself.

Can this be done?

1 Comment

Hello Steven,

when you create a job in Vault it is created for a file, never for a link. Even if you create a job on a link, Vault will actually create it for the file referenced by the link.

Doing different stuff based on the file's state is rather easy though. Depending on the exact use case you could either make different jobs for different state changes, build some conditions in the job or some functions that do different stuff based on the state.


powerJobs creates a $file object that represents the file a job was created for. The file object has a _State property which can be accessed like this $file._State


This allows you to do different stuff based on the state.


Example

function CanExecuteJob($File) {

if(-not $File -or $File._State -ine "released") { return $false }

return $true 

}


if(-not (CanExecuteJob)){ return }


Let me know if you have any further questions


----------------------------

Thomas Rossmeisl

Technical Support

 

Please mark your thread as solved if your question was answered

Login or Signup to post a comment