Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Can a Launch rule 'self-inspect' ?

Avatar

Avatar
Springboard
MVP
StewSchilling
MVP

Likes

334 likes

Total Posts

272 posts

Correct Reply

84 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile

Avatar
Springboard
MVP
StewSchilling
MVP

Likes

334 likes

Total Posts

272 posts

Correct Reply

84 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile
StewSchilling
MVP

29-11-2017

Is there a way to self-inspect from within a rule condition?

For instance,

     1) Can I access the rule name and log it to the console?  

     2) Within a custom event rule can I get at the event type on which the condition will be met?

    

in other words ,

if (_satellite._container.rules[0].events[0].modulePath === "core/src/lib/events/customEvent.js")  {

     console.log ( _satellite._container.rules[0].events[0].settings.type );

}

Yes, I know these are internals.  I'm wondering if the information is accessible in a supported manner.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Employee
Aaronius9er9er9
Employee

Likes

34 likes

Total Posts

44 posts

Correct Reply

16 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Employee
Aaronius9er9er9
Employee

Likes

34 likes

Total Posts

44 posts

Correct Reply

16 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
Aaronius9er9er9
Employee

06-12-2017

#1 No, not currently.
#2 Yes. The custom code condition and custom code action both have access to an event object that contains potentially useful data about the event that triggered the rule. Try this: console.log(event.type);

Answers (0)