Skip to main content
Version: Next

Project Schema

The Project Schema (project-schema.json) defines the overall structure of a Brobot Runner project configuration. This schema represents the "what" of your automation - the states, transitions, and UI elements that make up your automation environment.

Root Properties

PropertyTypeRequiredDescription
idintegerYesUnique identifier for the project
namestringYesName of the project
descriptionstringNoOptional description of the project
versionstringNoVersion of the project configuration (format: x.y.z)
createdstring (date-time)NoWhen the project was created
updatedstring (date-time)NoWhen the project was last updated
statesarrayYesStates defined in the project
stateTransitionsarrayYesTransitions between states
automationobjectNoAutomation configuration
configurationobjectNoProject-wide configuration settings

States

States represent distinct screens or conditions in your application. Each state contains visual elements that can be detected during automation.

Example state definition:

{
"id": 1,
"name": "LoginScreen",
"stateText": ["Welcome", "Login"],
"blocking": true,
"canHide": [2, 3],
"pathScore": 1,
"baseProbabilityExists": 100,
"stateImages": [
{
"id": 1,
"name": "LoginButton",
"patterns": [
{
"name": "blueLoginBtn",
"imgPath": "images/login_blue.png",
"fixed": true
}
]
}
]
}

State Properties

PropertyTypeDescription
idintegerUnique identifier for the state
namestringName of the state
stateTextarray of stringsText associated with this state
blockingbooleanIf true, this state needs to be acted on before accessing other states
canHidearray of integersStates that this state can hide when it becomes active
pathScoreintegerLarger path scores discourage taking a path with this state
baseProbabilityExistsintegerBase probability that the state exists (0-100)
usableAreaobjectRegion defining the usable area of the state

GUI Elements
The project schema supports various GUI elements that can be associated with states:
State Images
Images that can be detected in a state:

{
"id": 5,
"name": "SubmitButton",
"shared": false,
"patterns": [
{
"name": "blueSubmit",
"imgPath": "images/submit_blue.png",
"fixed": true,
"searchRegions": [
{"x": 100, "y": 200, "w": 300, "h": 100}
]
}
]
}

Pattern Properties

PropertyTypeDescription
namestringName of the pattern
imgPathstringPath to the image file
fixedbooleanIf true, this image should always appear in the same location
dynamicbooleanIf true, this pattern cannot be found using pattern matching
searchRegionsarrayRegions to search for this pattern
fixedRegionobjectFixed region where this pattern appears
targetPositionobjectTarget position within the pattern
targetOffsetobjectOffset for click or drag operations

State Regions
Regions define rectangular areas within the GUI:

{
"id": 3,
"name": "UsernameField",
"searchRegion": {
"x": 100,
"y": 200,
"w": 200,
"h": 30
}
}

State Locations
Locations define specific points:

{
"id": 2,
"name": "CloseButton",
"location": {
"x": 800,
"y": 50
}
}

State Strings
Strings define text that can be entered or detected:

{
"id": 1,
"name": "Username",
"string": "admin"
}

State Transitions
State transitions define how to move from one state to another using actions.

{
"id": 1,
"sourceStateId": 1,
"stateImageId": 1,
"actionDefinition": {
"steps": [
{
"actionOptions": {
"action": "CLICK",
"clickType": "LEFT"
},
"objectCollection": {
"stateImages": [1]
}
}
]
},
"statesToEnter": [2],
"statesToExit": [1],
"staysVisibleAfterTransition": "FALSE"
}

Transition Properties

PropertyTypeDescription
idintegerUnique identifier for the transition
sourceStateIdintegerThe state from which the transition starts
stateImageIdintegerOptional state image associated with the transition
actionDefinitionobjectDefinition of actions to perform during the transition
staysVisibleAfterTransitionstringWhether the source state stays visible after the transition
statesToEnterarrayStates to enter after the transition
statesToExitarrayStates to exit after the transition
scoreintegerScore for path planning

Action Definitions and Steps
Action definitions contain sequences of steps that perform GUI operations. Each step combines action options with objects to act upon.

{
"steps": [
{
"actionOptions": {
"action": "FIND",
"find": "FIRST",
"similarity": 0.8,
"maxWait": 5
},
"objectCollection": {
"stateImages": [5, 6]
}
},
{
"actionOptions": {
"action": "CLICK"
},
"objectCollection": {
"stateImages": [5]
}
}
]
}

Action Options
ActionOptions configure how actions are performed. As noted in the design notes, complex actions like DRAG may utilize multiple ActionOptions variables.
Common Action Options

OptionTypeDescription
actionenumThe action to perform (FIND, CLICK, DRAG, etc.)
findenumHow to find objects (FIRST, BEST, ALL, etc.)
similaritynumberMatch similarity threshold (0.0-1.0)
maxWaitnumberMaximum time to wait in seconds
clickTypeenumType of click (LEFT, RIGHT, DOUBLE_LEFT, etc.)

Configuration Project-wide configuration settings:

{
"minSimilarity": 0.7,
"moveMouseDelay": 0.5,
"delayBeforeMouseDown": 0.3,
"imageDirectory": "images",
"logLevel": "INFO",
"illustrationEnabled": true
}