Introduction to the "State" Activity
Table of Contents
- Activity Program Name
- Description
- Properties
- Usage
1. Activity Program Name
System.Activities.Statements.State
2. Description
For Studio versions up to 2.0.2.0:
Quick Access: Toolbox
> State Machine
> State
From Studio version 2.0.3.0 onwards:
Quick Access: Toolbox
> System
> State Machine
> State
This activity is used within a "State Machine". It contains three sections: Entry, Exit, and Transition.
*Verified on akaBot Studio versions: 2.2.0.5
*The wording may vary slightly depending on the version.
3. Properties
Property item | Property name | Input field | Description |
---|---|---|---|
Other | Display name | Any String | Reflected as the activity name in the designer panel. |
The sections displayed on the designer panel are as following
Section | Description |
---|---|
Entry | Place activities to be executed within the state |
Exit | Place activities to be executed when the state ends |
Transition(s) | Automatically display relationships with other states |
4. How to Use
This section introduces an example of using the “State” to execute or confirm tasks based on time. To use the “State” activity, a “State Machine” must be placed first.
Start by dragging and dropping System > State Machine > State Machine onto the design panel.
For instructions on how to place a “State Machine”, please refer to this guide.
Next, drag and drop System > State Machine > State onto the design panel, connect it with a transition line, and then double-click on this “State”.
Drag and drop System > Original > Assign into the "Entry" section.
In the properties, under Others > To enter a String type variable (in this example, it is currentTime
) and specify the Value as well.
In this example, DateTime.Now.ToString("HH:mm:ss")
is entered for the value.
For more details on variable creation, please refer to "Creating Variables."
Return to the State Machine, and once again, drag and drop System > State Machine > State to place it, then connect it using a transition line.
Double-click on the part labeled "T1" on the transition line connecting the first "State" and the second "State".
In the "Condition" under "Misc" in the properties, enter an expression (in this example, currentTime < "14:00:00"
).
To check the execution result, place "Write Line" from "System" > "Custom" in the Action section and configure the necessary variables, etc.
※ In this example, the String variable currentTime
is entered.
Return to the "State Machine" and double-click the second "State".
In the "Entry" section, drag and drop "Write Line" from "System" > "Original", and configure the necessary variables.
In this example, the string "Tasks before 2pm" is entered.
Next, drag and drop "Open Browser" from "Browser", and place it.
In the Properties panel, click on "General" > "Close the browser on completion or error" and uncheck it. Then, in "Input" > "URL", enter a string or a String-type variable (in this example, the string "https://support.akabot.com/support/home").
Return to the State Machine and then drag and drop another State from System > State Machine > State and connect it with a transition line.
Double-click the part labeled T1 on the transition line connecting the State and the third State.
In the properties, enter the expression (in this example, currentTime > "14:00:00"
) in Other > Condition, and then change the DisplayName from T1 to T2.
Note: The text in DisplayName can be changed to any arbitrary string.
To check the execution results, place System > Original > Write Line and set the necessary variables, etc.
In this example, the String type variable currentTime
is input.
Double-click the third "State" again.
Drag and drop the "Write Line" activity from "System" > "Original" into the "Entry" section and configure the necessary variables.
In this example, the string "Please check your tasks after 14:00" is entered.
Return to the "State Machine," and finally, drag and drop the "Final State" from "System" > "State Machine." After placing it, double-click this "Final State."
Drag and drop the "Message Box" from "Core" > "Dialog" into the "Entry" section and place it.
In the properties, under "Input" > "Text," enter a string or a String type variable (in this example, enter the string "The workflow has been executed").
Return to the "State Machine" and connect the two "States" to the "Final State" with transition lines.
In this example, no settings are applied to these transition lines. Therefore, when the "State" is executed, the contents set in the "Final State" will be executed immediately.
Click "Home > Start" or press the "F5 key" to execute the workflow.
■ When executed before 2:00 PM
The Kobot Portal page will open, and then a "Message Box" will display with the message "The workflow has been executed." Additionally, open the output panel to confirm that the executed time and the message "Tasks before 2pm" are displayed.
■ When executed after 14:00 PM
A "Message Box" will display with the message "The workflow has been executed." Then, open the output panel to confirm that the executed time and the message "Please check your tasks after 14:00" are displayed.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article