A machine can manufacture any one of n m-dimensional Brownian motions with drift λ j {\lambda _j} , P x λ j P_x^{{\lambda _j}} , defined on the space of all paths x ( t ) ∈ C ( [ 0 , ∞ ) ; R m ) x\left ( t \right )\, \in \,C\left ( {\left [ {0,\,\infty } \right );\,{R^m}} \right ) . It is given that the product is a random evolution dictated by a Markov process θ ( t ) \theta \left ( t \right ) with n states, and that the product is P x λ j P_x^{{\lambda _j}} when θ ( t ) = j , 1 ⩽ j ⩽ n \theta \left ( t \right )\, = \,j,\,1\, \leqslant \,j\, \leqslant \,n . One observes the σ \sigma -fields of x ( t ) x\left ( t \right ) , but not of θ ( t ) \theta \left ( t \right ) . With each product P x λ j P_x^{{\lambda _j}} there is associated a cost c j {c_j} . One inspects θ \theta at a sequence of times (each inspection entails a certain cost) and stops production when the state θ = n \theta \, = \,n is reached. The problem is to find an optimal sequence of inspections. This problem is reduced to solving a certain elliptic quasi variational inequality. The latter problem is actually solved in a rather general case.