Can you please advise how to run the following block of components in a loop?
I highlighted the portion of the URL that I need to iterate:
It should be: context.startIndex*1, context.startIndex*2, context.startIndex*3...etc, etc, up to 100.
Is it possible to use a tLoop? Please provide a description of the method.
Thank you,
Mircea
Yes, you should be able to do so, just by adding a tLoop after the onComponentOK link, and connect components like this :
tLoop --iterate--> tFixedFlowInput --main--> tRestClient
(tFixedFlow is just here to let you connect tLoop to tRestClient)
Basic settings in tLoop : from/to/step : 1/100/1
In your tRestComponent, you should use the globalMap variable provided by your tLoopComponent :
..startIndex="+context.startIndex*((Integer)globalMap.get("tLoop_1_CURRENT_ITERATION"))
Use the 'Outline' view to get the global variables you can access with your components.
Related
I have lots of URL values and their keys. But there is no way to batch import the variables and the "value" controls are also not text boxes in the Variables Group page to perform chrome browser extensions assisted find and replace.
If this is possible, what is the syntax to refer to the key?
As in, I have a variable App.URL : www.contoso.com.
I am using the key to substitute value in my next variable like this Login.URL : $(App.URL)\Login and this doesn't work.
GitHub link : https://github.com/MicrosoftDocs/vsts-docs/issues/3902#issuecomment-489694654
This isn't currently available, not sure if it will be. Can you create a task early in your pipeline that sets the variables you need in subsequent tasks/steps? This gives you more control as you can store the script along with your source. You could then use a pipeline variable for the environment you're in and let your script use that to set values appropriately.
See Set variables in scripts in the MS docs.
If it's not possible to re-architect your app to concatenate the url strings in the application, what the previous commenter said about creating a simple script to do that for you would be the way to go. Ie:
#!/bin/bash
#full login url
fullLoginUrl=$APP.URL\$LOGINSUFFIX
echo "##vso[task.setvariable variable=Login.URL]$fullLoginUrl
Otherwise, perhaps playing around with the run time vs compile time variables in YAML pipelines might be worth trying.
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#understand-variable-syntax
I am using botium-box. I have the following convo file:
Here the date is a variable and changes everyday so I have to change it everyday in convo file otherwise the testcase is failing.
I have tried few solutions:
setting SCRIPTING_ENABLE_MEMORY to true in advance settings and using
placeholder for variables. For eg.
I tried setting INTENT_CONFIDENCE to 70 in advance settings and using
in convo file. For eg:
I tried INTENT_CONFIDENCE directly in convo file without setting it in advance capabilities. For eg.
I tried using %s in place of variable. For eg.
Testcases are still failing. Is it a bug? Do I have to change any Botium settings? How can I do partial matching of responses?
Solution 1 should be working (see here and here). If it doesn't work, please attach log file for analysis.
Options 2 and 3 are for something totally different (verification of intent resolution confidence), and Option 4 is not a Botium feature.
What you can try as well: Botium by default does substring matching for assertions, so your convo file could look something like this:
#me
what is the date today ?
#bot
Today is
I have a scenario where i want to store data to HashMap after processing in tMap component.
my flow is as follow :
tFileInputExcel------>tMap------>tJavaRow/tJavaFlex
In tJavaRow, i want to store all my data into a HashMap.
Any help on this.
Additionally to Philipps answer, I would like to add that you could use the tHashMap components. Usually those are deactivated when Talend is installed and you need to activate them first.
Then it is very easy using them, just add the components as you are used to do. You would save creating code.
It's not difficult to do this but it'll be less obvious to the "reader" of the code than the usage of the components.
For readability I'd recommend a tJavaFlex component over the tJavaRow. Assuming the Flow "toHashMap" exits your tMap with the fields "myKey" and "myValue", the code in the tJavaFlex would look like this:
Start code:
HashMap myAwesomeMap = new HashMap<>();
Main code:
myAwesomeMap.put(toHashMap.myKey, toHashMap.myValue);
End code:
/*
whatever you want to do with the aggregated data. You'll probably want to save it to the globalMap in any case.
*/
globalMap.put("myAwesomeMap", myAwesomeMap);
What is the best way to iterate over files and feed them into tMongoDBBulkLoad? It sees that you cannot feed into this component from a tFileList componet (Iterate) - which would make the most sense.
I want to import 80 files, rather than create one massive file which is too large to open in notepad if I have issues during the import.
Thanks
---Update----
I know how to do this with other components, my issue is I cannot feed an Iterate component into the tMongoBulkLoad
The simplified job will be like this :
tFileList ---------iterate--------tMongoDBBulkLoad
and in the tMongoDBBulkLoad settings you set the Data file to :
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
Here, the tFileList will iterate over files, in each iteration, the tMongoDBBulkLoad will be triggered to load the current file, which is indicated by the global variable.
--- Reply for the Update ---
To connect an iterate trigger to the component, you can add a dummy tjava with no code, it will be like this :
tFileList -----(iterate)-----tJava-------(onComponentOk)-------tMongoDBBulkLoad
I am working on a code "maintenance" idea where I would like to populate a global when routines are accessed and by who. I can pull the current routine name using $t(+0) or $ZNAME, but what about the current tag and/or line offset? Is there a way so I can put a standard line in the routines I want to track?
Rob, you can get these information from $STACK.
If you call your own tracking function, you get the calling stack info like this:
W $STACK($STACK(-1)-1,"PLACE")
zExecute+2^%Studio.General.1 +1
Take a look at the Caché ObjectScript Reference for $STACK for detailed description and examples.
Rob!
Maybe you just turn on Audit? It gathers logs for different users activities in InterSystems Caché database. See the documentation on Caché Audit.
Also, see this solution which will help you to examine analytics in DeepSee regarding Audit entries.
You can find the routine that's calling your label, by the following ClassMethod.
write ##class(%SYSTEM.Process).CallingRoutine()
As well as the database which is calling your label.
write ##class(%SYSTEM.Process).CallingDatabase()