'', 'mainframe_port' => '', 'mainframe_key' => '', 'mainframe_password' => '', 'mainframe_environment' => '' ); $nat_conf_values = &Factory::getInstance('workflow_wfruntime')->getConfigValues($natconf); $this->setIPAddress($nat_conf_values['mainframe_ip']); $this->setServerPort($nat_conf_values['mainframe_port']); $this->setKey($nat_conf_values['mainframe_key']); $this->setPassword($nat_conf_values['mainframe_password']); $this->setApplication($nat_conf_values['mainframe_environment']); $this->logger = &Factory::getInstance('Logger', array('file')); } /** * This method MUST be called before using execute method * It specifies the natural sub-program to be accessed. * * @param Object $obj Object that specifies natural sub-program properties * @return void */ public function configure($obj) { $this->obj = $obj; $this->initialize($obj->name); if ($obj->server != NULL){ $this->setIPAddress($obj->server); } if ($obj->port != NULL){ $this->setServerPort($obj->port); } if ($obj->key != NULL){ $this->setKey($obj->key); } if ($obj->password != NULL){ $this->setPassword($obj->password); } if ($obj->environment != NULL){ $this->setApplication($obj->environment); } if ($obj->logon != NULL){ $this->setLogon($obj->logon); } if ($obj->system != NULL){ $this->setSystem($obj->system); } if ($obj->rc != NULL){ $this->setRC($obj->rc); } } /** * Method for accessing and retrieving data from mainframe * @return bool */ public function execute($inputParams = "") { // execute action and log wasted time $totalTime = microtime(true); $result = parent::execute($inputParams); $totalTime = microtime(time) - $totalTime; $log = sprintf("WF_NATURAL [subprogram=%s] [time=%ss]", $this->obj->name, number_format($totalTime,3) ); $this->logger->debug($log); return $result; } } ?>