Time controlling

I'd like to controll a pump and valve. In the testing program the valve should be open for 10 sec (called "Anlaufzeit"), stays open and pump works addionally for 10sec (called "Mischzeit"). After pump is stopped and valve stays open for next 10 sek (called "Nachlaufzeit"). with a while loop it works fine. Actually process should stop after 30sec running time.

But in my program the void loop starts again. Even with the command if and break it's not working (now commented). What is the failure? I 'm looking hopefully for help. Thx.

here's the code:

// ===============Deklarierung und Initialisierung=============================//

int valvePin = 8;
int pumpPin = 7;
int time = 0;
int Anlaufzeit = 101000;
int Mischzeit = 10
1000;
int Nachlaufzeit = 101000;
int Prozesszeit = 30
1000;
// Initialisierung der Pins

void setup(){
Serial.begin(9600);
pinMode(valvePin,OUTPUT);
pinMode(pumpPin,OUTPUT);
}

// =================Hauptschleife==============================================//

void loop() {

time=millis();

while(time<30000){

//if(time>Prozesszeit)
//break;

digitalWrite(valvePin, HIGH);
digitalWrite(pumpPin, LOW);

delay(Anlaufzeit);

digitalWrite(pumpPin, HIGH);
digitalWrite(valvePin, HIGH);

delay(Mischzeit);

digitalWrite(pumpPin, LOW);
digitalWrite(valvePin, HIGH);

delay (Nachlaufzeit);

digitalWrite(valvePin, LOW);
delay (5000);

}

}

That's what loop() does.
Either put the code in setup() or put an infinite loop at the end of loop()