How to use context parameter in TAC (Talend)? - talend

I tried to implement context parameter in TAC but its not working for me. Could you please explain with an example?

Groups of the context parameters could be created in Talend repository:
After you entered a name of context Group, go to the next step where new variables could be created.
When you done with it. Switch to table view and press "Configure contexts..." button:
In opened window you can create and manage different contexts, e.g.:
After adding new contexts you can set different variable values for different contexts:
When you done with your new context group just add it to your job:
Now you can use them inside the job.
All this stuff are synchronized with TAC via Talend SVN repository and will be available there after the commit. Then you can choose appropriate context for your job at execution task properties:
Also, you can override context variables by some custom value using "Context parameters" menu at the bottom of "Job Conductor" page.

Related

IBM Watson Assistant: How to retrieve input value from chosen dialog option?

I already followed these great instructions on how to dynamically create dialog node options from generic input and it's working like charm. But for now I cannot see how to hand over the chosen option value to the next node to process further. Is there any documentation how to pass the chosen option value to the child node?
You can store any selected option and other information in context variables. They are passed around and can be accessed in other nodes. The information is available until you unset or delete the context variable.

Run Keyword In Separate Thread keyword not found even though it's in the script

I have a robot script with the following keywords:
Enter New Data Group
SelectDialog New Data Group
Button Should Be Disabled okButton
Type Into Text Field nameTextField EnteredByRF1
Type Into Text Field descriptionTextArea EnteredByRF1
Button Should Be Enabled okButton
Push Button okButton
Run Keyword In Separate Thread Check OverWrite
Check OverWrite
SelectDialog New Data Group
Push Button OK
SelectDialog New Data Group
Push Button Yes
When I run the script, it gets to the Run Keyword in Separate Thread and produces a Keyword Not found error. I understand from the docs that to handle a popup that may or may not appear, it needs to go in a separate thread.
If I run it without the Separate Thread keyword, it works fine, IF the popup appears. No popup, it fails.
How are you supposed to use this keyword? Is it the right solution for this test scenario?
After some experimentation, it appears Run Keyword In Separate Thread only works for pre-defined keywords in the SwingLibrary package.
By changing the sequence to:
Run Keyword In Separate Thread SelectDialog New Data Group
Run Keyword In Separate Thread Push Button OK
Run Keyword In Separate Thread SelectDialog New Data Group
Run Keyword In Separate Thread Push Button Yes
The RF script now works as expected.

Rundeck implicit variable

Run dick gives us the ability to define options to be entered by the its GUI, is there any capability to have job variable based on the input without the end user of the job seeing it?
E.g, if the the user choose the product and the environment and the product behind LB, I want to use a script internally to define new job variable and assign it the port number that could be used later on within the job steps.
Yes, there is.
You can add a new option whith Allowed Values set to Remote URL, then put the URL to your script which will return the actual value based on other options.
For exmaple
http://localhost/cgi-bin/getPort.py?environment=${option.environment.value}&product=${option.product.value}
Rundeck Manual option-model-provider

Running Talend child jobs through a parent job

I want to develop a Talend job parent job which will read a file. This file will have all the child job names.
So the parent job when run must go through each entry in the file (ie each child job name) and execute the child job.
Can anyone please guide me on this.
You can use the tRunJob dynamic job feature, I executed 3 sub jobs called a, b and c, and the order is specified in the file, see below :
First block is to load your file into context, you can use a properties file or delimited file.
I used properties file with this content :
jobs=a;c;b;a
You have to add a string typed context variable named jobs to put the propertie value into.
Now, our job list is stored in a context variable, we need to iterate through them using tJavaFlex and update a context variable called currentjob:
And finally, this is how to set tRunJob component:
Here you specify jobs to be executed, but the execution order is specified by the file !
You can do it like following scenario
This is the sample job which I tried out.
I have assumed your input from CSV file and the input file contain three job name which are
ChildJob1
ChildJob2
ChildJob3
I am getting the jobname and assigning it to a context variable like below
Then that context variable is used in tRunJob component.
Each child job has a single tjava component which displays the jobname
Hope this may help you out.

Remove custom code workflow programmatically

For a variety of reasons too convoluted to explain here, I find myself in a position where I need to be able to remove custom code workflows, while leaving the solution there.
I essentially have the same code as the plugin registration tool
Namely
service.Delete("plugintype", new Guid(info));
where info is the workflow id [running on a foreach loop but that's beside the point]
However, while the tool removes the workflows without any issues, my code complains about dependencies.
EM:
Additional information: The PluginType(a0b2dcf7-cf2a-111e-7da9-003021880a42) component cannot be deleted because it is referenced by 1 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.
which I duly did
RetrieveDependenciesForDeleteRequest req = new RetrieveDependenciesForDeleteRequest();
req.ComponentType = 90; //plugintype
req.ObjectId = new Guid(info);
RetrieveDependenciesForDeleteResponse resp = (RetrieveDependenciesForDeleteResponse)OrgService.Execute(req);
This retrieves an optionvalueset, but there is little I can do with it as I cannot remove it from the solution as the solution is managed.
The only difference I can see is the way the OrganizationServiceProxy gets instantiated. The plugin registration tool includes a way to refresh the securitytoken, but as far as I can tell it's not doing much (I've stepped through the code, but it's possible I missed something)
Are you sure that it is an OptionSetValue that is the dependency? It's much easier to use GUI to determine what the dependencies are. Fire up your solution in CRM 2011, click 'plug-in assemblies', select the relevant assembly then go through each custom workflow/plugin item and click 'Show Dependences'.
In my case I had another workflow (created within CRM) that was referencing a custom workflow preventing removal of the assembly.
You won't be able to remove components from a Managed solution... Are you the author of the solution originally?
As an aside, does your workflow fire on change of the OptionSet that is showing as a dependency?