title: Issue encountered while retrieving observable states from a given account in corda?
body: <p>I'm trying to broadcast a given state to some observer accounts (everything is on accounts level). The problem that I'm facing is that for the observer, I'm unable to retrieve the flows that I'd broadcasted to it. The broadcast has been done successfully which I confirmed with the presence of entries in the account_to_state_refs table as well as on the node itself (I broadcasted the state from account on one node to another account on another node).</p>
  
  <p>The query which I'm using to retrieve accounts is as below:</p>
  
  <pre><code>public List&lt;StateAndRef&lt;TradeState&gt;&gt; getTradeStatesByAccount(){
      AccountInfo myAccount = UtilitiesKt.getAccountService(this).accountInfo(accountName).get(0).getState().getData();
      QueryCriteria.VaultQueryCriteria criteria = new QueryCriteria.VaultQueryCriteria(Vault.StateStatus.ALL).withExternalIds(Collections.singletonList(myAccount.getIdentifier().getId()));
  
      List&lt;StateAndRef&lt;TradeState&gt;&gt; myOrders = getServiceHub().getVaultService().queryBy(TradeState.class,criteria).getStates();
      return myOrders;
  }
  </code></pre>
  
  <p>And the code which is used to broadcast a state to other accounts is</p>
  
  <pre><code>UtilitiesKt.getAccountService(this).shareStateWithAccount(accountInfo.getIdentifier().getId(), stateToBroadcast);
  </code></pre>
  
  <p>In this case, how do I get around with retrieving the states for which I'm the observer along with the states of which I'm a participant party? Let me know if you need any other info. Thanks in advance!</p>
  
  <p>Edit: Found a workaround, added in the answer.</p>