Raja Mohan · Jan 19, 2018

How to create productions via routine

Hi All,

I am trying to create a production from a script(routine). 

I am using the below way to create an empty production

Set oProd=##class(Ens.Config.Production).%New()
Set oProd.Name="Test.NewProduction"
Set oProd.ActorPoolSize=1
Set status=oProd.%Save()

But when i tried to start the production, i am getting an error as "Test.NewProduction" class does not exists. 

Is there any other way to create the production via routine or terminal using commands as above?

0 310
Discussion (1)1
Log in or sign up to continue

Why would you want to do that?

Here's sample production class:

Class Test.Production Extends Ens.Production

XData ProductionDefinition
<Production Name="Test.Production" TestingEnabled="true" LogGeneralTraceEvents="true">


Ens.Config.Production serialized is XData ProductionDefinition and not the class itself.

To create production class automatically you need to:

  1. Create %Dictionary.ClassDefinition object for your test production
  2. Create Ens.Config.Production object
  3. Create %Dictionary.XDataDefinition
  4. Serialize (2) into (3)
  5. Insert XData (3) into (1)
  6. Save and compile (1)