Products | Versions |
---|---|
TIBCO ActiveMatrix Service Grid | 3.3, 3.4 |
This article illustrates how to update or create a resource template using CLI script which is at a different scope.
If you use the samples folder resourcetemplate_build.xml and resourcetemplate_data.xml you will get issues while updating the resource template at the Application and Environment scope.
The sample script doesn't have an example to update the resource template at an application or environment level. Hence if you run without including the application or environment, a new resource template will get created at the global scope or you will get an error that the same resource template doesn't exist.
CLI script will create a new resource template because in the resourcetemplate_build.xml for the update task property "createIfNotExists" is by default set to true.
Steps:
1.) In the resourcetemplate_data.xml you need to enclose your resourcetemplate tag under an appropriate parent tag depending upon at which scope your existing Resource template is or at which scope you want to create it.
Example:
a.) If you want to create or your existing resource template is under Environment "BPMEnvironment", application "amx.bpm.app" and running under the Node "BPMNode" then you must have your resource template tag as below:
=========================
<Environment xsi:type="amxdata:Environment" name="BPMEnvironment" >
<Application xsi:type="amxdata:Application" name="amx.bpm.app" resourceTemplatesScope="Application">
<Node name="BPMNode" environmentName="BPMEnvironment" />
<!-- ResourceTemplate Tag here -->
</Application>
</Environment>
=========================
b.) If you want to create or your existing resource template is under Environment "BPMEnvironment" and running under the Node "BPMNode" then you must have your resource template tag as below:
=========================
<Environment xsi:type="amxdata:Environment" name="BPMEnvironment" >
<Node name="BPMNode" environmentName="BPMEnvironment" />
<!-- ResourceTemplate Tag here -->
</Environment>
=========================
c.) If your resource template is at the Global Scope simply place it under the Enterprise tag.
2.) In the resourcetemplate_build.xml file make sure your target task which you want to run has the correct value of objectSelector.
You can keep the value as //ResourceTemplate for every scope or you can prepend it with the target scope.
Example:
For the environment level you can keep the value of objectSelector as :
Environment//ResourceTemplate
3.) To run the script run the below command with the required task/action:
ant -f resourcetemplate_build.xml update
ant -f resourcetemplate_build.xml create