...
In the Workspace tree of Solution Explorer, right-click the Package node where you want to create the Workflow and select New BotFlow > Conversation BotFlow from the context menu.
In the Workflow designer, the BasicBotFlowTemplate will load with basic activity shapes.
We will now convert the Flow Chart Workflow into a BotFlow. Click on the Properties tab of the Workflow and change the WorkflowType property to BotFlow.activity shapes.
Before you move ahead with the development of BotFlow, you will need to clean up the default activity and events added by Botflow.
Delete the three activities (askQuestion1, askQuestion2, and showResponses) from the Botflow. To delete an activity, you can Right-click on the activity and select the Delete item from the context menu.
Delete all three support classes (MyUserData, OnAgeComplete, OnNameComplete). Select the Solution tab and expand the My Support Classes folder in the Code Tree. Right-click on the class file, and from the context menu, select the Delete Item to delete the file. Please make sure all three classes are deleted.
Delete the two event handlers (OnAgeComplete and OnNameComplete) generated by the template. Select the Solution tab, expand the Event Handlers folder, Right-Click on the event handler and delete and from the context menu, select the Delete Item to delete the file. Please make sure both handlers are deleted.
Save the BotFlow with an appropriate name. Click on the Save icon, provide a File Name in the dialog, and click the Save button. In the screenshot below, we are saving the Workflow with the Name ActivatePreApprovedGroupWorkflow.
Insert excerpt IL:Folder Structure Callout IL:Folder Structure Callout name FolderStructure nopanel true Once you save the BotFlow, the WFS will reload the Activity.
Let’s add an activity. Click on the Activities Tab and Search for SystemCodeActivity. Drag and drop the Activity to the designer window.
Select the Activity, click on the Properties tab and change the Name to meaningful. In this example, we renamed it as SetResourceOptions.
Add the following snippet of the code. Double-click on the SetResourceOptions and replace the codes of the Implement method. You will also need to include the “TheDotNetFactory.Framework.BotWF.Common” library with a using statement to use bot features like HeroCard.
Code Block using TheDotNetFactory.Framework.BotWF.Common;
Code Block [TheDotNetFactory.Framework.Common.ActivityEventHandlerPostSharpAttribute()] public virtual void Implement(object sender, System.EventArgs e) { //TODO: Implementation goes here! BotHeroCard botHeroCard = new BotHeroCard { Title = "BotRequestAppAndMgmtRolesTitle".ToEidResxString(), Text = "BotRequestAppAndMgmtRolesDescription".ToEidResxString(), Buttons = new List<BotCardAction> { new BotCardAction { Type = BotActionTypes.ImBack, Title = "ITShop_Common_ApplicationRole".ToEidResxString(), Value = "ApplicationRole" }, new BotCardAction { Type = BotActionTypes.ImBack, Title = "ITShop_Common_ManagementRole".ToEidResxString(), Value = "ManagementRole", } } }; this.CurrentWorkflow.ResourceOptions.HeroCard = botHeroCard; }
Click on the Activities Tab and Search for BotHeroCardActivity. Drag and drop the Activity to the designer window. Please rename it to reflect its purpose. We have renamed it to ResourceOptions.
Please make sure that all the activities are connected with lines. The Workflow should look similar to the image below.
Click on the compile button to compile the Workflow.
...
Click on the Compile button in Workflow Studio to compile the Workflow.
Click on the ▶️ Compile and Publish button and complete the necessary step to publish a Workflow if you haven’t already.
If you have already uploaded the Botflow by following the instructions in the section Publish & Test BotFlow from EID Chatbot, proceed to the next step to test the BotFlow, or else complete the steps provided in that section to publish it. You can also print the Botflow using the EmpowerID Web UI. Instructions to publish Workflow Studio items using Web UI are provided here.
Type the Name of Botflow in your Ms-Teams and follow the instructions of the Chatbot. You should see the output of the Botflow you created.
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
...