logging, new unique ID and improve start case

This commit is contained in:
Fernando Ontiveros
2025-04-24 17:55:41 +00:00
parent 85020fbdbd
commit 66d2c7a6a4
5 changed files with 69 additions and 45 deletions

View File

@@ -181,22 +181,29 @@ class Application extends BaseApplication
}
/**
* Creates an Application
* Creates a new Application entry in the database.
*
* @param string $processUid
* @param string $userUid
* @param string $sequenceType
* @throws PropelException
* @throws Exception
* @return string
*/
* This method initializes a new application with default values and saves it to the database.
* It generates a unique application ID, sets various properties related to the application,
* and handles the creation process within a database transaction.
*
* @param string $processUid The unique identifier for the process associated with the application.
* @param string $userUid The unique identifier for the user initiating the application.
* @param string $sequenceType The type of sequence to be used for generating the application number NORMAL or WEBENTRY.
*
* @throws PropelException If the application cannot be created due to validation failures or database errors.
* @throws Exception If an unexpected error occurs during the application creation process.
*
* @return string Returns the unique identifier of the newly created application.
*/
public function create($processUid, $userUid, $sequenceType)
{
$con = Propel::getConnection('workflow');
try {
// Fill the default values for new application row
$this->setAppUid(G::generateUniqueID());
$this->setAppUid(G::generateUid('app'));
$this->setAppParent('');
$this->setAppStatus('DRAFT');
$this->setAppStatusId(1);