A collection of standalone operational scripts for Netgrif deployments (databases, infrastructure, etc.). Scripts are grouped by target system in top-level directories and are meant to be run directly against that system — there is no build system, package manager, or shared runtime tying them together.
-
calculate-usage.js— Reads a deployment'seventLog/eventLogscollection and reports how many workflow events of interest (task finishes, case creations, data set events) occurred over time. Counts are broken down by event type and by calendar month, and printed as CSV.Run it with
mongosh(or the legacymongoshell) and redirect stdout to a file:mongosh "<connection string>" mongodb/calculate-usage.js > usage.csv # or, on older deployments: mongo "<connection string>" mongodb/calculate-usage.js > usage.csv
Compatible with MongoDB 3.6 through the latest server versions. On MongoDB 4.2+ it counts server-side via an aggregation pipeline for performance on very large collections, and automatically falls back to a client-side cursor loop on older servers. Configuration (database name, collection candidates, event class names, batch size, execution strategy, read preference) is controlled via the
CONFIGobject at the top of the script.
-
nae-reindex-all.sh— Reindexes Elasticsearch data for every process (Petri net) deployed on a NAE (Netgrif Application Engine) instance. It fetches the list of all process identifiers from/api/petrinetand triggers/api/elastic/reindexfor each one in turn.Run interactively (prompts for the NAE address, login, and password, each with a default):
./shell/nae-reindex-all.sh
Or in batch mode, supplying
NAE,NAE_USER, andNAE_PASSas environment variables instead of prompting:NAE="http://localhost:8080" NAE_USER="super@netgrif.com" NAE_PASS="password" ./shell/nae-reindex-all.sh batch
Requires
curlandjq. -
calculate-event-usage.sh— Estimates how many workflow events a Petriflow process definition (.xml) will generate at runtime, without needing a running NAE instance or database access. Mirrors the Netgrif Platform event usage estimation formula: 1 (case creation) + number of case-level data fields + number of transitions + number ofdataRefs anywhere in the process markededitable.Accepts a single file or a directory (searched recursively for
*.xml), and prints a per-file table plus a total:./shell/calculate-event-usage.sh my-process.xml ./shell/calculate-event-usage.sh ./processes/
Requires
xmllint(fromlibxml2/libxml2-utils).
See LICENSE.txt.