Use of rpc in yang

I am new to yang. So any one can explain the use of the rpc ?means in which context i would go for the rpc rather than simple configuration data. leaf ?

You should almost alway use simple data leafs. RPCs are sometimes used for administrative actions with input and output parameters. Custom RPCs may be great in the correct situation and when used with judicious care. However, custom RPCs can cause big interoperability issues with NETCONF clients if done wrong.