Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we break out of if-else conditions and will tagui step works with repositories or datatables? #135

Closed
kensoh opened this issue Apr 12, 2018 · 1 comment
Labels

Comments

@kensoh
Copy link
Member

kensoh commented Apr 12, 2018

Raising this from an user email for sharing, as other users might benefit from this question.


An additional query – we noticed that when scripting in TagUI and where we have multiple if-else conditions, we are unable to skip/break those codes which are not applicable based on the business process flow (e.g. if a file exists, we want to move directly to step 15 instead of going through to step 2 to 14) – is there a specific command in TagUI that we can use to get out of certain if-else condition?

We also understand that we can code the functions by blocks (i.e. calling script within script – your Github issue #80 refers) so would you say this functionality can help (to a certain extent) with the above issue? But we also note that the object repository functionality in sub-scripts is disabled so if we start grouping the codes based on certain functions, they may not work as intended?

@kensoh kensoh added the query label Apr 12, 2018
@kensoh
Copy link
Member Author

kensoh commented Apr 12, 2018

You can't break out of an if statement, but you can try something like this -

if condition 
{
step 2
...
step 14
}

step 15...

or if you call sub-scripts using tagui step -

if condition
{
tagui crm_app.login
}

step 15..

What tagui step does is simply retrieve the contents of the sub-script crm_app.login (or some other filename) and insert the steps in that sub-subscript into the tagui step location where it is used. So the repository definitions or datatable definitions should still work just like in the rest of the automation flow.

Also within a sub-script you can call other sub-scripts to go really deep into the modularization. But I generally don't recommend going too deep, because it can backfire and become harder to maintain or troubleshoot (you gotta open multiple files just to get an idea of the complete automation flow).

@kensoh kensoh closed this as completed Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant