I want to use the function numprocessesforprocessmodelforstatus(id, status, includeSubProcessData), but I don't understand how to get the ID of the process model I want to reference. The documentation doesn't give an example that incorporates fetching the ID of a model, the example just says "numprocessesforprocessmodelforstatus(processModelId,"completed")" but doesn't explain how to get the id. The documentation has been giving me a headache since day one. If I look up "process model id" I get zero results in the documentation search.
numprocessesforprocessmodelforstatus(processModelId,"completed")
Discussion posts and replies are publicly visible
The Process Model ID appears front-and-center on the properties dialog when you're editing that process model. That is, if you just need the ID for your own purposes. Note that the ID for a certain model will change between environments.
If you're talking about something you're going to actually use within your system, the standard practice for this is to create a Constant of type Process Model. When referenced by rules like you quote here, the rule will be fed the ID - and it will work correctly when deployed between different environments, since the constant itself is a direct reference to the process model.