B2Win Suite Documentation (Under Construction)
ContactB2Data
5.6
5.6
  • B2Win Suite Documentation
  • Scripting
    • B2Win Suite Scripting Overview
    • Scripting in B2Data
      • Custom Script Nodes
        • Custom Script
        • Source Script Node (File)
        • Source Script Node (Table)
        • Source Script Node (Object)
        • If-Else Condition
        • Switch case
        • Condition Node
      • In DataPrep
      • Properties
      • Workflow Applications
        • Workflow #1
        • Workflow #2
    • Getting Started
    • Language Basics
    • Types & Objects
      • Primitives
      • Objects
        • Instant
        • LocalDateTime
        • LocalDate
        • LocalTime
        • JsonNode
        • ObjectNode
        • File
        • SuiteTable
        • Duration
        • Period
      • Arrays & Maps
      • Row, Column, StringColumn
    • Utilities
      • Date & Time
        • InstantUtil
        • GeneralDateUtil
        • LocalDateTimeUtil
        • LocalDateUtil
        • LocalTimeUtil
        • Formatting
        • Timezones
      • Math
      • StrictMath
      • NumericUtil
      • DbUtil
      • DbExecutor
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
      • HashingUtil
      • ShellUtil
      • CompressionUtil
      • Logging
    • Properties
    • Context and System
      • Context
      • System
    • Configurations
      • Workflow Configuration
    • Tutorial
    • Feedback
  • B2Data
    • Tutorials
      • Infor DataFabric to On-Premise Database Replication
      • API (DB replication, Email)
    • Workflow Settings
      • General Settings
      • Global/All Properties
      • Execution Configuration
        • General
        • Runtime
        • Compiler
        • Storage
        • Clean Up
      • Permissions
    • Nodes
      • Scheduler
    • Services Configuration
      • Microsoft Graph
Powered by GitBook
On this page

Was this helpful?

  1. Scripting
  2. Context and System

System

Learn to interact with system-related information.

The System class provides methods for interacting with system-related information. Such as current time, system environment, system user, path, etc.

Methods

currentTimeMillis():

Returns the current time in milliseconds as a number.

// Example: Get current time in milliseconds
var currentTimeMillis = System.currentTimeMillis();
return "Current time in milliseconds: " + currentTimeMillis;

nanoTime():

Returns the current value of the system's high-resolution time source in nanoseconds as a number.

// Example 1: Get current time in nanoseconds
var nanoseconds = System.nanoTime();
return "Current time in nanoseconds: " + nanoseconds;

lineSeparator():

Returns the platform-specific line separator as a string.

// Example: Get the system-dependent line separator
var lineSeparator = System.lineSeparator();

getenv():

Returns the system environment as a string.

// Get the system user
var username = System.getenv("USERNAME");

// Get the system path
varpath = System.getenv("PATH");

Additional environment variables accessible through getenv() include:

  • "USERPROFILE": Path to the current user's profile directory.

  • "TEMP" and "TMP": Paths to the temporary directory.

  • "USERNAME": The username of the currently logged-in user.

  • "COMPUTERNAME": Name of the computer.

  • "OS": Information about the operating system.

  • "SYSTEMROOT" or "WINDIR": Paths to the Windows system directory.

  • "APPDATA": Path to the directory where application-specific data for the current user is stored.

PreviousContextNextConfigurations

Was this helpful?