Esempio n. 1
0
 /**
  * Check if we meet all variable requirements
  *
  * @param array $requirements
  * @return bool
  */
 protected function meetsVariableRequirements(array $requirements)
 {
     foreach ($requirements as $key => $value) {
         if ($this->memory_pool->get($key) != $value) {
             return false;
         }
     }
     return true;
 }
Esempio n. 2
0
 /**
  * Input factory for the charlie task
  *
  * @param string              $input
  * @param WorkflowHistory     $history
  * @param MemoryPoolInterface $memory_pool
  * @return string
  */
 public static function buildInput($input, WorkflowHistory $history, MemoryPoolInterface $memory_pool)
 {
     $out = ['bravo-memory' => $memory_pool->get('bravo'), 'bravo-result' => $input];
     return json_encode($out);
 }
Esempio n. 3
0
 /**
  * Parse the input and return the value of a variable from the memory pool
  *
  * @param string $in
  * @return string
  */
 protected function parseVariable($in)
 {
     return $this->memory_pool->get($in);
 }
Esempio n. 4
0
 /**
  * Check if the flag has been raised
  *
  * @return bool
  */
 public function isRaised()
 {
     return $this->memory_pool->get($this->key, '0') === '1';
 }