· Sep 11

Create Production programmatically

I'm playing with ZPM. Accidentally dropped a production. How can I recreate it programmatically? I see Ens.Director.StartProduction, StopProduction, and even DeleteProduction but I don't see CreateProduction anywhere. Please help 😊 

Product version: IRIS 2023.2
Discussion (2)2
Log in or sign up to continue

It seems to me that I found the answer (was googling for two hours and found nothing, then used forum search and voila):

  1. Declare a class which inherits Ens.Production:
Class My.Production Extends Ens.Production

XData ProductionDefinition
<Production Name="My.Production" TestingEnabled="true" LogGeneralTraceEvents="true">
  1. And launch:
Set isProductionRunning = ##class(Ens.Director).IsProductionRunning("My.Production")
If isProductionRunning = 0 {
            Set sc = ##class(Ens.Director).StartProduction("My.Production")