Export macro in "Export for production"

Hi all,

Acording to the post How to Export and Import Ensemble Components and Productions we can create a unique file to implement and deploy a production, but I'm not able to export and import macro file in the process.

I've been looking for how to implement the macro file in this process but I haven't found anything.

is it possible to export and deploy the macro file in the "Export from Production"?

 

Best regards,

Francisco Lopez

  • 0
  • 0
  • 211
  • 5
  • 2

Answers

I think there's an easier way.

Use Studio to create a project that contains your INC file.

Save the project.

When exporting the production, use the "Studio Project Files" button and choose your project.

When the project selector dialog closes, the main export dialog shows your INC on the list of what will be exported.

Thanks John.

I've checked your answer as correct because this is the best approach to do it.

In Studio we can add everything and I don't forget any file.

Best regards,

Francisco López

Hi again.... I've found a solution for this issue and it works.

  • Create the deploy file from "Export from production". In this example, the file name is "Export-Common_Production.xml"
  • Export the INC file from Systems - Routines. In this example, the file name is Export.xml
  • Open the deploy file (Export-Common_Production.xml) . Look at the begin of the code
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 08:24:26">
<Class name="Common.Produccion">
<Super>Ens.Production</Super>
<TimeChanged>64397,40010.817022</TimeChanged>
<TimeCreated>64329,41160.632132</TimeCreated>

<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Common.Produccion" TestingEnabled="true" LogGeneralTraceEvents="false">
  <Description></Description>
  <ActorPoolSize>2</ActorPoolSize>
</Production>
]]></Data>
</XData>
</Class>
  • Copy the content of Export.xml, only the <Routine> node
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 12:11:54">
<Routine name="Common.Common" type="INC" timestamp="64548,48449.743452"><![CDATA[

#include %occErrors
#include %ZEN.Utils

#define GetData(%x) $get(%request.Data(%x,1))
#define Header(%x) %request.GetCgiEnv("HTTP_"_%x)
#define Lower(%text) $ZCONVERT(%text,"l")
]]></Routine>
</Export>
  • Paste it at the begin of Deploy file
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 08:24:26">
<Routine name="Common.Common" type="INC" timestamp="64548,48449.743452"><![CDATA[

#include %occErrors
#include %ZEN.Utils

/// GetData: Recoge el valor de un parámetro de una petición Request
#define GetData(%x) $get(%request.Data(%x,1))
/// Header: REcupera el contenido de la cabecera
#define Header(%x) %request.GetCgiEnv("HTTP_"_%x)
/// Lower: Convierte en minúscula el texto indicado
#define Lower(%text) $ZCONVERT(%text,"l")
]]></Routine>

<Class name="Common.Produccion">
<Super>Ens.Production</Super>
<TimeChanged>64397,40010.817022</TimeChanged>
<TimeCreated>64329,41160.632132</TimeCreated>

<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Common.Produccion" TestingEnabled="true" LogGeneralTraceEvents="false">
  <Description></Description>
  <ActorPoolSize>2</ActorPoolSize>
</Production>
]]></Data>
</XData>
</Class>
  • Search down the node  <Project> and include the INC file
<Project name="EnsExportProduction_2017-09-04 08-20-12_724+2" LastModified="2017-09-29 08:24:26.599088">
  <ProjectDescription><![CDATA[Studio Project generated from Ensemble Production &apos;Common.Produccion&apos; at 2017-09-04 06:20:12.724 UTC]]></ProjectDescription>
  <Items>
    <ProjectItem name="Common.Common" type="INC"></ProjectItem>
    <ProjectItem name="Common.Utils.Encriptar" type="CLS"></ProjectItem>
    <ProjectItem name="Common.Utils.JSON" type="CLS"></ProjectItem>
    <ProjectItem name="Common.Utils.Utilidades" type="CLS"></ProjectItem>
    <ProjectItem name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2.PTD" type="PTD"></ProjectItem>
  </Items>
</Project>
  • Search down the node <Document> and add the first file the INC and reorder the numbers of item
<Document name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2.PTD"><ProjectTextDocument name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2" description="Export Notes for export EnsExportProduction_2017-09-04 08-20-12_724+2">
<![CDATA[<Deployment>
<Creation>
<Machine>MYSERVER</Machine>
<Instance>HEALTHSHARE</Instance>
<Namespace>COMMON</Namespace>
<SourceProduction>Common.Produccion</SourceProduction>
<Username>_SYSTEM</Username>
<UTC>2017-09-29 06:24:26.597</UTC>
</Creation>
<Notes>
</Notes>
<Contents>
<ExportProject>EnsExportProduction_2017-09-04 08-20-12_724+2</ExportProject>
<Item num="1">Common.Common.INC</Item>
<Item num="2">Common.Produccion.CLS</Item>
<Item num="3">Common.Utils.Encriptar.CLS</Item>
<Item num="4">Common.Utils.JSON.CLS</Item>
<Item num="5">Common.Utils.Utilidades.CLS</Item>
</Contents>
<ProductionClassInExport>Common.Produccion</ProductionClassInExport>
</Deployment>

]]></ProjectTextDocument>
</Document>

Now you can deploy the production with the INC file without problem

 

There is a problem with this process, if you need to re-export the production, you'll lose the INC file and you need to paste it again

 

I hope this solution will work for someone else.

Best regards,

Francisco Lopez

Comments

I don't think there's an option to export inc files from this dialog.

If you often need to move production between environments writing your own deploy script can save you time on clicking through the UI.

Hello Eduard,

Do you know if we could specify a shared network folder instead of C: or D: when exporting or importing the XML file?

Because the GUI itself blocks me if I try to change the file path.

Thanks

I'll answer the comment related to import/export utility isc-dev . It exports everything in a namespace to a specified folder.

You can setup the folder with:

d ##class(sc.code).workdir("D:\yourfilder")

Then export with 

d ##class(sc.code).export()

You can specify a mask of classes too or set it up in isc.json file.