User Guide
  • Introduction
  • Overview
    • About 4WS.Platform
      • Architecture
      • Enterprise Edition
      • Tech specs and requirements
      • Warp SDK
    • Creating a web application
  • Core features
    • Tables
    • SqlTool
    • Definition of Data models and Relations
      • Relations
      • Reverse Engineering
      • Custom Fields
    • Defining business components
      • What are business components
      • Business components to fill-in panels
      • Creating business components
        • By a datastore entity
        • By a MongoDB collection
      • Defining Custom Java Business component
    • Defining the UI
      • App Designer
        • App Designer Menu
        • Definition of additional data sources
        • Panel containers and layouts
          • Tab panel
          • Alternative panel
          • Accordion panel
          • Vertical orientation panel
          • Horizontal orientation panel
          • Columns panel
          • Table panel
          • Generic panel
          • Responsive panel
        • Window content
          • Grid Panel
          • Form Panel
          • Filter Panel
          • Tree Panel
          • Google Map Panel
          • Preview Panel (old Image panel)
          • Tree + Grid Panel
          • Image Gallery
        • Windows list
        • Panel definition
          • Columns properties
          • Controls properties
          • Filter properties
          • Supported components
        • Variables
        • Code selectors
          • When not to use a dynamic combo-box
        • Smart Filter and Advanced Filter
        • Multi Value Combobox Filter
        • Multi Value Tree Filter
        • Buttons
        • Translations
          • Translations about GUI components and internationalization settings
          • Data coming from database
          • Custom code and translations
        • Application Menu
        • Bulk import binded to a grid
        • Range Date Filter
      • Web Interpreter
        • Grid components
        • Detail forms
        • Other components
        • Other features
          • Chat
        • Global variables
          • Client-side global variables
          • Server global variables
        • Forgot Password
    • Working with users and roles
      • Rule for roles
      • Permissions Administrator
    • Wizard
      • How to add a checkbox grid to select one or more rows
      • How to load a second grid when clicking on a row from the first grid
      • How to load a form when clicking on a row of the grid
      • How to open a window when double clicking on a row of the grid
      • How to open a window with right click on the popup menu
      • How to open a window when pressing a button on the grid toolbar
      • How to load a grid after loading a form
      • How to open a window when pressing a button on the form toolbar
      • How to load a grid when clicking on a tree node
      • How to load a form when clicking on a tree node
    • Defining events
      • Panel events
      • Column events
      • Control events
      • Filter events
      • Timer events
      • Start-End event
    • Server-side Javascript & Web Service
      • Server-side Javascript
      • Grid component filled by a server-side JS
      • Detail component filled by a server-side JS
      • How to define a server-side JavaScript action
      • Web service
  • Setting up the environment
    • How to install
    • Application parameters
    • Global parameters
  • Modules
    • Reports & Charts
      • Jasper Report + iReport
      • Online report
      • Docx templating
      • Charts
      • Pivot Grid
      • Multidimensional pivot grid
      • Data Export from SQL query
    • SSO
      • Identity management in Platform
        • Identity management on the internal Platform database
        • Identity management based on Google SSO
      • LDAP
        • LDAP support
        • Identity management based on LDAP and database
        • Identity management based on an embedded LDAP server used by Alfresco and or Activiti
        • Identity management based on a remote LDAP server to connect to Platform on the cloud
        • Connecting an LDAP server to Activiti BPM
        • Connecting an LDAP server to Alfresco ECM
      • Google SSO
        • Google SSO
        • Google OAuth2
        • Identity management based on Google SSO
      • Custom SSO
      • Firebase
    • Mobile
      • Mobile introduction
      • Offline vs Online
        • Server side features
        • Server side functionalities
        • Server side Platform features
        • Mobile app features
      • Mobile side specifics
        • Customizations
          • Custom theme editor
        • App Menu
        • Window content
          • Detail scrollable form
          • Scrollable paginated grid
          • Constraint layout
          • Constraint panel
          • Collection grid view
          • Preview panel (mobile)
        • Form Controls
      • Reference guide
      • Cleaning up data
      • How to
      • App deployment
        • App deployment for the iOS platform
        • App deployment for the Android platform
      • Style properties
      • Appendix : Synchronization flow
      • Translations
    • GSuite
      • Introduction
      • Client-side integration
      • GMail
      • Calendar
      • Drive
      • Contacts
    • Google Cloud Platform
      • Datastore
        • Google Datastore Introduction
        • How to create Datastore entities
      • Google Cloud Storage
    • Scheduler
      • Scheduler Introduction
      • Process settings
        • How to define a sequence of consecutive processes
        • How to define a Custom Java Business component
        • How to define a Grid Data Import
        • How to define a server-side Javascript action
      • Email notifications
      • Process executions
      • Manually start a scheduled process
      • Process input parameters
    • Queue Manager
    • Log & Analysis
      • Application Log
      • Log statistics
      • App analyzer
      • Table log
      • Threads
      • Sessions and heap memory
      • Heap memory analysis
      • Access Log
      • Datastore statistics
      • Total monthly costs with Google Datastore
      • Service Monitoring
        • Introduction
        • Defining a service to monitor
        • Notifications setup
        • Events automatically managed by Platform
        • Remote Platform servers
        • Knowledge base
        • Adding log programatically
        • Searching for logged data
        • Use cases
    • File Management
    • Export and Import of Metadata
      • Application Metadata Management
    • Trigger writing operations
    • Audit
    • BPM
      • BPMN Introduction
      • BPMN main parts
      • Activiti Setup
      • Platform integration
        • Processes
        • Models
        • Process instances
        • To-do list
        • Process history
      • Process Web Modeler
        • Model Creation
          • Start-End Event
          • Gateways
        • Supported objects
        • Start tasks and user tasks
        • Form properties
          • Important notes
          • Property types
        • Service tasks
          • Web service
          • SQL Query
          • SQL statement
        • Mail task
        • Script task
          • Example : how to get a value previously read from a SQL query
          • Example : how to get the current process instance id
        • Timer events
        • Subprocess and Call Activiti
      • Utility methods available in Platform
        • How to start a process from a JavaScript action
        • How to complete a user task from a JavaScript action
      • An example
        • Processes
        • Instances
        • Activities
        • History
    • Embedded CMS
    • ECM
      • Alfresco
        • Alfresco Introduction
        • Integration between 4WS.Platform and Alfresco
          • Integration at GUI level
          • Integration at model level
          • Integration at authentication and authorizations level
          • Additional features
        • How to use 4WS.Platform and Alfresco together
          • Set the same Identity Management system
          • Define document types and aspects in Alfresco
          • Import the document types and aspects definitions in 4WS.Platform
          • Define document types and aspects in 4WS.Platform
          • Reverse engineering of document types or aspects
          • Definition of business components to fill-in panels
          • Definition of the GUI
          • Additional server-side services
        • Requirements
        • Current limits in 4WS.Platform - Alfresco integration
      • Archiflow
        • Setup
        • Archiflow artifacts
        • How to
    • Lotus Notes Migration Tool
    • NoSQL databases
      • MongoDB
        • MongoDB Introduction
        • Setting up the environment
        • How to create collections
        • How to create business components
        • How to create windows filled with data coming from MongoDB collections
        • Design rules
      • Google Datastore
        • Google Datastore Introduction
        • Setting up the environment
        • How to create entities
        • How to create business components
        • How to create windows filled with data coming from Datastore entities
        • Design rules
    • TensorFlow
    • Web Page Development
      • Pure Web Page Development
      • Google Material Design development
      • Appendix A - a complete example without any lib
      • Appendix B - a complete example with Google MD
    • Jira Integration
    • Platform for GAE
    • SQL errors management
    • Multidimensional pivot grid
    • Quality
      • Automated Web Service Testing
      • Automated unit testing
      • Source code static analysis using ESlint
      • Source code static analysis using SonarQube
  • Troubleshootings
  • Best practises
    • Database design
    • Database maintenance
    • Creating a Web app : common use cases
    • Creating a mobile app : common use cases
