You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

This server-side class is necessary for using the version control system (VCS).


createTableSnapshot(tableName)


This method creates initial versions of all the records of the specified table.


Parameter(s):

NameTypeMandatoryDefault Value
tableNameStringYN


Return:

TypeDescription
BooleanThis method returns TRUE if the snapshot was successful; otherwise, it returns FALSE.


Example:

createTableSnapshot
let tableName = ‘Incident’;
let vcs = new SimpleVcsApi();
let snapshotState = vcs.createTableSnapshot(tableName);
if (snapshotState) {
	ss.info(‘Success’)
} else {
	ss.info(‘Houston we have a problem with creating snapshot);
}

exportLocalPackVcsRecords(sysVcsLocalPackId)


This method performs VCS records export that were bound to the localpack with the unique ID $sysVcsLocalPackId as a .SOP file. This pack must be in the Completed state.


Parameter(s):

NameTypeMandatoryDefault Value
sysVcsLocalPackIdIntegerYN


Return:

TypeDescription
ObjectReturns a .SOP file for downloading.


Example:

exportLocalPackVcsRecords
let vcsLocalPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
vcs.exportLocalPackVcsRecords(vcsRetrievedPackId)

importRetrievedPack(retrievedPackId)


This method imports the last containing in the VCS preview log (sys_vcs_preview_log)table previewed retrieved pack to the VCS Record (sys_vcs_record) table.


Parameter(s):

NameTypeMandatoryDefault Value
retrievedPackIdIntegerYN


Return:

TypeDescription
StringReturns string containing the import results.


Example:

importRetrievedPack
let vcsRetrievedPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
let result = vcs.importRetrievedPack(vcsRetrievedPackId);
ss.addInfoMessage(result);

isLocalPackHasReferences(localPackId)


This method checks the record from the sys_vcs_local_pack table if it has referenced current* records from the sys_vcs_record table.

*the current records have the isCurrent attribute is TRUE.


Parameter(s):

NameTypeMandatoryDefault Value
localPackIdIntegerYN


Return:

TypeDescription
BooleanThe method returns TRUE if it finds current records; otherwise, it returns FALSE.


Example:

isLocalPackHasReferences
let vcsLocalPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.isLocalPackHasReferences(vcsLocalPackId)) {
  ss.addInfoMessage('Local Pack has current VCS records');
}

isRetrievedPackHasReferences(retrievedPackId)


This method checks the record from the sys_vcs_retrieved_pack table if it has referenced records from the sys_vcs_record table.


Parameter(s):

NameTypeMandatoryDefault Value
retrievedPackIdIntegerYN


Return:

TypeDescription
BooleanThis method returns TRUE if there are any referenced records; otherwise, it returns FALSE.


Example:

isRetrievedPackHasReferences
let vcsRetrievedPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.isRetrievedPackHasReferences(vcsRetrievedPackId)) {
ss.addInfoMessage('Retrieved Pack has current VCS records');
}

isRetrievedPackHasAttache(vcsRetrievedPackId)


This method checks the record from the sys_vcs_retrieved_pack table if it has an attached file.


Parameter(s):

NameTypeMandatoryDefault Value
vcsRetrievedPackIdIntegerYN


Return:

TypeDescription
BooleanThis method returns TRUE if there are any attached files; otherwise, it returns FALSE.


Example:

isRetrievedPackHasAttache
let vcsRetrievedPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.isRetrievedPackHasAttache(vcsRetrievedPackId)) {
  ss.addInfoMessage('Retrieved Pack has attached file');
}

mergeLocalPacks(rowIds, name, description)


This method implements merging miltiple localpacks into one. Herewith, initial localpack are being removed irrevocably.

Возвращает строку, содержащую идентификатор полученного слитого Локал Пака в случае успешной операции и Null в случае неуспеха.


Parameter(s):

NameTypeMandatoryDefault Value
rowIdsArrayYN
nameStringN'merged pack'
descriptionStringN'merged pack description'


Return:

TypeDescription
StringReturns ID of the resulting merged localpack if successful; otherwise, returns NULL.


Example:

mergeLocalPacks
let packIds = [
156144163704236641,
156144163704236642,
156144163704236643
];
let mergedName = ‘Merged Pack 1’;
let mergedDesc = ‘Merged Pack description 1’;
let vcs = new SimpleVcsApi();
let mergedId = vcs.mergeLocalPacks(vcsRetrievedPackId);
if (mergedId != null) {
	ss.info(‘Merged Local Pack has Id ’ + mergedId)
} else {
	ss.info(‘Houston we have a problem with merging Packs’)

Method description


Parameter(s):

NameTypeMandatoryDefault Value





Return:

TypeDescription



Example:


Method description


Parameter(s):

NameTypeMandatoryDefault Value





Return:

TypeDescription



Example:


Method description


Parameter(s):

NameTypeMandatoryDefault Value





Return:

TypeDescription



Example:


Method description


Parameter(s):

NameTypeMandatoryDefault Value





Return:

TypeDescription



Example:


  • No labels