IBM Watson Assistant define context variable in slot - watson

I cannot figure out how to define an optional slot to define a custom context variable from the combination of two entities. It is something like the image.

The slot "Check for" looks for a single returning value if it exists. If it does, then it stores it in the context variable you set in "Save it as".
In the case above, you would need to separate #activity:compay and #location into separate checks.
Once those are met, then in the "Respond with", click on the context editor, and put your activity = 1 there.

Related

AWS lex bot...created "slottypes" like "coffetype" "coffeesize" but can't use them in the bot creation

In the construction of the bot, I should be able access the slotypes I created. but I can't see them. There are videos that they we can create slot types and use them in building intents. Even though my slot type exists I can't access them while I am building the Utterances
In order to reference the slot types within an intent's utterances, you need to have added those slot types to slots within the intent.
Please take a look at this example where I have a slot called quantity of type AMAZON.Number. I can then reference the quantity slot within any utterance that I have.
Reegz's answer was very good and seemed to cover everything so I apologize if I am repeating things.
You've created your own custom slots already, however, you must include them in the intent you want to use them with.
You must do this before you add them to Utterances. Otherwise they will not appear in the drop-down.
Add the slots to the intent by going to the Slots section of your intent:
Click on the Add slot button on the top right corner of this section.
Create a name for the slot, this is similar to setting a variable name for an object. This name is also how you will access the Slot.
You may need to click save on the intent in order to see changes in the slot drop-down.
Now when you go to add a new Utterance, your custom slot should appear:
Let me know if you have anymore questions. I hope this helps you.

TFS 2015 Alert for Changes in Team/Group send to me

as the title describes i want an alert that sends me an email whenever a change happens to a work item that is assigned to one of my Team Members. Beware this is not a Project Team, it is a specific Group.
As i would understand this: I need an alert under My Alerts since only me needs to be informed but when I try the Assigned to Field with my group, it doesn't work with contains operator and the in group operator isn't shown.
Kind Regards
Christian
contains operator means when Assigned to Field has the value you specify in filter, the alert will be triggered.
The only way to achieve your requirement is to add multiple Assigned to clauses and group them with Or like the screenshot below:

SpecFlow Dependent Features

I have 2 Features 1. User Creation 2. User Enrollment both are separate and have multiple scenarios. 2nd Feature is dependent on 1st one, so when I run the 2nd Feature directly then how this feature checks the 1st Feature is already run and user created. I am using database in which creation status column (True/False) tells if user has been created or not. So, I want if i run the 2nd feature before that it runs the 1st feature for user creation.
In general, it is considered a very bad practice to have dependencies between tests and a specially features. Each test/scenario should have its own independent setup.
If your second feature depends on user creation, you could just add another step to you scenarios, e.g. "When such and such user is created."
If all scenarios under one feature share common content, you could move it up under a Background tag. For example:
Feature: User Enrollment
Background
Given such and such user
Scenario
When ...
And ...
Then...
Scenario
When ...
And ...
Then...
I used reflection
Find all Types with a DescriptionAttribute (aka Features)
Find their MethodInfos with a TestAttribute and DescriptionAttribute (aka Scenarios)
Store them to a Dictionary
Call them by "Title of the Feature/Title of the Scenario" with Activator.CreateInstance and Invoke
You have to set the (private) field "testRunner" according to your needs of course.

Reuse steps of Specflow when using Page Objects pattern