Powered by GitBook
On this page

Was this helpful?

  1. Modules

Queue Manager

In a complex Enterprise Application there could be many processes under execution on the server-side, each one could consume a significant amount of CPU and memory and could last a while.

Moreover, sometimes it could be dangerous to execute simultaneously processes working on the same set of data, because they could create locks which blocks the execution of these processes and even lead to a dead lock.

A typical solution to all these issues is the same: queues.

A queue is a special persistent storage where a sequence of processes to execute are enqueued and performed one at a time, starting from the first insert till the last one (FIFO policy…)

Platform allows you to define any number of queues.

When you want to include a process in a queue, you have simply to specify the queue name and, optionally, a priority.

The priority is a number you can use to move a process before another. If you use it, you are not any more using a FIFO queue, but a priority based queue.

Optionally, you can also define a waiting time: a time, expressed in milliseconds that the process has to way before being executed.

Processes managed by queues can be:

  • server-side javascript actions

  • web services to invoke

  • shell commands to execute

According to the process type, Platform provides 3 different methods.The only way to work with queues is to define server-side javascript actions.

These are the signatures for these 3 methods:

1. Enqueuing server-side js actions

var ok = utils.enqueueAction(queueName, actionId, params, priority, processWaitTime, logExecution);

The arguments are:

  • queueName – optional: queue name; if not specified, the process will be enqueued in the DEFAULT queue

  • actionId – server-side javascript action identifier to execute

  • param – javascript object containing parameters to pass to the action

  • priority – optional; if specified, processes within the same queue will be sorted according to the priority rathe than to the enqueuing time

  • processWaitTime – optional; if specified, the process will not be started before that time, expressed in seconds

  • logExecution – true to log in the predefined table LOG60_LOGS the execution of the process

