Interface Ecrion.Ecrion Omni System.IWorkflowContext

Top Previous Topic Next Topic  Print this topic

The IWorkflowContext interface contains methods which provide access to the execution engine and the repository.

 

Methods:

 

Name

Description

createSnapshot

Method used to create a project snapshot.

getUserLocalTimeZone

Returns the local time zone of the current user.

getProjectName

Method which returns the name of the current project.

getInstitutionName

Method which returns the name of the current institution.

getPath

Returns the absolute path of the current project.

getFileDownloadLink

Returns a download link for the specified file.

getFileProperties

Returns a list of properties associated with a file, from the specified trunk.

getFiles

Returns a list of files from the repository associated with the current job, existent in the specified trunk.

getJobId

Returns the ID of the current job.

getLogEvents

Returns a list of LogEvent objects associated with the current job.

log

The log method writes a message in the Ecrion Omni System logger.

initDocumentTemplate

The method initializes the document template.

startReview

Method which starts an approval review for a snapshot.

run

Method used to run an Ecrion Omni System job.

readFile

The method opens a file and reads its contents in an array of bytes.

writeFile

The method writes a file to a specified Ecrion Omni System trunk and project.

 

 

 

 

createSnapshot

 

1. This method is used to create a project snapshot.

 

Parameters:

 

projectName

       - string representing the name of the project

snapshotName

       - string representing the name of the snapshot

 

 

       void createSnapshot(String projectName, String snapshotName);

       

 

 

 

2. This method is used to create a project snapshot with specified files.

 

Parameters:

 

projectName

       - string representing the name of the project

snapshotName

       - string representing the name of the snapshot

fileNames

       - list of strings representing the files which will be included in the snapshot

 

       

       void createSnapshot(String projectName, String snapshotName, List<String> fileNames);

 

 

 

getUserLocalTimeZone

 

The method returns the local time zone of the current user.

 

 

       String getUserLocalTimeZone();

 

 

 

getProjectName

 

This method returns the name of the current project.

 

 

       String getProjectName();

 

 

 

getInstitutionName

 

This method returns the name of the current institution.

 

 

       String getInstitutionName();

 

 

 

getPath

 

This method returns the absolute path of the current project from the Ecrion Omni System repository.

 

 

       String getPath();

 

 

 

getFileDownloadLink

 

This method returns a download link for the specified file.

 

Parameters:

 

fileName

       - string representing the name of the file to be downloaded.

 

 

       String getFileDownloadLink(String fileName);

 

 

 

getFileProperties

 

This method returns a list of properties associated with a file, from the specified trunk.

 

Parameters:

 

trunk

       - represents the trunk where the file is stored. This parameter is of type RepositoryTrunk

fileName

       - string representing the name of the file to be downloaded.

 

 

       Dictionary<String, String> getFileProperties(RepositoryTrunk trunk, String fileName);

 

 

 

getFiles

 

This method returns a list of files from the repository associated with the current job, existent in the specified trunk. The method returns a list of files or an empty list if no files are found.

 

Parameters:

 

trunk

       - represents the trunk where the file is stored. This parameter is of type RepositoryTrunk

filePattern

       - a pattern in prefix_*_suffix.ext form. Use the empty string to return all files.

 

 

       String[] getFiles(RepositoryTrunk trunk, String filePattern);

 

 

 

getJobId

 

The method returns the ID of the current job.

 

 

       String getJobId();

 

 

 

getLogEvents

 

1. This method returns a list of LogEvent objects associated with the current job.

 

 

       List<LogEvent> getLogEvents();

       

 

 

 

2. This method returns a list of LogEvent objects associated with the current job filtered by message severity.

 

Parameters:

 

severity

       - represents the severity of the log messages. This parameter is of type Severity

 

       

       List<LogEvent> getLogEvents(Severity severity);

 

 

 

log

 

The log method writes a message in the Ecrion Omni System logger.

 

Parameters:

 

severity

       - represents the severity of the log messages. This parameter is of type Severity

message

       - string representing the message to be written into the log.

 

 

       void log(Severity severity, String message);

 

 

 

initDocumentTemplate

 

This method initializes the document template.

 

Parameters:

 

fileName

       - string representing the name of the template file.

parameters

       - defines workflow parameters for the current job

 

 

       void initDocumentTemplate(String fileName, WorkflowParameters parameters);

 

 

 

startReview

 

This method starts an approval review for a snapshot.

 

Parameters:

 

projectName

       - string representing the name of the project.

snapshotName

       - string representing the name of the snapshot.

comments

       - string representing comments.

 

 

       void startReview(String projectName, String snapshotName, String comments = null);

 

 

 

run

 

This method is used to run an Ecrion Omni System job.

 

Parameters:

 

fileName

       - the file name describing the job type.

parameters

       - defines workflow parameters for the current job

 

 

       JobOutputs run(String fileName, WorkflowParameters parameters);

 

 

 

readFile

 

This method opens a file and reads its contents in an array of bytes.

 

Parameters:

 

trunk

       - represents the trunk where the file is stored. This parameter is of type RepositoryTrunk

fileName

       - string representing the name of the file to be read

 

 

       byte[] readFile(RepositoryTrunk trunk, String fileName);

 

 

 

writeFile

 

1. This method writes a file in the specified Ecrion Omni System trunk.

 

Parameters:

 

trunk

       - represents the trunk where the file is stored. This parameter is of type RepositoryTrunk

fileName

       - string representing the name of the file to be written

bytes

       - a byte array representing the contents of the file.

properties

       - dictionary of strings defining properties

 

 

       void writeFile(RepositoryTrunk trunk, String fileName, byte[] bytes, Dictionary<String, String> properties);

       

 

 

 

2. This method writes a file in the specified Ecrion Omni System trunk and in the specified project.

 

Parameters:

 

trunk

       - represents the trunk where the file is stored. This parameter is of type RepositoryTrunk

projectName

       - string representing the name of the project where the file will be written

fileName

       - string representing the name of the file to be written

bytes

       - a byte array representing the contents of the file.

properties

       - dictionary of strings defining properties

 

       

       void writeFile(RepositoryTrunk trunk, String projectName, String fileName, byte[] bytes, Dictionary<String, String> properties);