This function checks, if a resource in InterFormNG2 exists or not. The function returns a boolean: true or false.
The ng:resourceExist Xpath function has this format:
ng:resourceExist(resource,path)
where:
resource
Resource is the type of resource in InterFormNG2, that you want verify for existence. You can specify any of these resources:
Resource | Description | Examples |
---|---|---|
document | Tests if a document e.g. xml or splf exists | ng:resourceExist('document','/Intro/Intro_demo.xml') |
font | Tests if a font exists | ng:resourceExist('font','arial.ttf') |
image | Tests if an image resource exists | ng:resourceExist('image','/Intro/demologo_C.jpg') |
mailTemplate | Tests if an email template exists | ng:resourceExist('mailTemplate','HelloWorld2.html') |
style | Tests if a style exists | ng:resourceExist('style','Header.style') |
template | Tests if a template exists | Test an InterFormNG2 template: ng:resourceExist('template','/Intro/intro.ift') Test an InterFormNG2 html template: ng:resourceExist('template','Untitled Template.ifm') Test an InterFormNG template: ng:resourceExist('template','TestLabel1.itpl') |
transform | Tests if a transform exists | Test a spooled file extractor: ng:resourceExist('transform','demo_extract.sfe') Test an xslt transform: ng:resourceExist('transform','AddANode.xsl') Test an xent transform: ng:resourceExist('transform','sql_demo.xent') |
translation | Tests if a translation file exists | ng:resourceExist('translation','/Demo/translate_en_GB.properties') |
validation | Tests if a validation rule exists | ng:resourceExist('validationRule','TestDocNo.sch') |
other | Tests if a file in the others library exists | ng:resourceExist('other','escape.js') |
path
The path contains the path (including the name of the resource) to the resource from the resource root folder that should be verified. You can also use this to verify if a resource folder exists e.g. like this: ng:resourceExist('document','/Demo')
The function can e.g. be used for verifying, if a file exists before you try to use it in the workflow.
Please notice, that in version 1.9.0 the editor in the designer/workflow expects, that this function only accepts a single parameter, so you might see the error below, but this can be ignored:
Example:
ng:resourceExist('template','Demo.ift')
Related function is ng:fileExist.