예제 #1
0
 public function testInteractiveSubWorkflow()
 {
     $this->setUpStartInputEnd();
     $this->dbStorage->save($this->workflow);
     $this->setUpWorkflowWithSubWorkflow('StartInputEnd');
     $this->dbStorage->save($this->workflow);
     $execution = new ezcWorkflowDatabaseExecution($this->db);
     $execution->workflow = $this->workflow;
     $id = $execution->start();
     $this->assertNotNull($id);
     $this->assertFalse($execution->hasEnded());
     $this->assertFalse($execution->isCancelled());
     $this->assertFalse($execution->isResumed());
     $this->assertTrue($execution->isSuspended());
     $execution = new ezcWorkflowDatabaseExecution($this->db, $id);
     $this->assertFalse($execution->hasEnded());
     $this->assertFalse($execution->isCancelled());
     $this->assertFalse($execution->isResumed());
     $this->assertTrue($execution->isSuspended());
     $execution->resume(array('variable' => 'value'));
     $this->assertTrue($execution->hasEnded());
     $this->assertFalse($execution->isCancelled());
     $this->assertFalse($execution->isResumed());
     $this->assertFalse($execution->isSuspended());
 }
예제 #2
0
<?php

// Set up database connection.
$db = ezcDbFactory::create('mysql://test@localhost/test');
// Set up database-based workflow executer.
$execution = new ezcWorkflowDatabaseExecution($db, $id);
// Resume workflow execution.
$execution->resume(array('choice' => true));