B2Win Suite Documentation (Under Construction)
ContactB2Data
5.2
5.2
  • 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
        • Condition Node
      • In DataPrep
      • Properties
      • Workflow Applications
        • Workflow #1
        • Workflow #2
    • Getting Started
    • Language Basics
    • Data Types and Data Structures
      • Primitive Data Types
      • Data Structures
      • SuiteTable
      • Row, Column, StringColumn
    • Non-static Classes
      • Instant Class
      • LocalDateTime
      • LocalDate
      • LocalTime
      • JsonNode Class
      • File Class
    • Static Classes
      • Duration Class
      • Math Class
      • StrictMath Class
      • InstantUtil
      • NumericUtil
      • GeneralDateUtil
      • LocalDateTimeUtil
      • LocalDateUtil
      • LocalTimeUtil
      • DbUtil
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
    • Property Class
    • Context and System
      • Context Class
      • System Class
    • Logging and Configuration
      • Logging
      • Configuration
    • Tutorial
    • Feedback
Powered by GitBook
On this page

Was this helpful?

  1. Scripting
  2. Static Classes

RandomUtil

RandomUtil class is used to generate pseudo-random numbers in java. An instance of this class is thread-safe. The instance of this class is however cryptographically insecure. This class provides various method calls to generate different random data types such as float, double, int.

/**
 * Write your code here
 * For example a random condition that returns true or false and output them to a different output port
 */
var random = RandomUtil.create(); // create a Random instance
return random.nextBoolean(); // return random boolean (true/false)
return random.nextInt(); // return random Integer
return random.nextDouble(); // return random Double
return random.nextLong();
return random.nextFloat();
return random.nextGaussian();
  • nextGaussian();

Returns the next pseudorandom Gaussian distributed double number with mean 0.0 and standard deviation 1.0.

  • nextInt();

Returns the next Integer number.

  • nextDouble();

Returns the next double number.

  • nextBoolean();

Returns the next Boolean value.

  • nextLong();

Returns the next Long number

PreviousNodeInputReaderNextProperty Class

Was this helpful?