Example #1
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     if ($this->policy->hasKey('status')) {
         $status = $this->policy->getValue('status');
         if (is_string($status)) {
             $status = BT\Task\Status::valueOf($status);
         }
         $this->policy->putEntry('status', Core\Convert::toInteger($status));
     } else {
         $this->policy->putEntry('status', BT\Task\Status::SUCCESS);
     }
 }
Example #2
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     if ($this->policy->hasKey('until')) {
         $until = $this->policy->getValue('until');
         if (is_string($until)) {
             $until = BT\Task\Status::valueOf($until);
         }
         if ($until !== BT\Task\Status::SUCCESS) {
             $until = BT\Task\Status::FAILED;
         }
         $this->policy->putEntry('until', $until);
     } else {
         $this->policy->putEntry('until', BT\Task\Status::SUCCESS);
     }
 }