Note: the javascript object specified through the "param" can accept an optional attribute named "queueTimeout": when the action execution time overpasses that value, (expressed in minutes), the element is marked as "timeout" in the queue and the queue is then unlocked, in order to allow extracting new elements from it. Note that the current action is still under execution and this could create drawbacks in case of actions which should be executed sequentially, since the work on the same set of data,by writing them.

2. Adding a web service invocation as a process to a specific queue.

var queueId = utils.enqueueWebService(queueName, url, params, priority, processWaitTime, logExecution);

The required arguments are:

  • queueName – optional: queue name; if not specified, the process will be enqueued in the DEFAULT queue

  • url – shell command to execute

  • param – js object containing parameters to pass to the web service

  • priority – optional; if specified, processes within the same queue will be sorted according to the priority rathe than to the enqueing time

  • processWaitTime – optional; if specified, the process will not be started before that time, expressed in seconds

  • logExecution – true to log in LOG60_LOGS the execution of the process

3. Adding a shell command as a process to a specific queue.

var queueId = utils.enqueueShellCommand(queueName, cmd, priority, processWaitTime, logExecution);

The required arguments are:

  • queueName – optional: queue name; if not specified, the process will be enqueued in the DEFAULT queue

  • cmd – shell command to execute

  • priority – optional; if specified, processes within the same queue will be sorted according to the priority rathe than to the enqueing time

  • processWaitTime – optional; if specified, the process will not be started before that time, expressed in seconds

  • logExecution – true to log in LOG60_LOGS the execution of the process

It is likely to use one queue only: using multiple queues can be risky in case of parallelizing process executions, since they could create locks if working on the same set of tables, so you have to carefully think about the need for multiple queues!

The App Designer also provides an administration console where all enqued processes are reported, as well as the processes under execution.

As soon as a process under execution terminates, it is removed from that console and the queue, and there will not be any trace about it.

You can access to that console through: Administration -> Process Queues

Here you can find the list of all processes, their process name, type, priority, current status.

This console also provides buttons to force the termination of a process: when pressing that button, the process is removed from the queue, but it is still running. There is no way to terminate it.

The “Force Start” button is used to force the execution of the selected process in the list: independently of the position of that process in the queue, it will start immediately.

Pay attention to this operation: locks could be created in the database if the process forced to start is working on the same set of data the other processes are using.

It is also possible to force termination and starting of waiting processes also from javascript.

PreviousProcess input parametersNextLog & Analysis

Last updated 5 years ago

Was this helpful?