Consumed App Service to count named users on 10+ other apps

0
I would like to use a consumed app service to have my mendix master application talk to 10+ other mendix apps to keep a running count of named users on each of those 10+ applications. As a team we haven't used App/Web services yet as for where we find the WSDL URL/file to make our goal possible i could do with some tips....... We do have a member of our team thats experienced in this however he is on leave and we need to get going. Thanks for your help,
asked
1 answers
1
  1. Have each app of which you want to count users publish an app service that returns the number of users.
  2. Have your main Mendix application consume the app service of each "slave" Mendix application and add the number of users together to get your count.

Publishing an app service is nothing more than creating a microflow and exposing it through the app service interface.

  • For more info on publishing an app service you can look here
  • For more info on consuming an app service you can look here

To count the number of users create a Java action that does the following (input: none, output: Integer/Long):

To return all concurrent users (i.e. users currently logged in to the application)

// BEGIN USER CODE
return Core.getConcurrentUserCount(true);
// END USER CODE

To return all concurrent named users (i.e. named users (so excluding anonymous users) currently logged in to the application):

// BEGIN USER CODE
return Core.getConcurrentUserCount(false);
// END USER CODE

To return all named users (whether they are logged in or not, so basically a count of all System.User objects):

// BEGIN USER CODE
return Core.getNamedUserCount();
// END USER CODE
answered