# How come this is a conflict? (rules vs stories)

**URL:** <https://forum.rasa.com/t/how-come-this-is-a-conflict-rules-vs-stories/48927>\
**Category:** Rasa Open Source\
**Created:** [November 2, 2021, 3:11am UTC](https://forum.rasa.com/t/how-come-this-is-a-conflict-rules-vs-stories/48927 "2021-11-02T03:11:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiraadmaja](https://avatars.discourse-cdn.com/v4/letter/w/439d5e/32.png) [@wiraadmaja](https://forum.rasa.com/u/wiraadmaja)\
**Post date:** [November 2, 2021, 3:11am UTC](https://forum.rasa.com/t/how-come-this-is-a-conflict-rules-vs-stories/48927/1 "2021-11-02T03:11:11Z")

</div>

i want to create conversation where the bots will asking user name and give thankyou, simple as that, i setup some form but got some conflict between rules.yml and stories.yml when using rasa train. i read rasa docs buts its too vague to understand so its not helping

How come this error happened?

```auto
InvalidRule: 
Contradicting rules or stories found 🚨

- the prediction of the action 'action_listen' in story 'membuat KRS (confirmed)' is contradicting with rule(s) 'isi krs_student_name' which predicted action 'krs_form'.

```

**stories.yml**

```auto
version: "2.0"

stories:

- story: basic greetings
  steps:
  - intent: greet
  - action: utter_greet

- story: selamat tinggal
  steps:
  - intent: goodbye
  - action: utter_goodbye

- story: conversation_kagak_ngerti
  steps:
  - intent: out_of_context
  - action: utter_not_understand

- story: membuat KRS (confirmed)
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_create_krs
  - action: utter_confirm_create_krs
  - intent: affirm
  - action: utter_create_krs.ask_nama_lengkap
  - intent: give_name
  # entities: 
  # - krs_student_name: "wira"
  #- slot_was_set: 
  # - krs_student_name: "wira"
  #- action: utter_thanks
  

- story: membuat KRS (batal)
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_create_krs
  - action: utter_confirm_create_krs
  - intent: deny
  - action: utter_goodbye

```

rules.yml

```auto
version: "2.0"

rules:

- rule: balas ucapan greetings user
  steps:
  - intent: greet
  - action: utter_greet

- rule: balas ucapan randomnya user
  steps:
  - intent: nlu_fallback
  - action: utter_not_understand

- rule: isi krs_student_name
  steps:
  - intent: give_name
  - action: krs_form
  - active_loop: krs_form

```

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [November 2, 2021, 7:05am UTC](https://forum.rasa.com/t/how-come-this-is-a-conflict-rules-vs-stories/48927/2 "2021-11-02T07:05:36Z")

</div>

Welcome to the forum 🙂

```auto
- story: membuat KRS (confirmed)
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_create_krs
  - action: utter_confirm_create_krs
  - intent: affirm
  - action: utter_create_krs.ask_nama_lengkap
  - intent: give_name

- rule: isi krs_student_name
  steps:
  - intent: give_name
  - action: krs_form
  - active_loop: krs_form

```

The story predicts nothing (aka `action_listen`) after the `give_name` intent, while the rule tells it to execute `krs_form`.

You shouldn’t leave intents at the end of your stories and rules.

---

<div class="post-metadata">

**Author:** ![wiraadmaja](https://avatars.discourse-cdn.com/v4/letter/w/439d5e/32.png) [@wiraadmaja](https://forum.rasa.com/u/wiraadmaja)\
**Post date:** [November 3, 2021, 6:38am UTC](https://forum.rasa.com/t/how-come-this-is-a-conflict-rules-vs-stories/48927/3 "2021-11-03T06:38:04Z")

</div>

its still contradict to me

error :

```auto
InvalidRule: 
Contradicting rules or stories found 🚨

- the prediction of the action 'utter_create_krs.ask_nama_lengkap' in story 'membuat KRS (confirmed)' is contradicting with rule(s) 'tanya user ingin isi krs atau tidak' which predicted action 'utter_confirm_create_krs'.

```

stories.yml

```auto
version: "2.0"

stories:

- story: basic greetings
  steps:
  - intent: greet
  - action: utter_greet

- story: selamat tinggal
  steps:
  - intent: goodbye
  - action: utter_goodbye

- story: conversation_kagak_ngerti
  steps:
  - intent: out_of_context
  - action: utter_not_understand

- story: membuat KRS (confirmed)
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_create_krs
  - action: utter_confirm_create_krs
  - intent: affirm
  - action: utter_create_krs.ask_nama_lengkap
  - action: krs_form
  - active_loop: krs_form
  #- intent: give_name
  #- action: krs_form
  #- active_loop: krs_form
  # entities: 
  # - krs_student_name: "wira"
  #- slot_was_set: 
  # - krs_student_name: "wira"
  #- action: utter_thanks

```

rules.yml

```auto
version: "2.0"

rules:

- rule: balas ucapan randomnya user

  steps:

  - intent: nlu_fallback

  - action: utter_not_understand

- rule: greet user

  steps:

  - intent: greet

  - action: utter_greet

- rule: tanya user ingin isi krs atau tidak

  steps:

  - intent: affirm

  - action: utter_confirm_create_krs

  - action: krs_form

  - active_loop: krs_form

```
