GetEnv Functions
Environment constants allow you to retrieve data during production.
Syntax:
Constants are used as follows:
GetEnv("constant name")
Current Record Number
The environment constant CurRecordNumber returns the number of the current record being processed.
In case of split production, each job will continue the numbering from the previous batch.
For example, if production of records 21 - 40 is split into two jobs, the numbering of the first job will be 1 - 10, and that of the second job will be 11 - 20.
Syntax:
GetEnv ("CurRecordNumber")
Example:
GetEnv("CurRecordNumber") = 5
Current Record Number in Batch
The environment constant CurRecordNumberInBatch returns the number of the current record being processed.
In case of split production, each job will restart its numbering.
For example, if production of records 21 - 40 is split into two jobs, the numbering of the first job will be 1 - 10, and that of the second job will be 1 - 10.
Syntax:
GetEnv ("CurRecordNumberInBatch")
Example:
GetEnv("CurRecordNumberInBatch") = 5
Print Media
The environment constant PrintMedia returns True if the production is of a print document.
Syntax:
GetEnv("PrintMedia")
Proof Set
The environment constant ProofSet returns True if the production is of a proof set.
Syntax:
GetEnv("ProofSet")
HTML Media
The environment constant HTMLMedia returns True if the production is of html: on demand, email, or proof html.
Syntax:
GetEnv("HTMLMedia")
Text Media
The environment constant TextMedia returns True if the production is of text: SMS, text.
Syntax:
GetEnv("TextMedia")
Host Application
The environment constant HostApplication returns the name of the application that executes the plan. Possible return values are listed below.
Return Value |
Description |
---|---|
uProduce |
The plan is executed by uProduce. uProduce uses a plan to produce cross-media outputs.
|
InDesign |
The plan or expression is executed by uCreate. uCreate can produce print and proof set output. |
uPlan |
The plan is executed by uPlan. uPlan uses a plan to produce proof sets. |
Syntax:
GetEnv("HostApplication")
Job ID
The environment constant JobId returns the job ID.
Syntax:
GetEnv ("JobId")
Example:
GetEnv("JobId") = 103
Parent Job ID
The environment constant ParentJobId returns, in case of a turbo job, the job ID of the parent job.
Syntax:
GetEnv ("ParentJobId")
Example:
GetEnv("ParentJobId") = 103
Job Type
The environment constant JobType returns the job type defined in the job ticket. Possible return values are listed below.
Value |
Description |
---|---|
|
A Print job.
|
PROOF |
A Proof job. This value indicates a job created using uProduce, by clicking the Proof button of the document details page. |
PROOF_SET |
A proof set job.
|
ON_DEMAND |
A Dynamic HTML production job (previously known as HTML production). This value indicates a job created using uProduce, by clicking the Deploy button of the Web (HTML or TXT) document details page. |
RECORD_SET |
An Interactive Content Port (ICP) job. This value indicates that the plan is executed by an ICP. |
FLAT |
A job that collects information on a future Print job. Several FLAT jobs of the same document are later aggregated and used as the input of a single Print job. This is normally the case with job aggregation created by uStore. |
EMAIL_MARKETING |
An e-mail batch job. This value indicates a job created by clicking the Send button of the Email Activity Details page. |
EMAIL_MARKETING_TEST |
An e-mail batch test job. This value indicates a job created by clicking the Test button of the Email Activity Details page. |
Syntax:
GetEnv("JobType")
Split Part
When splitting a job, you can get the current split part number.
Syntax:
GetEnv ("SplitPart")
Example:
GetEnv("SplitPart") = 2
Document Name
The environment constant DocumentName returns the name of the document from the job ticket.
The document name is always defined in print jobs and in email jobs. If the document name is not defined, this function returns an empty string.
This parameter can be used in the campaign's ADOR expressions, to set a different logic for different documents within the same campaign. For example, you can set a rule that creates high resolution images for a specific document named "HighQualityPostcard" and low resolution images for documents by any other name.
Syntax:
GetEnv ("DocumentName")
Example:
GetEnv("DocumentName") = HighQualityPostcard
Document ID
The environment constant DocumentID returns the ID of the document from the job ticket.
The document ID is always defined in jobs created by uProduce, but is never defined in jobs created by uCreate. If the document ID is not defined, this function returns an empty string.
This parameter can be used in the campaign's
ADOR expressions, to set a different logic for different documents
within the same campaign.
For example, you can set a rule that creates high resolution images for
a specific document whose ID is 5 and low resolution images for document
by any other ID.
Syntax:
GetEnv ("DocumentID")
Example:
GetEnv("DocumentID") = 5
Document Type
The environment constant DocumentType returns the document type defined in the job ticket. Possible return values are listed in the following table.
Return Value |
Description |
---|---|
HTML |
An HTML document |
INDD |
An Adobe InDesign document |
TXT |
A text document |
XLIM |
An XMPie proprietary XLIM document |
Syntax:
GetEnv("DocumentType")
This expression returns a valid value only for the following job types (other job types return an empty string):
-
PRINT
-
PROOF
-
ON_DEMAND
-
EMAIL_MARKETING
-
EMAIL_MARKETING_TEST
Instance ID
When creating an instance from a template, the website is defined in the template and is shared by all its instances.
All instances access the same webpages and use the same website URLs. The instance ID in the URL is used to differentiate between the instances.
In order to get to the InstanceID value, you need to create an ADOR that includes the GetEnv("InstanceID") function.
For example, to create a URL to a specific webpage using the Instance ID ADOR, e.g. {{GetEnvInstanceID}}, the URL format should be:
-
http://www.MyDomain.com/{{GetEnvInstanceID}}/{{XMPieRecipientKey}}
-
http://www.MyDomain.com/MyFolder/Landing.html?iid={{GetEnvInstanceID}}&rid={{XMPieRecipientKey}}
Syntax:
GetEnv("InstanceID")
Base URL
The base URL for the website defined in the Circle campaign, template or instance.
Syntax:
GetEnv("BaseURL")
Example:
GetEnv("BaseURL") = "http://www.MyDomain.com/1432/{{XMPieRecipientKey}}"
Base Online Document URL
The base URL for an on-demand PDF defined in the Circle campaign, template or instance.
Syntax:
GetEnv("BaseOnlineDocURL")
Example:
GetEnv("BaseOnlineDocURL") = "http://www.MyDomain.com/XMPieDownloadPDF?"
Circle Touchpoint Friendly ID
The environment constant CircleTouchpointFriendlyID returns the friendly ID of the Circle touchpoint from the job ticket.
Syntax:
GetEnv("CircleTouchpointFriendlyID")
TopMostJobId
The environment constant TopMostJobId returns the job ID, or in case of a turbo job, the job ID of the parent job.
Syntax:
GetEnv ("TopMostJobId")
Example:
GetEnv("TopMostJobId") = 103
RecipientFilter
The environment constant RecipientFilter returns the recipient filter used in production, which is either the table name, plan filter name or query.
Syntax:
GetEnv ("RecipientFilter")
Example:
GetEnv("RecipientFilter") = "Recipient Table"
HotFolderFileName
The GetEnv ("HotFolderFileName") function returns the name of the file that triggered the job.
Note that for a job that was not triggered by the hot folder mechanism, this function will return an empty string.
You can use this function to create an ADOR that will be used as the output file name based on this ADOR.
Syntax:
GetEnv ("HotFolderFileName")
Example:
GetEnv ("HotFolderFileName")