I am using Specflow with page objects and I have a lot of scenarios which are very similar. For example:
Given I view the 'page1'
When I click 'link1'
Then I should be on 'page2'
Given I view the 'page1'
When I click 'link2'
Then I should be on 'page3'
I am struggling to see how I could have one step binding for the "When I click..." step. If I follow the page objects pattern I should always return the specific page object that I am navigated to in the "Then I should..." step.
I have a base step definition class which contains a property which stores the current page object.
public class BaseStep : Steps
{
protected RemoteWebDriver Driver {
get
{
return ScenarioContext.Current.Get<RemoteWebDriver>();
}
set
{
ScenarioContext.Current.Set(value);
}
}
protected BasePageObject CurrentPageObject
{
get
{
return ScenarioContext.Current.Get<BasePageObject>();
}
set
{
ScenarioContext.Current.Set(value);
}
}
}
I do not want to write one step definition for each scenario as it is reusing a lot of code that I would rather be in a single method. So how can I reuse the step definitions and still use the page object pattern?
Thanks.
you can do this by exposing a property on your base page object which allows iteration of all controls on the current page (via reflection probably, but how you implement this is irrelevant as long as it works).
Once you have this then you can implement the step by calling this property looking for the link with the name given in the step ('link1' or 'link2') and then clicking this.
Whilst this will work, I would recommend that you should try and refrain from making your scenarios so specific to the implementation. Rather than "when I click 'link1'" it is better to have something that is more descriptive of the intention then the implmentation, "when I go to the basket" or "when I navigate to my account details". This isn't so reusable, but it is also resistent to refactoring of your design, and allows your steps to be reused for different devices when 'clicking' a link doesn't make sense (like touch devices)
I would be also very interested in the opinion and practices of others, but here are my thoughts.
If you go for a generic "When I click '([^']*)'" binding, you have not much information in the generic When what the current scenario is about. Still you can try to "wait" for the next page loaded, and you can check the (IWebDriver) Url to figure out where you are (according to the browser). You will need a mapping between the Url and your page objects to be able to select the current page object appropriately. You can build up a mapping manually for this purpose, you can use some conventions, or you can use other existing "mapping information" like the ASP.NET routing or a site map, or most probably some mixture of these. ;)
Another possibility is to defer the evaluation of the current url to the Then, but in this case probably the CurrentPageObject property getter should encapsulate this. What I mean is that the value of the property should not depend on whether you "call" a certain Then or not.
I tried a slightly different approach in one of my last projects. I wrote more specific When statements for my scenarios, so instead of "When I click 'Search'", "When I click 'Order'" or "When I click 'Confirm'" I had "When I fire the search with the parameters filled in", "When I order the items selected", or "When I confirm the order". Since these statements described a concrete action, I delegated them to the current page object (casted to the concrete page in question), where the page object had concrete methods for these actions. The implementation not only "clicked" the appropriate button (base functionality), but it also waited for the page load and set the current page object appropriately. In such concrete cases it was either obvious what the "next" current page object is, or I could more or less easily check what had happened, if there were more possible outcomes. The price I paid was that it was not just a single generic When step definition for clicking, the benefit (besides the one explained above) was that the phrasing of the scenarios was more focused on the user intention and not on the concrete UI-control-level interaction (performing an action vs. clicking something)

Initialize task form fields with infopath form values

I'm trying to initialize a task form (in my workflow) with values contained in my infopath form (the global one if I could call it like this ^^).
For example, I've a worflow which is activated on a command from a client. The first task is assigned to the client, he has to fill in a form with some values (command name, adress, ...).
Next, I save those values to my "global" infopath form. It works.
After that, I create a task for the command manager who get a summary of the command and he has to validate it or not. In this form, I want to retrieve values from the global form. This is the problem.
I tried to use a data connection on the global infopath form and set the default value of the field in the task form. For example, the command name : #CommandName. And it doesn't retrieve any value...
I don't know if you need more information and if you guys understand my question cause it can be a bit confused. So don't hesitate to ask me question to clarify.
This issue is solved now.
My workaround :
Define a Content Type for each fields.
Add extended properties to the task with the name of your field :
myTaskProperties.ExtendedProperties["myFieldName"] = "my expected value";
This is the way to pre-fill your form by the code.
To retrieve data from your global infopath form :
I've a method which do that. This method is going to read the xml (my global infopath) and get the value. After that, I add this value instead of "my expected value" above.
If you want more explanation or code, don't hesitate to contact me.

Resources