HI,
Follow this example here with explaination:
https://www.juniper.net/documentation/en_US/junos/topics/example/policy-community-remove.html
set policy-options policy-statement remove-communities term 1 from protocol bgp
set policy-options policy-statement remove-communities term 1 then community delete wild
set policy-options policy-statement remove-communities term 1 then accept
set policy-options policy-statement remove-communities term 2 then reject
set policy-options community wild members *:*
With the above config, it deletes the community matching the wildcard.
So in scenario of R0--R1--R2--R3 (EBGP Peers), when your up stream EBGP router (R3) send route to R2, (routes with community), you delete them matching the wildcard(as shown in example). Now the routes you pass down from R2 to R1, wouldn't have any community associated with routes (you recieved fromR3). So route on R1 has no community (is empty) for those routes.
When there is no community to route its considered as empty.
In your config (Policy-1), you're stating that when there is no community, then do a set community operation.
In that you're basically doing a community set operation as follows when export route from R1 to R0.
[edit]
+ policy-options {
+ policy-statement Policy-1 {
+ term 1 {
+ from {
+ protocol bgp;
+ }
+ then {
+ community set 64100:7777;
+ accept;
+ }
+ }
+ term 2 {
+ then accept;
+ }
+ }
+ }
term2 can be fine tuned further if required.