Call System functions within custom module?

First, is there a way to utilize system functions in a 3rd party module? For example:

  • system.util.getEdition
  • system.util.getSystemFlags
  • system.alarm.queryStatus

Second, is there a method to check for trial mode?

Assuming you're in the scope of a Vision client, because that's where these functions will work from, you need to pivot from an instance of FPMIApp to getSystemUtil() and then you can call the various methods on ClientSystemUtilities.

If you're in some other scope, querying the license to determine the Vision edition would be possible. If you wanted the platform edition (Edge, Maker, Standard) you want PlatformEdition.get() .

Depending on what you want from the system flags, you may also just be able to interrogate FPMISystem.getMode().

How you query for alarm status is going to depend entirely on what scope you're trying to invoke from.

You probably don't want to care about trial mode by querying the system for it. Instead, rely on your module's scope hook having it's notifyActivationStateChanged(LicenseState) method called by the platform.

3 Likes

@PGriffith, this is very helpful. Thank you for the direction.

Following up with the querying alarm status (system.alarm.queryStatus):
If my scope were to be from the Gateway, how would we go about calling that method?

  1. Construct an AlarmFilter: AlarmFilterBuilder
  2. Get the alarm manager from the GatewayContext you get during your hook's setup method: GatewayContext
  3. Query status by passing your AlarmFilter to the AlarmManager: AlarmManager
1 Like