Magidoc

Introducing Reactions:

Reactions are a powerful feature within our platform that allow you to automate specific actions in response to events happening within your data. Think of them as "if-then" rules: if a certain event occurs, then a specific action will be performed.

How Reactions Work

#

Reactions consist of two main components:

  • Event: The trigger that initiates the Reaction. This could be anything from a new job being created to a device going offline.
  • Action: The custom JavaScript script that is executed when the Event occurs. This could be something simple like sending a notification or something more complex like running a data analysis.

Benefits of Using Reactions

#

  • Automation: Reactions automate tasks that you would otherwise have to do manually, saving you time and effort.
  • Efficiency: Reactions streamline your workflow by ensuring that the right actions are taken automatically in response to events.
  • Flexibility: Reactions are highly customizable, allowing you to create rules that fit your specific needs.
  • Integration: Reactions can be used to integrate with other parts of our platform or with external services.

Examples of How Reactions Can Be Used**

#

  • Job Management: Automatically assign jobs to the appropriate team member based on the job's due date or priority.
  • Device Monitoring: Receive alerts when a device goes offline or experiences an error.
  • Data Analysis: Run custom scripts to analyze your data and generate reports.
  • Customer Communication: Send automated notifications to customers about the status of their orders.

Getting Started with Reactions

#

To create a Reaction, you first need to define the Event that will trigger it. Then, you need to write the JavaScript code that will be executed when the Event occurs. Our platform provides a comprehensive API that you can use to interact with your data and perform various actions.

In Summary

#

Reactions are a versatile tool that can be used to automate a wide range of tasks within our platform. By streamlining your workflow and freeing up your time, Reactions can help you to be more efficient and productive.

  • Included in your account: Reactions are a standard feature of our platform, so you can start using them right away without any additional cost.
  • Extremely low latency: Reactions are processed within our platform, so there is very little delay between the Event occurring and the Action being executed.
  • No limits to parallel processing: You can create as many Reactions as you need, and they will all be processed in parallel. This means that you can automate a large number of tasks without worrying about performance issues.

Schema

#

Facts

#

Facts are the data that should be tested. The available facts depend slightly on the lifecycle event being reacted to, and some are always available.

Conditions

#

Types of Operators

#

Suggestions of more operators are gratefully received. [cite: 51]

Name
Types
Description
Status
equal
fact: any value: any
Is the fact equal to the value provided
Available
notEqual
fact: any value: any
Is the fact not the value provided
Available
stringContains
fact: string value: string
Is the value contained within the fact
Available
stringEnds
fact: string value: string
Does the fact end with the value
Available
stringStarts
fact: string value: string
Does the fact start with the value
Available
stringMatches
fact: string value: string value must be a valid JS regexp
Does the fact match the provided Regexp.
Available
stringDoesNotMatch
fact: string value: string value must be a valid JS regexp
Does the fact not match the provided Regexp
Available
contains
fact: T value: T
Is the value provided within the fact?
Available
doesNotContain
fact: T value: T
Is the valid provided absent from the fact?
Available
in
fact: T value: T
Is the fact one of the values provided?
Available
notIn
fact: T value: T
Is the fact absent from the values provided?
Available
greaterThan
fact: number value: number
Is the fact larger than the value provided?
Available
greaterThanInclusive
fact: number value: number
Is the fact larger than or equal to the value provided?
Available
lessThan
fact: number value: number
Is the fact less than the value provided?
Available
lessThanInclusive
fact: number value: number
Is the fact less than or equal to the value provided?
Available
today
fact: Date
Is the fact today
Available
thisWeek
fact: Date
Is the fact during this week?
Available
lastWeek
fact: Date
Is the fact during the previous week?
Available
nextWeek
fact: Date
Is the fact during the next week?
Available
thisMonth
fact: Date
Is the fact during this month?
Available
lastMonth
fact: Date
Is the fact during the previous month?
Available
nextMonth
fact: Date
Is the fact during the next month?
Available
after
fact: Date value: Date
Is the fact after the date provided?
Available
before
fact: Date value: Date
Is the fact before the date provided?
Available

Single condition

#

    
  

AND condition

#

    
  

OR condition

#

    
  

AND NOT condition

#

    
  

Complex AND NOT condition

#