NIFI-11308 Added nifi.framework.version System Property for EL

- Updated Expression Language Guide to note the available system property providing the current framework version according to the Framework NAR version

This closes #8101

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
annanys23 2023-12-01 21:53:58 +00:00 committed by exceptionfactory
parent ba599d29c2
commit 93c9efe527
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
2 changed files with 12 additions and 0 deletions

View File

@ -220,6 +220,12 @@ and then press Ctrl+Space, we are provided a pop-up that lists six different fun
which functions are shown, or we can select one of the functions from the list by double-clicking
it with the mouse or using the arrow keys to highlight the desired function and pressing Enter.
[[system-properties]]
=== Framework System Properties
The following system properties are set by the NiFi application, and are available to the Expression Language:
- *nifi.framework.version*: The build version for the NiFi framework. Usage: ${'nifi.framework.version'}
[[functions]]

View File

@ -74,6 +74,12 @@ public final class NarClassLoaders {
this.jettyBundle = jettyBundle;
this.serverInstance = serverInstance;
this.bundles = bundles;
// Set the nifi.framework.version system property to make the version available
// via expression language in data flows
if (frameworkBundle != null) {
System.setProperty("nifi.framework.version", frameworkBundle.getBundleDetails().getCoordinate().getVersion());
}
}
}