Can I create my own variable which should work like built in variable in Informatica - informatica

I want to create my own variable and want to set my default value which should work like a built in variable in Informatica. I want to use created variable in my all workflow.
Is it possible any way ?
Thanks

You can use the same parameter file across all of your mappings (there is syntax to separate out bits which are for specific sections and those which are universal by way of the scope) see following link https://network.informatica.com/thread/27560

Related

How to automate M2Doc generation including the settings?

I've applied the guidance on programmatic usage of M2Doc (also with this help) to successfully generate a document via the API, which was previously prepared by using the M2Doc GUI (configured .docx plus a .genconf file). It seems to also work with a configured .docx, but without a .genconf file.
Now I would like to go a step further and ease the user interface in our application. The user should come with a .docx, include the {m:...} fields there, especially for variable definition, and then in our Eclipse application just assign model elements to the list of variables. Finally press "generate". The rest I would like to handle via the M2Doc API:
Get list of variables from the .docx
Tell M2Doc the variable objects (and their types and other required information, if that is separately necessary)
Provide M2Doc with sufficient information to handle AQL expressions like projectmodel::PJDiagram.allInstances() in the Word fields
I tried to analyse the M2Doc source code for this, but have some questions to achieve the goal:
The parse/generate API does not create any config information into the .docx or .genconf files, right? What would be the API to at least generate the .docx config information?
The source code mentions "if you are using a Generation" - what is meant with that? The use of a .genconf file (which seems to be optional for the generate API)?
Where can I get the list of variables from, which M2Doc found in a .docx (during parse?), so that I can present it to the user for Object (Model Element) assignment?
Do I have to tell M2Doc the types of the variables, and in which resource file they are located, besides handing over the variable objects? My guess is no, as using a blank .docx file without any M2Doc information stored also worked for the variables themselves (not for any additional AQL expressions using other types, or .oclAsType() type castings).
How can I provide M2Doc with the types information for the AQL expressions mentioned above, which I normally tell it via the nsURI configuration? I handed over the complete resourceSet of my application, but that doesn't seem to be enough.
Any help would be very much appreciated!
To give you an impression of my code so far, see below - note that it's actually Javascript instead of Java, as our application has a built-in JS-Java interface.
//=================== PARSING OF THE DOCUMENT ==============================
var templateURIString = "file:///.../templateReqs.docx";
var templateURI = URI.createURI(templateURIString);
// canNOT be empty, as we get nullpointer exceptions otherwise
var options = {"TemplateURI":templateURIString};
var exceptions = new java.util.ArrayList();
var resourceSetForModels = ...; //here our application's resource set for the whole model is used, instead of M2Doc "createResourceSetForModels" - works for the moment, but not sure if some services linking is not working
var queryEnvironment = m2doc.M2DocUtils.getQueryEnvironment(resourceSetForModels, templateURI, options);
var classProvider = m2doc.M2DocPlugin.getClassProvider();
// empty Monitor for the moment
var monitor = new BasicMonitor();
var template = m2doc.M2DocUtils.parse(resourceSetForModels.getURIConverter(), templateURI, queryEnvironment, classProvider, monitor);
// =================== GENERATION OF THE DOCUMENT ==============================
var outputURIString = "file:///.../templateReqs.autogenerated.docx";
var outputURI = URI.createURI(outputURIString);
variables["myVar1"] = ...; // assigment of objects...
m2doc.M2DocUtils.generate(template, queryEnvironment, variables, resourceSetForModels, outputURI, monitor);
Thanks!
No the API used to parse an generate don't modifies the template file nor the .genconf file. To modify the configuration of the template you will need to use the
TemplateCustomProperties class. That will allow you to register your metamodels and service classes. This instormation is then used to configure the IQueryEnvironment, so you might also want to directly configure the IQueryEnvironment in your code.
The generation in this context referes to the .genconf file. Note The genconf file is also an EMF model, so you can also craft one in memory to launch you generation if it's easier for you. But yes the use of a .genconf file is optional like in your code example.
To the list of variables in the template you can use the class TemplateCustomProperties:
TemplateCustomProperties.getVariables() will list the variables that are declared with their type
TemplateCustomProperties.getMissingVariables() to list varaibles that are used in the template but not declared
You can also find le list of used metamodels (EPackage nsURIs) and imported services classes.
The type of variables is not needed at generation time, it's only needed if you want to validate your template. At generation time you need to pass a map from the variable name to its value as you did in your example. The value of a variable can be a any object from your model (an EObject), a String, an Integer, ... If you want to use something like oclIsKindOf(pkg::MyEClass) you will need to register the nsURI of pkg first see the next point.
The code you provided should let you use something like projectmodel::PJDiagram.allInstances(). This service needs a ResourceSetRootEObjectProvider() that is initialized in M2DocUtils.getQueryEnvironment(). But you need to declare the nsURI of your metamodel in your template (see TemplateCustomProperties). This will register it in the IQueryEnvironment. You can also register it yourself using IQueryEnvironment.registerEPackage().
This should help you finding the missing parts in the configuration of the AQL environment. Your code seems good and should work when you add the configuration part.

How to declare a variable only once in Gamemaker Step function?

Screenshot
I want the variable maxx to only update once when calling this script and all the other lines of code every frame , please help
You could either:
Declare the variable in Create
Structure the script so that it is called in Create to initialize it and then in Step to use it
(an optional argument or lack of arguments for a reasonable solution, event_type for a hack)
Use variable_instance_exists provided that you are not using an ancient version of GMS1

How to define database variable for logging in Kettle?

I would like to know if there is a proper way to pass the database connections variable so they can be used in the logging sections of both jobs and transformations.
Regards,
Nicolas.
Edit the kettle.properties from the top menu.
If you want to do it for ALL the log use the variables like KETTLE_JOB_LOG_* and KETTLE_JOB_TRANS_*. There is no way to do it for job and transformation at the same time, but it is defining 8 variables (instead of 4) which can be copy/pasted.
If you want to do it for specific job and/or transformation, define your own variables like log_bd, log_table,... and use them as ${log_db}, ${log_table},... You have to define the parameters for each job and transformation. Or else, you could write a small program to change the xml of the .ktr and .kjb.

Using a defined global variable in a collection variable

I have the following setup:
A global variable api_address defined as http://apiproduction.mydomain.com.
A collection variable route_address defined as users/profiles for each collection.
Right now my query look like: {{api_address}}/{{route_address}}/004ba492-d021-40fe-ba23-f1d366036af4 if i want to get the resource.
So my question is... Could you include in a collection variable a global one?
Example: {{route_address}} could be defined as {{api_address}}/users/profiles.
Yes you can do this! But you have to do it with pre-request scripts.
Edit your selection and go to the pre-request script tab.
Add something like the following:
let api_address = pm.globals.get("api_address");
pm.variables.set("route_address", `${api_address}/users/profile`);
That should give you your "route_address" that you are looking to variablize.
You can probably to the pm.globals.get inline on your set, but I'm old school and think it's cleaner and easier to read if you throw it into a local variable first.

CMS Made Simple - Set Variable to be Available across Templates

Is it possible to create a custom variable in CMS Made Simple that could be set in one template and then this value would be available in another template for the same site?
Edit:
I forgot to add that the template I want to set the variable in is using a different domain, although it is the same site. This means I can't use cookies or session vars.
You can use the smarty assign or capture system:
{assign var="foo" value="bar"}
{capture name="foo"}bar{/capture}
Please note that this depends on the order of the templates are executed. For example, in most scenarios, everything inside is executed before everything inside from the main template.