I'm designing Watson dialog to support following scenario: user to select intent 1,2, or 3. When user select intent 2, Watson will ask user to specify either option 1 or 2 or alternatively other valid intents.
Following is my current dialog file:
<?xml version="1.0" encoding="UTF-8"?>
<dialog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.0.xsd">
<flow>
<folder label="Main" id="Main">
<output id="start">
<prompt selectionType="RANDOM">
<item>DIALOG START - asking for user input</item>
</prompt>
<goto ref="processUserInput_start"/>
</output>
<getUserInput id="processUserInput_start">
<search ref="library_supported-intents"/>
<default>
<output>
<prompt selectionType="RANDOM">
<item>I am sorry, I did not understand your intents. Please choose intent1, intent2, or intent3.</item>
</prompt>
</output>
</default>
</getUserInput>
<getUserInput id="processUserInput_intent2">
<search ref="library_supported-intents"/>
<input>
<grammar>
<item>option1</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 2 with option 1</item>
</prompt>
</output>
<goto ref="processUserInput_start"/>
</input>
<input>
<grammar>
<item>option2</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 2 with option 2</item>
</prompt>
</output>
<goto ref="processUserInput_start"/>
</input>
<output>
<prompt selectionType="RANDOM">
<item>Sorry, I can only understand option1 and option2 for intent2. Try again</item>
</prompt>
<goto ref="processUserInput_intent2"/>
</output>
</getUserInput>
</folder>
<folder label="Library" id="Library">
<folder label="Main Input" id="library_supported-intents">
<input>
<grammar>
<item>intent1</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 1</item>
</prompt>
</output>
</input>
<input>
<grammar>
<item>intent2</item>
</grammar>
<goto ref="intent2-detail"/>
</input>
<input>
<grammar>
<item>intent3</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 3</item>
</prompt>
</output>
</input>
</folder>
<folder label="Intent 2 Input" id="library_intent2">
<output id="intent2-detail">
<prompt selectionType="RANDOM">
<item>OK. I need further info to execute intent 2. Choose option1 or option2</item>
</prompt>
<goto ref="processUserInput_intent2"/>
</output>
</folder>
</folder>
<folder label="Concepts" id="Concepts"></folder>
</flow>
</dialog>
Unfortunately, I could not get appropriate invalid dialog message being displayed - e.g. Watson shows invalid option instead of invalid intent message, as following:
How should I structure recovery dialog flow to achieve above scenario?
try to put the goto inside the output node
<input>
<grammar>
<item>option1</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 2 with option 1</item>
</prompt>
<goto ref="processUserInput_start"/>
</output>
</input>
Related
I have a existing user flow which is working as expected with verify code and continue button action. Currently the issue is user has to click so many action buttons to login if MFA is enabled. So the expected user flow should skip or bypass the step of continue where verify action button will handle both validation of otp as well as continue user flow in single click. I am trying to combine step to verify code and continue button in one action. Any kind of help is appreciated and thanks in advance. Attaching image for better understanding too. Below is my code
<DisplayControls>
<DisplayControl Id="emailVerificationControl" UserInterfaceControlType="VerificationControl">
<DisplayClaims>
<DisplayClaim ClaimTypeReferenceId="email" Required="true" />
<DisplayClaim ClaimTypeReferenceId="verificationCode" ControlClaimType="VerificationCode" Required="true" />
</DisplayClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="email" />
</OutputClaims>
<Actions>
<Action Id="SendCode">
<ValidationClaimsExchange>
<ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SelfAsserted-GenerateOtp" />
<ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SendGridSendOtp" />
</ValidationClaimsExchange>
</Action>
<Action Id="VerifyCode">
<ValidationClaimsExchange>
<ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SelfAsserted-VerifyOtp" />
</ValidationClaimsExchange>
</Action>
</Actions>
</DisplayControl>
<ClaimsProvider>
<DisplayName>SelfAsserted-VerifyOtp</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="SelfAsserted-VerifyOtp">
<DisplayName>Verify one time password</DisplayName>
<Protocol
Name="Proprietary"
Handler="Web.TPEngine.Providers.OneTimePasswordProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
/>
<Metadata>
<Item Key="Operation">VerifyCode</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="email" PartnerClaimType="identifier" />
<InputClaim ClaimTypeReferenceId="verificationCode" PartnerClaimType="otpToVerify" />
</InputClaims>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
<ClaimsProvider>
<DisplayName>SelfAsserted-GenerateOtp</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="SelfAsserted-GenerateOtp">
<DisplayName>Generate one time password</DisplayName>
<Protocol
Name="Proprietary"
Handler="Web.TPEngine.Providers.OneTimePasswordProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
/>
<Metadata>
<Item Key="Operation">GenerateCode</Item>
<Item Key="CodeExpirationInSeconds">1200</Item>
<Item Key="CodeLength">6</Item>
<Item Key="CharacterSet">0-9</Item>
<Item Key="ReuseSameCode">true</Item>
<Item Key="NumRetryAttempts">5</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="email" PartnerClaimType="identifier" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="otp" PartnerClaimType="otpGenerated" />
</OutputClaims>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
Existing User Flow
Expected User Flow
You cannot merge the Verify code and Continue buttons in one button using Custom Policy. You need to work with a front-end developer to use a custom HTML page for your signup/sign-in with JavaScript/CSS for this purpose.
You may consider using JavaScript MutationObserver to detect that the Continue button has been enabled, then automate the clicks with javascript
we are trying to set a custom user attribute
we have managed to show to define it the TrustFrameworkExtensions.xml ClaimsSchema
<ClaimType Id="extension_GDPR_CONSENT">
<DisplayName>extension_GDPR_CONSENT</DisplayName>
<DataType>string</DataType>
<UserInputType>CheckboxMultiSelect</UserInputType>
<Restriction>
<Enumeration Text="Accept" Value="true" SelectByDefault="false" />
</Restriction>
</ClaimType>
and also we menaged to show in our signup form
<DisplayName>Local Account</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
<DisplayClaims>
<DisplayClaim DisplayControlReferenceId="emailVerificationControl"/>
<!--DisplayClaim ClaimTypeReferenceId="displayName" Required="true" />
<DisplayClaim ClaimTypeReferenceId="givenName" Required="true" />
<DisplayClaim ClaimTypeReferenceId="surName" Required="true" /-->
<DisplayClaim ClaimTypeReferenceId="newPassword" Required="true" />
<DisplayClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
<DisplayClaim ClaimTypeReferenceId="extension_GDPR_CONSENT" Required="true" />
We have also updated the
<TechnicalProfile Id="AAD-UserWriteUsingLogonEmail">
<Metadata>
<Item Key="Operation">Write</Item>
<Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">true</Item>
</Metadata>
<IncludeInSso>false</IncludeInSso>
<InputClaims>
<InputClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" Required="true" />
</InputClaims>
<PersistedClaims>
<!-- Required claims -->
<PersistedClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" />
<PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password"/>
<PersistedClaim ClaimTypeReferenceId="displayName" DefaultValue="TestCustomPolicy" />
<PersistedClaim ClaimTypeReferenceId="passwordPolicies" DefaultValue="DisablePasswordExpiration" />
<PersistedClaim ClaimTypeReferenceId="extension_GDPR_CONSENT"/>
Adding the directory extension to the persistent claim
But it gives us a validation error?
Regards
To enable extension attributes in the custom policy, provide Application ID and Application Object ID in the AAD-Common technical profile metadata.
<ClaimsProvider>
<DisplayName>Azure Active Directory</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="AAD-Common">
<Metadata>
<!--Insert b2c-extensions-app application ID here, for example: 11111111-1111-1111-1111-111111111111-->
<Item Key="ClientId"></Item>
<!--Insert b2c-extensions-app application ObjectId here, for example: 22222222-2222-2222-2222-222222222222-->
<Item Key="ApplicationObjectId"></Item>
</Metadata>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
Check Out the link to know more : https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-flow-custom-attributes?pivots=b2c-custom-policy
From the Watson Dialog document, it indicates the configuration setups for connecting with NLC. But it is hard to understand how this works without a running sample application. Most of examples can be googled are without such settings. I were trying to find some examples which using the indicated setups from 'classifier' settings and 'INTENT:{xxxxxx}' settings etc. per docuemnt . It will be great if someone could help on this, very appreciated.
Here is an example using the demo NLC training data. Save that text to a CSV file.
Create your NLC service. Name of the service doesn't matter.
Once created, click the "Access Beta Toolkit". You will need to login again, and allow the toolkit access to the NLC service.
Click the "Upload training data" button. Select your CSV file you saved earlier. If it works, you will see your intents + questions. If it fails, most common issue is not giving it a csv file extension.
Click "Create classifier". Name is not important.
Clicking training data/classifiers to see if it has finished compiling. It can take some time to complete.
Once the classifier finishes compiling it should show you the classifier id value. Example: 3d84bfx43-nlc-10356
Copy the text below to an XML file. Where you see CLASSIFIER_ID_GOES_HERE change to your classifier id.
<?xml version="1.0" encoding="UTF-8"?>
<dialog xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<flow>
<folder label="Main">
<output>
<prompt selectionType="RANDOM">
<item>Enter your weather related question.</item>
</prompt>
<getUserInput>
<search ref="folder_200143"/>
<default>
<output>
<prompt selectionType="RANDOM">
<item>I couldn't determine what you are asking about.</item>
</prompt>
</output>
</default>
</getUserInput>
</output>
</folder>
<folder label="Library">
<folder label="NLC Intents" id="folder_200143">
<input isAutoLearnCandidate="false" isRelatedNodeCandidate="true">
<grammar>
<item>conditions</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>I believe you are asking about conditions. </item>
</prompt>
</output>
</input>
<input>
<grammar>
<item>temperature</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>I believe you are asking about temperture. </item>
</prompt>
</output>
</input>
</folder>
</folder>
<folder label="Global"/>
<folder label="Concepts"/>
</flow>
<constants>
<var_folder name="Home"/>
</constants>
<variables>
<var_folder name="Home">
<var name="CLASSIFIER_CLASS_0" type="TEXT" description="auto-created"/>
<var name="CLASSIFIER_CONF_0" type="TEXT" description="auto-created"/>
<var name="CLASSIFIER_CLASS_1" type="TEXT" description="auto-created"/>
<var name="CLASSIFIER_CONF_1" type="TEXT" description="auto-created"/>
</var_folder>
</variables>
<settings>
<setting name="AUTOLEARN" type="USER">false</setting>
<setting name="LANGUAGE" type="USER">en-US</setting>
<setting name="RESPONSETIME" type="USER">-2</setting>
<setting name="MAXAUTOLEARNITEMS" type="USER">4</setting>
<setting name="NUMAUTOSETRELATED" type="USER">0</setting>
<setting name="TIMEZONEID" type="USER">Australia/Sydney</setting>
<setting name="AUTOSETRELATEDNODEID" type="USER">0</setting>
<setting name="INPUTMASKTYPE" type="USER">0</setting>
<setting name="CONCEPTMATCHING" type="USER">0</setting>
<setting name="DNR_NODE_ID">-15</setting>
<setting name="MULTISENT">0</setting>
<setting name="USE_CONCEPTS">3</setting>
<setting name="ENTITIES_SCOPE">3</setting>
<setting name="USER_LOGGING">2</setting>
<setting name="USE_TRANSLATIONS">3</setting>
<setting name="USE_STOP_WORDS">3</setting>
<setting name="USE_SPELLING_CORRECTIONS">3</setting>
<setting name="USE_AUTOMATIC_STOPWORDS_DETECTION">0</setting>
<setting name="PLATFORM_VERSION">10.1</setting>
<setting name="UI_COLOUR"></setting>
<setting name="PARENT_ACCOUNT"></setting>
<setting name="AL_NONE_LABEL">None of the above</setting>
<setting name="CLS_SEARCH_MODE">0</setting>
<setting name="CLS_MODEL">0</setting>
<setting name="CLS_ENDPOINT"></setting>
<setting name="CLS_USERNAME"></setting>
<setting name="CLS_PASSWORD"></setting>
<setting name="CLS_MODELNAME">CLASSIFIER_ID_GOES_HERE</setting>
<setting name="CLS_ADVANCED_SETTINGS">false</setting>
<setting name="CLS_MAXNBEST">3</setting>
<setting name="CLS_USE_OFFTOPIC">false</setting>
<setting name="DEFAULT_DNR_RETURN_POINT_CANDIDATE">-1</setting>
</settings>
<specialSettings>
<specialSetting label="DNR Join Statement">
<variations/>
</specialSetting>
<specialSetting label="AutoLearn Statement">
<variations/>
</specialSetting>
</specialSettings>
</dialog>
Upload that file to your dialog service and test it.
I have a Wpf solution that is composed of 2 projects one of them is the windows application and the other is a class library. When I try to create the installer it works fine but when I run the app it crashes.
When I put all the code in a single project it all works just fine.
So, how do I make it work when there are multiple projects?
My Product.wxs is:
<Product Id="8748CF04-E8D3-4A2B-B3F5-22E50B3A8E49"
Name="MyApp" Language="1033" Version="1.0.0.0" Manufacturer="My System Pvt Ltd"
UpgradeCode="8748CF04-E8D3-4A2B-B3F5-22E50B3A8E49">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
InstallPrivileges="elevated" ReadOnly="yes"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<!--Add Cab1.cab File inside the Package-->
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />
<!--Here We Install Our Main App-->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MY System Pvt Ltd"/>
</Directory>
<!-- Step 1: For the Program Menu -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="My System Pvt Ltd"/>
</Directory>
<!--Step 2:For Desktop Folder-->
<Directory Id="DesktopFolder"/>
<!--Step 3:For StartUp Folder-->
<Directory Id="StartupFolder"/>
</Directory>
<!--Step 4 :Add Main App exe-->
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="myapplication.exe" Guid="84C5B9E8-FD90-4EA8-A502-B08AC9B38D39">
<File Source="C:\Users\petric\Downloads\Compressed\WixDemoWPFAppVS2012\WixDemoWPFAppVS2012\WixDemoWPFAppVS2012\WpfApplication2\bin\Debug\WpfApplication2.exe" Name="MYApp.exe"
Id="MyAppEXE" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!-- Step 1.1: Add the shortcut to your installer package Program Menu or Start Menu-->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="1A437020-D5C9-450C-9B3D-33957994780A">
<!--Add Shortcut of the Application in start Menu-->
<Shortcut Id="ApplicationStartMenuShortcut" Name="MyApp" Description="My Application Description"
Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER">
<!--Add Icon to the ShortCut-->
<Icon Id="MYPMenuIcon" SourceFile=".\Desktop.ico" />
</Shortcut>
<!--Remove the Folder At time of Uninstall-->
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!-- Step 2.1: Add the shortcut to your installer package For DeskTop-->
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDeskShortcutComp" Guid="40127963-856D-460D-9E1B-4C10EB65835B">
<Shortcut Id="ApplicationDeskShortcut" Name="MYAppDesk"
Description="My Application Description" Target="[INSTALLFOLDER]MyApp.exe"
WorkingDirectory="INSTALLFOLDER">
<Icon Id="MYDeskIcon" SourceFile=".\Desktop.ico" />
</Shortcut>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!--Step 3.1: add Shortcut to StartUp Folder to run application when you login-->
<DirectoryRef Id="StartupFolder">
<Component Id="ApplicationStartUpShortcutComp" Guid="843B6A2E-AB61-40C7-BE49-FBCD7F81E35D">
<Shortcut Id="ApplicationStartUpDeskShortcut" Name="MYAppDesk" Description="My Application Description"
Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER">
<Icon Id="MyIconStartUp" SourceFile=".\Desktop.ico" />
</Shortcut>
<RemoveFolder Id="StartupFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!--Add Component-->
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myapplication.exe" />
<!--Step 1.2:Add Start menu or program Shortcut-->
<ComponentRef Id="ApplicationShortcut" />
<!--step 2.2Add DeskTop Shortcut-->
<ComponentRef Id="ApplicationDeskShortcutComp" />
<!--step 3.2Add DeskTop Shortcut-->
<ComponentRef Id="ApplicationStartUpShortcutComp"/>
</Feature>
I followed this tutorial :
http://www.c-sharpcorner.com/UploadFile/cb88b2/getting-started-with-wix-windows-installer-xml-in-vs2012/
Well I figured it out myself eventually
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="myapplication.exe" Guid="84C5B9E8-FD90-4EA8-A502-B08AC9B38D39">
<File Source="C:\Users\petric\Downloads\Compressed\WixDemoWPFAppVS2012\WixDemoWPFAppVS2012\WixDemoWPFAppVS2012\WpfApplication2\bin\Debug\WpfApplication2.exe" Name="MYApp.exe"
Id="MyAppEXE" KeyPath="yes"/>
</Component>
</DirectoryRef>
should be writen as :
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="myapplication.exe" Guid="84C5B9E8-FD90-4EA8-A502-B08AC9B38D39">
<File Source="$(var.WpfApplication2.TargetPath)" Name="MYApp.exe"
Id="MyAppEXE" KeyPath="yes"/>
</Component>
<Component>
<File Id="dotNetClass.Output"
Name="WpfApplication3.dll"
Source="$(var.WpfApplication3.TargetPath)"
KeyPath="yes" />
</Component>
</DirectoryRef>
to include some dll of a project called WpfApplication3.
I'm trying to implement factorial in the xml language of xcerion.
<step id="fac">
<alias name="p" value="={$n}*{$p}" />
<alias name="n" value="={$n}-1" />
<operation name="decision">
<when test="'{$n}'>'0'" step="fac" />
</operation>
</step>
<alias name="p" value="1" />
<alias name="n" value="4" />
<operation name="call" value="fac" />
My code works, but I think it's a bit wordy.
How does this language compare with other xml languages?
Especially handling of variables, selection, loops and subroutine calling.