Suppose that there are two types J0 of m jobs and J1 of n jobs, which are processed by either one of two identical machines. The processing time of one job of class J0 or J1 is the random variable from the exponential distribution with parameter u or v, respectively. The true value of v is unknown, but it has the gamma distribution with parameters w and α as the prior distribution. Preemption is not allowed in this problem. The objective is to minimize the expected total flowtime. From the Bayesian point of view, the problem is formulated by the principle of optimality of dynamic programming and the optimal solutions are obtained for some special cases.