The IWorkflowContext interface contains methods which provide access to the execution engine and the repository.
Methods:
Name |
Description |
Method used to create a project snapshot. |
|
Returns the local time zone of the current user. |
|
Method which returns the name of the current project. |
|
Method which returns the name of the current institution. |
|
Returns the absolute path of the current project. |
|
Returns a download link for the specified file. |
|
Returns a list of properties associated with a file, from the specified trunk. |
|
Returns a list of files from the repository associated with the current job, existent in the specified trunk. |
|
Returns the ID of the current job. |
|
Returns a list of LogEvent objects associated with the current job. |
|
The log method writes a message in the Ecrion Omni System logger. |
|
The method initializes the document template. |
|
Method which starts an approval review for a snapshot. |
|
Method used to run an Ecrion Omni System job. |
|
The method opens a file and reads its contents in an array of bytes. |
|
The method writes a file to a specified Ecrion Omni System trunk and project. |
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);
The method returns the local time zone of the current user.
String getUserLocalTimeZone();
This method returns the name of the current project.
String getProjectName();
This method returns the name of the current institution.
String getInstitutionName();
This method returns the absolute path of the current project from the Ecrion Omni System repository.
String getPath();
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);
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);
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);
The method returns the ID of the current job.
String getJobId();
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);
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);
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);
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);
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);
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);
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);