Suppose that we have $X_1, ..., X_n$ iid such that $X_i| \theta \sim Ber(\theta)$ and $\theta \sim g(\theta)$ such that
$$g(\theta) = 0.6 Beta(2,1) + 0.4 Beta(1,1) = 1.2 \theta + 0.4$$
Doing the calculations, it is possible to show that $\theta | X$ is also a mixture of betas
$$A = \frac{\Gamma(x+2) \Gamma(n-x+1)}{\Gamma(n+3)}, \qquad B = \frac{\Gamma(x+1) \Gamma(n-x+1)}{\Gamma(n+2)}$$
$\Rightarrow f(\theta | X)= \frac{1,2A}{1,2A+0,4B} Beta(x+2, n-x+1) + \frac{0,4B}{1,2A+0,4B} Beta(x+1, n-x+1)$
But as we can see, the weights, in this case, depends on the sample $X$. Usually, to sample from a mixture of distributions, we use the process described in this example. But what should I do if the weights depends on $X$?
I just gave a random example to make it clear, but I want to know how to approach in a case like this.