This server-side class is necessary for using the version control system (VCS).
This method creates initial versions of all the records of the specified table.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
tableName | String | Y | N |
Return:
Type | Description |
---|
Boolean | This method returns TRUE if the snapshot was successful; otherwise, it returns FALSE. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | createTableSnapshot |
---|
linenumbers | true |
---|
|
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);
} |
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):
Name | Type | Mandatory | Default Value |
---|
sysVcsLocalPackId | Integer | Y | N |
Return:
Type | Description |
---|
Object | Returns a .SOP file for downloading. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | exportLocalPackVcsRecords |
---|
linenumbers | true |
---|
|
let vcsLocalPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
vcs.exportLocalPackVcsRecords(vcsRetrievedPackId) |
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):
Name | Type | Mandatory | Default Value |
---|
retrievedPackId | Integer | Y | N |
Return:
Type | Description |
---|
String | Returns string containing the import results. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | importRetrievedPack |
---|
linenumbers | true |
---|
|
let vcsRetrievedPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
let result = vcs.importRetrievedPack(vcsRetrievedPackId);
ss.addInfoMessage(result); |
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):
Name | Type | Mandatory | Default Value |
---|
localPackId | Integer | Y | N |
Return:
Type | Description |
---|
Boolean | The method returns TRUE if it finds current records; otherwise, it returns FALSE. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | isLocalPackHasReferences |
---|
linenumbers | true |
---|
|
let vcsLocalPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.isLocalPackHasReferences(vcsLocalPackId)) {
ss.addInfoMessage('Local Pack has current VCS records');
} |
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):
Name | Type | Mandatory | Default Value |
---|
retrievedPackId | Integer | Y | N |
Return:
Type | Description |
---|
Boolean | This method returns TRUE if there are any referenced records; otherwise, it returns FALSE. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | isRetrievedPackHasReferences |
---|
linenumbers | true |
---|
|
let vcsRetrievedPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.isRetrievedPackHasReferences(vcsRetrievedPackId)) {
ss.addInfoMessage('Retrieved Pack has current VCS records');
} |
This method checks the record from the sys_vcs_retrieved_pack table if it has an attached file.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
vcsRetrievedPackId | Integer | Y | N |
Return:
Type | Description |
---|
Boolean | This method returns TRUE if there are any attached files; otherwise, it returns FALSE. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | isRetrievedPackHasAttache |
---|
linenumbers | true |
---|
|
let vcsRetrievedPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.isRetrievedPackHasAttache(vcsRetrievedPackId)) {
ss.addInfoMessage('Retrieved Pack has attached file');
} |
This method implements merging miltiple localpacks into one. Herewith, initial localpack are being removed irrevocably.
Возвращает строку, содержащую идентификатор полученного слитого Локал Пака в случае успешной операции и Null в случае неуспеха.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
rowIds | Array | Y | N |
name | String | N | 'merged pack' |
description | String | N | 'merged pack description' |
Return:
Type | Description |
---|
String | Returns ID of the resulting merged localpack if successful; otherwise, returns NULL. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | mergeLocalPacks |
---|
linenumbers | true |
---|
|
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’)
|
This method provides the retrieved pack preview which can be also called "preimport". The pack must be in new or previewed state.Method description
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
retrievedPackId | Integer | Y | N |
Return:
Type | Description |
---|
String | Returns the preview results. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | previewLastAttachedRetrievedPack |
---|
linenumbers | true |
---|
|
let vcsRetrievedPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
let result = vcs.previewLastAttachedRetrievedPack(vcsRetrievedPackId);
ss.addInfoMessage(result); |
This method rollbacks a localpack. The localpack can be rollbacked only when it in the RollBack-Previewed state.Method description
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
packId | Integer | Y | N |
Return:
Type | Description |
---|
String | Returns TRUE if rollback was successful; otherwise; throws an exception. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | rollback |
---|
linenumbers | true |
---|
|
Method description |
let vcsLocalPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.rollBack(vcsLocalPackId)) {
ss.addInfoMessage('RollBack of Local Pack was successful');
} |
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
Return:Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
Return:
Type | Description |
---|
Boolean | Returns TRUE if the rollback preview was successful; otherwise, returns FALSE. |
Method description
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
Return:
Type | Description |
---|
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | rollBackPreview |
---|
linenumbers | true |
---|
|
let vcsLocalPackId = 156144163704236641;
let vcs = new SimpleVcsApi();
if (vcs.rollBackPreview(vcsLocalPackId)) {
ss.addInfoMessage('RollBack preview of Local Pack was successful');
} |