There is no direct documentation or feature in InterSystems Package Manager (IPM) that specifically addresses handling System Default Settings for CI/CD pipelines. However, here are potential approaches based on available information:
-
System Default Settings: These settings simplify management of environment-specific configurations, such as file paths, port numbers, etc., and can be exported/imported using methods like
%Export
and%Import
. It is advisable to integrate these methods into your pipeline processes to automate these tasks [1][2]. -
Custom Automation: While not directly tied to IPM, you can use tools or scripts, such as the
GetSettingsFromProduction
method, to gather and setup System Default Settings efficiently during the deployment process. This method allows filtering specific settings and automating their migration to the system defaults table [3][4]. -
Source Control: System Default Settings can be exported and tracked in version control. Each branch or CI/CD environment can include specific setting files, which can then be applied programmatically during deployment [2].
If Invoke scripts are acceptable for your case or specific automation needs, they could wrap around these export/import or automation methods to ensure smooth integration without extending IPM itself. For completely eliminating custom solutions, consider submitting a feature enhancement request on InterSystems Developer Community.
Sources:
- To list a user and their properties, including roles, you can use ObjectScript commands with the
Security.Users
class in the%SYS
namespace. An example of listing the properties of a user is:
NEW $NAMESPACE
SET $NAMESPACE="%SYS"
SET status = ##class(Security.Users).Get("Username", .properties)
IF $$$ISOK(status) {
ZWRITE properties
}
This retrieves the user's properties into a reference variable and displays them [1][2].
- To add a user and set their properties, including roles, you can use the
Create
method of theSecurity.Users
class. For example:
NEW $NAMESPACE
SET $NAMESPACE="%SYS"
SET properties("FullName") = "New User"
SET properties("Password") = "securepassword"
SET properties("UserRoles") = "%Developer,%Operator"
SET status = ##class(Security.Users).Create("NewUser", .properties)
IF $$$ISOK(status) {
WRITE "User created successfully."
}
This creates a user with specified roles and other details [1][2].
- To set a user's password, you can use the
Modify
method to update the relevant property, as in:
NEW $NAMESPACE
SET $NAMESPACE="%SYS"
SET status = ##class(Security.Users).Get("Username", .properties)
IF $$$ISOK(status) {
SET properties("Password") = "newpassword"
SET status = ##class(Security.Users).Modify("Username", .properties)
IF $$$ISOK(status) {
WRITE "Password updated successfully."
}
}
This updates the user's password [1][2].
Sources:
To calculate the difference in hours (with decimals) between two
%TimeStamp
values in ObjectScript, you can use the$ZDATETIMEH
function to convert the timestamps into$HOROLOG
format, and then calculate the difference using appropriate arithmetic. Here is an example approach:Code Implementation
Explanation
$ZDATETIMEH(timestamp, precision)
converts a%TimeStamp
into$HOROLOG
format with theprecision
value 3 for best compatibility [1][2].$HOROLOG
format consists of two parts: the number of days since 31 Dec 1840 and the number of seconds since midnight of the current day.Example
Using your provided timestamps:
This approach ensures precision and clarity while working with timestamps in ObjectScript. [1][2]
Sources: