Timer Control

 <!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <title>Multi Timer</title>

  <style>

    * {

      box-sizing: border-box;

    }


    body {

      font-family: 'Segoe UI', sans-serif;

      padding: 40px 20px;

      background: linear-gradient(to right, #f8f9fd, #e2ecf7);

      color: #333;

      text-transform: uppercase;

    }


    h1 {

      text-align: center;

      margin-bottom: 40px;

      color: #2a2a2a;

      font-size: 2.5rem;

    }


    .input-container {

      display: flex;

      justify-content: center;

      flex-wrap: wrap;

      gap: 10px;

      margin-bottom: 30px;

    }


    .input-container input,

    .input-container button {

      padding: 10px 15px;

      border-radius: 8px;

      border: 1px solid #ccc;

      font-size: 16px;

    }


    .input-container button {

      background: #4b7bec;

      color: #fff;

      border: none;

      cursor: pointer;

      transition: background 0.3s;

    }


    .input-container button:hover {

      background: #3867d6;

    }


    #timersContainer {

      display: flex;

      flex-direction: column;

      gap: 20px;

      align-items: center;

    }


    .timer {

      width: 90%;

      max-width: 500px;

      background: rgba(255, 255, 255, 0.7);

      backdrop-filter: blur(8px);

      border-radius: 15px;

      box-shadow: 0 8px 16px rgba(0,0,0,0.1);

      padding: 15px 20px 20px;

      position: relative;

      transition: transform 0.2s;

    }


    .timer:hover {

      transform: scale(1.01);

    }


    .close-icon {

      position: absolute;

      top: 10px;

      right: 12px;

      font-size: 18px;

      font-weight: bold;

      color: #d33;

      cursor: pointer;

      background: transparent;

      border: none;

    }


    .timer-row {

      display: flex;

      justify-content: space-between;

      align-items: center;

      background: linear-gradient(to right, #e6ffe6, #b3ffb3);

      border-radius: 8px;

      padding: 12px 16px;

      font-weight: bold;

      font-size: 20px;

      color: #333;

      margin-bottom: 15px;

      box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);

    }


    .timer-controls {

      display: flex;

      justify-content: center;

      gap: 10px;

    }


    .timer-controls button {

      padding: 7px 12px;

      font-size: 14px;

      border: none;

      border-radius: 6px;

      background-color: #4b7bec;

      color: white;

      cursor: pointer;

      transition: background 0.3s;

    }


    .timer-controls button:hover {

      background-color: #3867d6;

    }

  </style>

</head>

<body>

  <h1>Multi Countdown Timers</h1>


  <div class="input-container">

    <input type="text" id="timerName" placeholder="Timer Name">

    <input type="number" id="minutes" placeholder="Min" min="0">

    <input type="number" id="seconds" placeholder="Sec" min="0" max="59">

    <button onclick="addTimer()">Add Timer</button>

  </div>


  <div id="timersContainer"></div>


  <script>

    let timerId = 0;

    const timers = {};


    function formatTime(seconds) {

      const mins = String(Math.floor(seconds / 60)).padStart(2, '0');

      const secs = String(seconds % 60).padStart(2, '0');

      return `${mins}:${secs}`;

    }


    function updateDisplay(id) {

      document.getElementById(`display-${id}`).textContent = formatTime(timers[id].timeLeft);

    }


    function addTimer() {

      const name = document.getElementById('timerName').value || 'Timer';

      const minutes = parseInt(document.getElementById('minutes').value) || 0;

      const seconds = parseInt(document.getElementById('seconds').value) || 0;

      const totalSeconds = minutes * 60 + seconds;


      if (totalSeconds <= 0) {

        alert("Please enter a valid time.");

        return;

      }


      const timerDiv = document.createElement('div');

      timerDiv.className = 'timer';

      timerDiv.id = `timer-${timerId}`;


      timerDiv.innerHTML = `

        <button class="close-icon" onclick="deleteTimer(${timerId})">&times;</button>

        <div class="timer-row">

          <span class="timer-name">${name}</span>

          <span id="display-${timerId}">${formatTime(totalSeconds)}</span>

        </div>

        <div class="timer-controls">

          <button onclick="startTimer(${timerId})">Start</button>

          <button onclick="pauseTimer(${timerId})">Pause</button>

          <button onclick="resetTimer(${timerId})">Reset</button>

        </div>

      `;


      document.getElementById('timersContainer').appendChild(timerDiv);


      timers[timerId] = {

        timeLeft: totalSeconds,

        initialTime: totalSeconds,

        interval: null

      };


      timerId++;

    }


    function startTimer(id) {

      if (timers[id].interval) return;


      timers[id].interval = setInterval(() => {

        if (timers[id].timeLeft > 0) {

          timers[id].timeLeft--;

          updateDisplay(id);

        } else {

          clearInterval(timers[id].interval);

          timers[id].interval = null;

          alert(`"${document.querySelector(`#timer-${id} .timer-name`).textContent}" is done!`);

        }

      }, 1000);

    }


    function pauseTimer(id) {

      clearInterval(timers[id].interval);

      timers[id].interval = null;

    }


    function resetTimer(id) {

      pauseTimer(id);

      timers[id].timeLeft = timers[id].initialTime;

      updateDisplay(id);

    }


    function deleteTimer(id) {

      pauseTimer(id);

      const timerDiv = document.getElementById(`timer-${id}`);

      if (timerDiv) timerDiv.remove();

      delete timers[id];

    }

  </script>

</body>

</html>


Pending Constellation

 

  1. Flexible UI with Constellation - https://community.pega.com/blog/flexible-ui-constellation - Kamil Janeczek
  2. Prescribed and flexible UI with Constellation - https://community.pega.com/blog/prescribed-and-flexible-ui-constellation - Kamil Janeczek
  3. How Constellation works - from authoring to rendering - https://community.pega.com/blog/how-constellation-works-authoring-rendering - Piotr Jurkowski

Constellation hands on L4

 

Constellation Building Blocks

Constellation Architecture is made of several building blocks, which work together in harmony to help you crush complexity.

Client device

In traditional Pega UI, server does both the business logic and generating all of the UI markup
But in constellation , user browsers and devices to do the heavy lifting, by utilizing the Constellation orchestration layer.

the client device plays active and vital role, acting as the layer -This includes transforming JSON metadata into HTML code

server load is minimized, creating an even faster and more responsive user experience

Infinity server and DX API

In the Constellation architecture, the Pega Infinity Server acted as a brain holding the business rules, logic, and data, while the orchestration and presentation were handled by the user's device.

Communication between both sides is covered by the use of DX API [case data + UI metadata]

Constellation UI services

 UI-related tasks are separated into two separate services
App-static - a client application-specific UI static content delivery service
UI assets (images, custom components, localizations) authored by clients are application-specific
cloud-based multitenant service or as a deployable service known as the App-Static service
must be safely stored and protected

requires authentication for all APIs (for both read and write). Reading or writing of customer-generated content is covered by the signed token

PEGA CDNConstellation Pega UI static content
JavaScripts generated by Pega and that are part of Pega Platform
The same service for all clients
can be made publicly available for quick access
read-only and does not require authorization

Messaging Service

the Messaging Service, which realizes a server-to-client push architectural component of Constellation

components-to-topics subscriptions made through the WebSocket connection

Infinity publishes data --> Message Broker through an HTTP REST connection.
The Message Broker then pushes --> browsers that registered

for example, charts that update in real-time, or a bell icon with a badge

Greater than the sum of its parts

The orchestration layer, the Infinity server, and the robust Messaging Service collectively deliver a faster, more responsive, and highly scalable user experience

Constellation hands-on L3

 Learings from Characteristics of Constellation Architecture

The Constellation UI employs a Center-out™ approach. It is API-first, built on a model-view-controller (MVC) architectural framework and interacts with users through a prescribed UI in a stateless manner.

 Model-view-controller (MVC)




  • The model is responsible for modeling data and business logic.
  • The view manages the presentation layer and user interactions.
  • The controller is the connection between the model and the view, and handles user inputs which it translates into appropriate actions in the model.

model - Pega Platform and its data, business logic, and workflow
view - Constellation design system front-end User Experience
controller -architecture orchestration layer is the Controller which conencts model to channel using API - Digital Experience (DX) API.


Microservices

Designing software applications as a collection of small, self-contained, and autonomous services

 The design of each service is small and responsible for a single specific end-to-end business function . They operate independently of each other and through well-defined interfaces

limits the impact of changes in one service on the overall system.
each service can be scaled individually based on demand

Stateless architecture

Each interaction (request) between client and server occurs as a separate transaction
Server does not maintain any state information about the previous interactions

Constellation architecture shifts towards stateless architecture, which results in ending requestor sessions and releasing the Pega Clipboard after each DX API call.

Client orchestration
generation of the UI and orchestration of UI components from the server to the client side

All the modules responsible for generating UI and orchestrating actions are in client and communicates with the server only to exchange information

User interface rendering are carried out fully on the client device by the Constellation design system

Prescribed UI

Ensures consistency across different parts of an application, or multiple applications within the same ecosystem.

all of the elements are built from the same library of prescribed components

Modular architecture

Designing software around smaller, reusable modules - each module houses a specific functionality and provides an interface to interact with it

Pega Infinity fully supports a modern, modular approach to application building, which enables the grouping of collections of Rules that address specific purposes into reusable modules.

Center-out

focuses on delivering customer and business outcomes by defining Microjourneys® to reach those outcomes

API-first

Designing applications prioritizes designing and building an API before working on any other aspects of the application (such as user interface or backend components).

Pega Constellation applies DX APIs to provide a standardized way of interacting with Pega Platform through a set of model-driven APIs.

Constellation hands-on L2

 Why Constellation - two giant leaps at the same time

To make Constellation work, two revolutionary changes needed to occur: one was technological, and the other shifted the paradigm of how applications should be created.



 

New underlying technology

 we spend more time online than ever before -  We expect a seamless experience, intuitive interfaces, and answers available at our fingertips.

The landscape of available technologies changes rapidly, the need to scale (v or h) is growing, and the old approach of monolithic systems does not cut it anymore.

Client-side orchestration and stateless API allowed Pega to move to single-page application architecture and achieve some staggering improvement in performance:

  • 3x faster interactions  
  • 7x smaller network payload  
  • 10x faster initial server response time  
  • 30% fewer requests on the first load
It allows to embed Pega workflows into the customer’s ecosystem, which gives  consistent experience both from the perspective of branding and across channels using Pega prescriptive authoring approach.

A new paradigm of building applications

Pega prescriptive authoring approach promotes configuration over customization
This way, app creators can focus on creating the best processes and workflow automation, and the design system handles how to display the content to the user across channels.

this approach opens the way to simple upgrades where developers upgrade pega without the risk bugs or reworks.

As a result, businesses can use any new emerging technologies and react quickly to new challenges of the ever-changing digital world.



Constellation hands-on L1

 Learnings from Constellation Architecture

https://community.pega.com/blog/introduction-constellation-architecture


Introduction to Constellation architecture 

Pega Constellation is a true center-out way of creating software

UI architecture 

Constellation UI architecture shifts the way of how you deliver an experience to your users.

With the new client-side engine, orchestration of views is done in the browser itself.

the Infinity server no longer has to send big sets of data to the user's device – instead, it can limit the payload to small, data-driven packets. 

Constellation metrics show as much as a 7x smaller network payload and 3x faster interactions

Required - well defined granular API (necessary to enable the frontend engine to communicate flawlessly with backend services)

Front end developers - extend by introducing custom components and own corporate design systems. 
Even enables web developers to just use the Pega API alone, and add any web-standard frontend (React, Angular, etc.)

web-standard frontend - HTML, CSS, and JavaScript are front-end (or client-side) languages, which means they are run by the browser to produce a website front-end


New UX and low-code authoring experience

a data-driven and API-driven approach, and with client-side orchestration -  authoring approach allows for decoupling of the presentation layer and the business logic

By using App Studio, experienced System Architects to work hand-in-hand with Citizen Developers and Business Stakeholders to create business processes, without the need to customize the presentation layer.


 The benefits :

  • End-users receive consistent experience across different processes and applications
  • Case Type design is focused on business logic
  • The application are configured (not customized), allowing for upgrades, easier adoption of new features, and an as-a-service approach. 
the web developers and System Architects can create custom components that deliver project-specific requirements

Constellation design system

developers and stakeholders to focus on delivering business value to end users
it ensures that the experience is consistent across different channels and business areas
the delivery process is efficient and not bogged down around the presentation layer

True Center-out architecture

The Center-out concept puts the business value and customer journeys forward
Pega Platform enables clients to start with business needs and processes from the very beginning.

For example, when you want to add a mobile app as an alternative to a web portal, or when you need to expand to a new country, add country-specific requirements to Cases, and create localized language versions. 

With Pega Constellation, a true Center-out approach is made possible - create business-specific user journeys (userstory) that can be expanded more quickly in the future


Constellation UX – benefits (Speed , Power , Value)

businesses will derive more value from their investment - businesses will derive more value from their investment 

app builders and citizen developers will avoid designing and developing elements such as button colors, section rules, and screen layouts

IT departments will experience significantly improved performance and easier upgrades


Tracer Activity in Logs

To print the steps of activity in logs we can add the logger of the activity to print all the steps Go to activity , open the XML with the Actions Search for Log Helper Copy the line with .action and paste in the loggers for 2 hours with ALL.

XSD Property generation in Pega

This Post will shows how to generate the Property , classes and XML mapping rules in pega with Provided XSD 

Check the provided XSD and see if the format is correct 
 -> you can open the xsd in internet browser 

Now create a ruleset and ruleset version for the rules to be created 

For example Org-Int-policy and 01-01-01

 Now import the XSD to Pega using wizard

Provide the details as screenshot and go to next screen



Import the XSD Here 



Select the element name and select the rule to be created , in my case it all





Now check the list of rules to be created and finish for the rules to be created 



After finish , the rules are created and you will have a option to clean up at the last to delete everything