diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php
index 85d5d2ff0..279a46dd2 100644
--- a/workflow/engine/classes/class.case.php
+++ b/workflow/engine/classes/class.case.php
@@ -5160,4 +5160,46 @@ class Cases {
}
}
+ function discriminateCases($aData){
+ $siblingThreadData = $this->GetAllOpenDelegation($aData);
+ foreach($siblingThreadData as $thread => $threadData)
+ {
+ $this->closeAppThread ( $aData['APP_UID'], $threadData['DEL_INDEX']); //Close Sibling AppThreads
+ $this->CloseCurrentDelegation ($aData['APP_UID'], $threadData['DEL_INDEX']); //Close Sibling AppDelegations
+ }
+ }
+
+ /*
+ * We're getting all threads in a task
+ *
+ * @name GetAllThreads of Particular Parent Thread
+ * @param string $sAppUid
+ * @param string $sAppParent
+ * @return $aThreads
+ */
+ function GetAllOpenDelegation($aData)
+ {
+ //('SELECT * FROM APP_THREAD WHERE APP_UID='".$aData['APP_UID']."' AND APP_THREAD_PARENT = '".$aData['APP_THREAD_PARENT']."'");
+ try {
+ $aThreads = array();
+ $c = new Criteria();
+ $c->add(AppDelegationPeer::APP_UID, $aData['APP_UID']);
+ $c->add(AppDelegationPeer::DEL_PREVIOUS, $aData['APP_THREAD_PARENT']);
+ $c->add(AppDelegationPeer::DEL_THREAD_STATUS,'OPEN');
+ $rs = AppDelegationPeer::doSelectRs($c);
+ $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
+ $rs->next();
+ $row = $rs->getRow();
+ while (is_array($row)) {
+ $aThreads[] = $row;
+ $rs->next();
+ $row = $rs->getRow();
+ }
+ return $aThreads;
+ }
+ catch (exception $e) {
+ throw ($e);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php
index 07708ca70..5430d4214 100644
--- a/workflow/engine/classes/class.derivation.php
+++ b/workflow/engine/classes/class.derivation.php
@@ -52,7 +52,7 @@ class Derivation
*
* @param array $aData
* @return $taskInfo
- */
+ */
function prepareInformation($aData)
{
$oTask = new Task();
@@ -134,7 +134,7 @@ class Derivation
else {
//3. load the task information of normal NEXT_TASK
$aDerivation['NEXT_TASK'] = $oTask->load( $aDerivation['ROU_NEXT_TASK'] );//print $aDerivation['ROU_NEXT_TASK']." **** ".$aDerivation['NEXT_TASK']['TAS_TYPE']."
";
-
+
if ($aDerivation['NEXT_TASK']['TAS_TYPE'] === 'SUBPROCESS') {
$oCriteria = new Criteria('workflow');
$oCriteria->add(SubProcessPeer::PRO_PARENT, $aDerivation['PRO_UID']);
@@ -340,8 +340,8 @@ class Derivation
/* get next assigned user
*
- * @param Array $tasInfo
- * @return Array $userFields
+ * @param Array $tasInfo
+ * @return Array $userFields
*/
function getNextAssignedUser( $tasInfo ){
$oUser = new Users();
@@ -401,9 +401,9 @@ class Derivation
}
}
else
- throw ( new Exception("Task doesn't have a valid user in variable $variable or this variable doesn't exist.") ) ;
+ throw ( new Exception("Task doesn't have a valid user in variable $variable or this variable doesn't exists.") ) ;
break;
-
+
case 'REPORT_TO' :
//default error user when the reportsTo is not assigned to that user
//look for USR_REPORTS_TO to this user
@@ -413,7 +413,7 @@ class Derivation
$userFields['USR_FIRSTNAME'] = '';
$userFields['USR_LASTNAME'] = '';
$userFields['USR_EMAIL'] = '';
-
+
//look for USR_REPORTS_TO to this user
$useruid = $this->getDenpendentUser($tasInfo['USER_UID']);
if ( isset ( $useruid ) ) {
@@ -432,7 +432,7 @@ class Derivation
$userFields = "ERROR";
//throw ( new Exception("The current user does not have a valid Reports To user. Please contact administrator.") ) ;
break;
-
+
case 'SELF_SERVICE' :
//look for USR_REPORTS_TO to this user
$userFields['USR_UID'] = '';
@@ -452,30 +452,30 @@ class Derivation
/* getDenpendentUser
*
* @param string $USR_UID
- * @return string $aRow['USR_REPORTS_TO']
+ * @return string $aRow['USR_REPORTS_TO']
*/
function getDenpendentUser($USR_UID)
{
//require_once 'classes/model/Users.php';
//here the uid to next Users
$oC=new Criteria();
- $oC->addSelectColumn(UsersPeer::USR_REPORTS_TO);
+ $oC->addSelectColumn(UsersPeer::USR_REPORTS_TO);
$oC->add(UsersPeer::USR_UID,$USR_UID);
$oDataset=UsersPeer::doSelectRS($oC);
- $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
- $oDataset->next();
+ $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
+ $oDataset->next();
$aRow = $oDataset->getRow();
return $aRow['USR_REPORTS_TO'];
}
- /* setTasLastAssigned
+ /* setTasLastAssigned
*
* @param string $tasUid
* @param string $usrUid
* @throws Exception $e
* @return void
*/
- function setTasLastAssigned ( $tasUid, $usrUid )
+ function setTasLastAssigned ( $tasUid, $usrUid )
{
try {
$oTask = TaskPeer::retrieveByPk( $tasUid );
@@ -486,7 +486,7 @@ class Derivation
throw ( $e );
}
}
-
+
/* derivate
*
* @param array $currentDelegation
@@ -495,6 +495,7 @@ class Derivation
*/
function derivate($currentDelegation=array(), $nextDelegations =array())
{
+ //define this...
if ( !defined('TASK_FINISH_PROCESS')) define('TASK_FINISH_PROCESS',-1);
if ( !defined('TASK_FINISH_TASK')) define('TASK_FINISH_TASK', -2);
@@ -507,7 +508,7 @@ class Derivation
//Count how many tasks should be derivated.
//$countNextTask = count($nextDelegations);
foreach($nextDelegations as $nextDel) {
- //subprocesses??
+ //subprocesses??
if ($nextDel['TAS_PARENT'] != '') {
$oCriteria = new Criteria('workflow');
$oCriteria->add(SubProcessPeer::PRO_PARENT, $appFields['PRO_UID']);
@@ -531,14 +532,13 @@ class Derivation
continue;
}
}
-
//get TAS_ASSIGN_TYPE for current Delegation
- $oTask = TaskPeer::retrieveByPk( $currentDelegation['TAS_UID'] );
- $aTask = $oTask->toArray(BasePeer::TYPE_FIELDNAME);
+ $oTask = new Task();
+ $aTask = $oTask->load($currentDelegation['TAS_UID']);
$currentDelegation['TAS_ASSIGN_TYPE'] = $aTask['TAS_ASSIGN_TYPE'];
- $currentDelegation['TAS_MI_COMPLETE_VARIABLE'] = isset($aTask['TAS_MI_COMPLETE_VARIABLE']) ? $aTask['TAS_MI_COMPLETE_VARIABLE'] : '';
- $currentDelegation['TAS_MI_INSTANCE_VARIABLE'] = isset($aTask['TAS_MI_INSTANCE_VARIABLE']) ? $aTask['TAS_MI_INSTANCE_VARIABLE'] : '';
-
+ $currentDelegation['TAS_MI_COMPLETE_VARIABLE'] = $aTask['TAS_MI_COMPLETE_VARIABLE'];
+ $currentDelegation['TAS_MI_INSTANCE_VARIABLE'] = $aTask['TAS_MI_INSTANCE_VARIABLE'];
+
//get open threads
$openThreads = $this->case->GetOpenThreads( $currentDelegation['APP_UID'] );
//if we are derivating to finish process but there are no more open thread then we are finishing only the task, we are not finishing the whole process
@@ -559,92 +559,91 @@ class Derivation
default:
// get all siblingThreads
//if($currentDelegation['TAS_ASSIGN_TYPE'] == 'STATIC_MI')
- switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
+ switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
case 'CANCEL_MI':
case 'STATIC_MI':
- $siblingThreads = $this->case->GetAllOpenDelegation($currentDelegation);
- $aData = $this->case->loadCase($currentDelegation['APP_UID']);
-
- if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])]))
- $sMIinstanceVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])];
- else
- $sMIinstanceVar = $aData['APP_DATA']['TAS_MI_INSTANCE_VARIABLE'];
-
- if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])]))
- $sMIcompleteVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])];
- else
- $sMIcompleteVar = $aData['APP_DATA']['TAS_MI_COMPLETE_VARIABLE'];
- $discriminateThread = $sMIinstanceVar - $sMIcompleteVar;
- // -1 because One App Delegation is closed by above Code
- if($discriminateThread == count($siblingThreads))
- $canDerivate =true;
- else
- $canDerivate =false;
- break;
- default:
- if ( $currentDelegation['ROU_TYPE'] == 'SEC-JOIN') {
- $siblingThreads = $this->case->getOpenSiblingThreads($nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'],$currentDelegation['ROU_TYPE']);
- $canDerivate = count($siblingThreads) == 0;
- }
- else if($currentDelegation['ROU_TYPE'] == 'DISCRIMINATOR')
- {
- //First get the total threads of Next Task where route type='Discriminator'
- $siblingThreads = $this->case->getOpenSiblingThreads($nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'],$currentDelegation['ROU_TYPE']);
- $siblingThreadsCount = count($siblingThreads);
- $discriminateThread = $currentDelegation['ROU_CONDITION'];
- //$checkThread = count($totalThreads) - $cond;
- if($discriminateThread == $siblingThreadsCount)
- $canDerivate = true;
- else
- $canDerivate = false;
- }
- else {
- $canDerivate = true;
- }
+ $siblingThreads = $this->case->GetAllOpenDelegation($currentDelegation);
+ $aData = $this->case->loadCase($currentDelegation['APP_UID']);
+
+ if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])]))
+ $sMIinstanceVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'])];
+ else
+ $sMIinstanceVar = $aData['APP_DATA']['TAS_MI_INSTANCE_VARIABLE'];
+
+ if (isset($aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])]))
+ $sMIcompleteVar = $aData['APP_DATA'][str_replace('@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'])];
+ else
+ $sMIcompleteVar = $aData['APP_DATA']['TAS_MI_COMPLETE_VARIABLE'];
+ $discriminateThread = $sMIinstanceVar - $sMIcompleteVar;
+ // -1 because One App Delegation is closed by above Code
+ if($discriminateThread == count($siblingThreads))
+ $canDerivate =true;
+ else
+ $canDerivate =false;
+ break;
+ default:
+ if ( $currentDelegation['ROU_TYPE'] == 'SEC-JOIN') {
+ $siblingThreads = $this->case->getOpenSiblingThreads($nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'],$currentDelegation['ROU_TYPE']);
+ $canDerivate = count($siblingThreads) == 0;
+ }
+ else if($currentDelegation['ROU_TYPE'] == 'DISCRIMINATOR')
+ {
+ //First get the total threads of Next Task where route type='Discriminator'
+ $siblingThreads = $this->case->getOpenSiblingThreads($nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'],$currentDelegation['ROU_TYPE']);
+ $siblingThreadsCount = count($siblingThreads);
+ $discriminateThread = $currentDelegation['ROU_CONDITION'];
+ //$checkThread = count($totalThreads) - $cond;
+ if($discriminateThread == $siblingThreadsCount)
+ $canDerivate = true;
+ else
+ $canDerivate = false;
+ }
+ else {
+ $canDerivate = true;
+ }
}
if ( $canDerivate ) {
- $iAppThreadIndex = $appFields['DEL_THREAD'];
- $delType = 'NORMAL';
+ $iAppThreadIndex = $appFields['DEL_THREAD'];
+ $delType = 'NORMAL';
switch ( $nextDel['TAS_ASSIGN_TYPE'] ) {
- case 'CANCEL_MI':
- case 'STATIC_MI':
- // Create new delegation depending on the no of users in the group
- $iNewAppThreadIndex = $appFields['DEL_THREAD'];
- $this->case->closeAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex);
- foreach($nextDel['NEXT_TASK']['USER_ASSIGNED'] as $key=>$aValue){
- //Incrementing the Del_thread First so that new delegation has new del_thread
- $iNewAppThreadIndex += 1;
- //Creating new delegation according to users in group
- $iMIDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
- (isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''),
- $currentDelegation['DEL_INDEX'],
- $nextDel['DEL_PRIORITY'],
- $delType,
- $iNewAppThreadIndex);
+ case 'CANCEL_MI':
+ case 'STATIC_MI':
+ // Create new delegation depending on the no of users in the group
+ $iNewAppThreadIndex = $appFields['DEL_THREAD'];
+ $this->case->closeAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex);
+ foreach($nextDel['NEXT_TASK']['USER_ASSIGNED'] as $key=>$aValue){
+ //Incrementing the Del_thread First so that new delegation has new del_thread
+ $iNewAppThreadIndex += 1;
+ //Creating new delegation according to users in group
+ $iMIDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
+ (isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''),
+ $currentDelegation['DEL_INDEX'],
+ $nextDel,
+ $delType,
+ $iNewAppThreadIndex);
- $iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex );
-
- //Setting the del Index for Updating the AppThread delIndex
- if($key == 0)
- $iNewDelIndex = $iMIDelIndex -1;
- }
- break;
- case 'BALANCED' :
- $this->setTasLastAssigned ($nextDel['TAS_UID'], $nextDel['USR_UID']);
- //No Break, need no execute the default ones....
- default:
- // Create new delegation
- $iNewDelIndex = $this->case->newAppDelegation(
- $appFields['PRO_UID'], $currentDelegation['APP_UID'], $nextDel['TAS_UID'],
- (isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''),
- $currentDelegation['DEL_INDEX'],
- $nextDel['DEL_PRIORITY'],
- $delType,
- $iAppThreadIndex);
- break;
- }
+ $iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex );
+
+ //Setting the del Index for Updating the AppThread delIndex
+ if($key == 0)
+ $iNewDelIndex = $iMIDelIndex -1;
+ }
+ break;
+ case 'BALANCED' :
+ $this->setTasLastAssigned ($nextDel['TAS_UID'], $nextDel['USR_UID']);
+ //No Break, need no execute the default ones....
+ default:
+ // Create new delegation
+ $iNewDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
+ (isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''),
+ $currentDelegation['DEL_INDEX'],
+ $nextDel,
+ $delType,
+ $iAppThreadIndex);
+ break;
+ }
$iAppThreadIndex = $appFields['DEL_THREAD'];
switch ( $currentDelegation['ROU_TYPE'] ) {
case 'PARALLEL' :
@@ -652,20 +651,21 @@ class Derivation
$this->case->closeAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex);
$iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iNewDelIndex, $iAppThreadIndex );
$this->case->updateAppDelegation ( $currentDelegation['APP_UID'], $iNewDelIndex, $iNewThreadIndex );
+ //print " this->case->updateAppDelegation ( " . $currentDelegation['APP_UID'] .", " . $iNewDelIndex ." , " . $iNewThreadIndex . " )
";
break;
- case 'DISCRIMINATOR':
+ case 'DISCRIMINATOR':
if($currentDelegation['ROU_OPTIONAL'] == 'TRUE')
{
$this->case->discriminateCases($currentDelegation);
} //No Break, executing Default Condition
default :
switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
- case 'CANCEL_MI':
+ case 'CANCEL_MI':
$this->case->discriminateCases($currentDelegation);
- } //No Break, executing updateAppThread
+ } //No Break, executing updateAppThread
$this->case->updateAppThread ( $currentDelegation['APP_UID'], $iAppThreadIndex, $iNewDelIndex );
}//switch
-
+
//if there are subprocess to create
if (isset($aSP)) {
//Create the new case in the sub-process
@@ -732,7 +732,7 @@ class Derivation
}
}
}
-
+
}
else { //when the task doesnt generate a new AppDelegation
$iAppThreadIndex = $appFields['DEL_THREAD'];
@@ -777,7 +777,7 @@ class Derivation
* @param string $sApplicationUID
* @return void
*/
- function verifyIsCaseChild($sApplicationUID)
+ function verifyIsCaseChild($sApplicationUID)
{
//Obtain the related row in the table SUB_APPLICATION
$oCriteria = new Criteria('workflow');
@@ -836,7 +836,7 @@ class Derivation
$aDeriveTask['NEXT_TASK']['USER_ASSIGNED'] = $selectedUser;
$myLabels = array ( $aDeriveTask['NEXT_TASK']['TAS_TITLE'], $aParentCase['APP_NUMBER'], $selectedUser['USR_USERNAME'], $selectedUser['USR_FIRSTNAME'], $selectedUser['USR_LASTNAME'] );
G::SendTemporalMessage( 'ID_TASK_WAS_ASSIGNED_TO_USER', 'warning', 'labels', 10, null, $myLabels);
-
+
}
$nextDelegations2[] = array(
'TAS_UID' => $aDeriveTask['NEXT_TASK']['TAS_UID'],
@@ -861,16 +861,16 @@ class Derivation
}
}
- /* getDerivatedCases
+ /* getDerivatedCases
* get all derivated cases and subcases from any task,
* this function is useful to know who users have been assigned and what task they do.
*
* @param string $sParentUid
* @param string $sDelIndexParent
* @return array $derivation
- *
+ *
*/
- function getDerivatedCases ( $sParentUid, $sDelIndexParent )
+ function getDerivatedCases ( $sParentUid, $sDelIndexParent )
{
$oCriteria = new Criteria('workflow');
$cases = array();
diff --git a/workflow/engine/classes/class.processMap.php b/workflow/engine/classes/class.processMap.php
index 40104281c..e5cb9c502 100644
--- a/workflow/engine/classes/class.processMap.php
+++ b/workflow/engine/classes/class.processMap.php
@@ -170,6 +170,9 @@ class processMap {
case 'SEC-JOIN' :
$aRow2 ['ROU_TYPE'] = 5;
break;
+ case 'DISCRIMINATOR' :
+ $aRow2 ['ROU_TYPE'] = 8;
+ break;
}
$oTo = null;
$oTo->task = $aRow2 ['ROU_NEXT_TASK'];
@@ -2247,6 +2250,18 @@ class processMap {
}
$sXmlform = 'patterns_ParallelByEvaluation';
break;
+ case 'DISCRIMINATOR' :
+ G::LoadClass ( 'xmlfield_InputPM' );
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$aRow ['ROU_CASE']] = $aRow ['ROU_UID'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$aRow ['ROU_CASE']] = $aRow ['ROU_NEXT_TASK'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$aRow ['ROU_CASE']] = $aRow ['ROU_CONDITION'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_OPTIONAL'] [$aRow ['ROU_CASE']] = $aRow ['ROU_OPTIONAL'];
+ G::LoadClass('tasks');
+ $oTasks = new Tasks();
+ $routeData = $oTasks->getRouteByType($sProcessUID, $aRow['ROU_NEXT_TASK'], $aRow['ROU_TYPE']);
+ $aFields['ROUTE_COUNT'] = count($routeData);
+ $sXmlform = 'patterns_Discriminator';
+ break;
}
}
$aFields ['action'] = 'savePattern';
@@ -2337,6 +2352,19 @@ class processMap {
$oDataset->next();
}
break;
+ case 'DISCRIMINATOR' :
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$aRow ['ROU_CASE']] = $aRow ['ROU_UID'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$aRow ['ROU_CASE']] = $aRow ['ROU_NEXT_TASK'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$aRow ['ROU_CASE']] = $aRow ['ROU_CONDITION'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_OPTIONAL'] [$aRow ['ROU_CASE']] = $aRow ['ROU_OPTIONAL'];
+ while ( $aRow = $oDataset->getRow () ) {
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$aRow ['ROU_CASE']] = $aRow ['ROU_UID'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$aRow ['ROU_CASE']] = $aRow ['ROU_NEXT_TASK'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$aRow ['ROU_CASE']] = $aRow ['ROU_CONDITION'];
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_OPTIONAL'] [$aRow ['ROU_CASE']] = $aRow ['ROU_OPTIONAL'];
+ $oDataset->next ();
+ }
+ break;
}
} else {
@@ -2375,6 +2403,13 @@ class processMap {
$aFields ['GRID_PARALLEL_EVALUATION_TYPE'] ['ROU_CONDITION'] [$iRow] = '';
$aFields ['GRID_PARALLEL_EVALUATION_TYPE'] ['ROU_TO_LAST_USER'] [$iRow] = '';
break;
+ case 'DISCRIMINATOR' :
+ $iRow = (isset ( $aFields ['GRID_DISCRIMINATOR_TYPE'] ) ? count ( $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] ) + 1 : 0);
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_UID'] [$iRow] = '';
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_NEXT_TASK'] [$iRow] = $sNextTask;
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_CONDITION'] [$iRow] = '';
+ $aFields ['GRID_DISCRIMINATOR_TYPE'] ['ROU_TO_LAST_USER'] [$iRow] = '';
+ break;
}
$aFields ['action'] = 'savePattern';
$aFields ['LANG'] = SYS_LANG;
diff --git a/workflow/engine/classes/class.tasks.php b/workflow/engine/classes/class.tasks.php
index d3bb44408..f06d83222 100644
--- a/workflow/engine/classes/class.tasks.php
+++ b/workflow/engine/classes/class.tasks.php
@@ -36,7 +36,7 @@ require_once 'classes/model/Users.php';
/**
* Tasks - Tasks class
* @package ProcessMaker
- * @author Julio Cesar Laura Avendaño
+ * @author Julio Cesar Laura Avenda�o
* @copyright 2007 COLOSA
*/
@@ -648,5 +648,35 @@ class Tasks
throw($oError);
}
}
+
+/**
+ * Get Routes for any Process,route type,route next task
+ * @param string $sProUid, $sTaskUid
+ * @return array
+ * by Girish
+ */
+ public function getRouteByType($sProUid, $sRouteNextTaskUid,$sRouteType)
+ {
+ try {
+ $aRoutes = array();
+ $oCriteria = new Criteria('workflow');
+ $oCriteria->add(RoutePeer::PRO_UID, $sProUid);
+ $oCriteria->add(RoutePeer::ROU_NEXT_TASK, $sRouteNextTaskUid);
+ $oCriteria->add(RoutePeer::ROU_TYPE, $sRouteType);
+ $oDataset = RoutePeer::doSelectRS($oCriteria);
+ $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
+ $oDataset->next();
+ while ($aRow = $oDataset->getRow()) {
+ $aRoutes[] = $aRow;
+ $oDataset->next();
+ }
+
+ return $aRoutes;
+ }
+ catch (Exception $oError) {
+ throw($oError);
+ }
+ }
+
}
?>
\ No newline at end of file
diff --git a/workflow/engine/classes/model/AppDelegation.php b/workflow/engine/classes/model/AppDelegation.php
index 84f87bce5..4ca916ba4 100644
--- a/workflow/engine/classes/model/AppDelegation.php
+++ b/workflow/engine/classes/model/AppDelegation.php
@@ -26,6 +26,7 @@
require_once 'classes/model/om/BaseAppDelegation.php';
require_once ( "classes/model/HolidayPeer.php" );
require_once ( "classes/model/TaskPeer.php" );
+require_once ( "classes/model/Task.php" );
G::LoadClass("dates");
/**
@@ -51,7 +52,7 @@ class AppDelegation extends BaseAppDelegation {
* @param $isSubprocess is a subprocess inside a process?
* @return delegation index of the application delegation.
*/
- function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess=false, $sPrevious=-1 ) {
+ function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $sNextTasParam,$iPriority = 3, $isSubprocess=false ) {
if (!isset($sProUid) || strlen($sProUid) == 0 ) {
throw ( new Exception ( 'Column "PRO_UID" cannot be null.' ) );
@@ -75,17 +76,19 @@ class AppDelegation extends BaseAppDelegation {
$c = new Criteria ();
$c->clearSelectColumns();
$c->addSelectColumn ( 'MAX(' . AppDelegationPeer::DEL_INDEX . ') ' );
+ $c->addSelectColumn ( AppDelegationPeer::DEL_STARTED );
$c->add ( AppDelegationPeer::APP_UID, $sAppUid );
$rs = AppDelegationPeer::doSelectRS ( $c );
$rs->next();
$row = $rs->getRow();
$delIndex = $row[0] + 1;
+ //$delStarted = $row[1]; ???? blame -> gustavo,..$row[1] doesn't exist
$this->setAppUid ( $sAppUid );
$this->setProUid ( $sProUid );
$this->setTasUid ( $sTasUid );
$this->setDelIndex ( $delIndex );
- $this->setDelPrevious ( $sPrevious == -1 ? 0 : $sPrevious );
+ $this->setDelPrevious ( 0 );
$this->setUsrUid ( $sUsrUid );
$this->setDelType ( 'NORMAL' );
$this->setDelPriority ( ($iPriority != '' ? $iPriority : '3') );
@@ -93,14 +96,15 @@ class AppDelegation extends BaseAppDelegation {
$this->setDelThreadStatus ( 'OPEN' );
$this->setDelDelegateDate ( 'now' );
//The function return an array now. By JHL
- $delTaskDueDate=$this->calculateDueDate();
+ $delTaskDueDate=$this->calculateDueDate($sNextTasParam);
$this->setDelTaskDueDate ( $delTaskDueDate['DUE_DATE'] ); // Due date formatted
- $this->setDelData ( '' ); //$delTaskDueDate['DUE_DATE_LOG'] ); // Log of actions made by Calendar Engine
+ $this->setDelData ( $delTaskDueDate['DUE_DATE_LOG'] ); // Log of actions made by Calendar Engine
// this condition assures that an internal delegation like a subprocess dont have an initial date setted
if ( $delIndex == 1 && !$isSubprocess ) //the first delegation, init date this should be now for draft applications, in other cases, should be null.
$this->setDelInitDate ('now' );
+
if ($this->validate() ) {
try {
$res = $this->save();
@@ -116,7 +120,7 @@ class AppDelegation extends BaseAppDelegation {
foreach($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "
";
}
- throw ( new Exception ( 'Failed Data validation saving APP_DELEGATION row: ' . $msg ) );
+ throw ( new Exception ( 'Failed Data validation. ' . $msg ) );
}
return $this->getDelIndex();
@@ -139,7 +143,7 @@ class AppDelegation extends BaseAppDelegation {
return $aFields;
}
else {
- throw( new Exception( "The row '$AppUid, $sDelIndex' in table AppDelegation doesn't exist!" ));
+ throw( new Exception( "The row '$AppUid, $sDelIndex' in table AppDelegation doesn't exists!" ));
}
}
catch (Exception $oError) {
@@ -176,7 +180,7 @@ class AppDelegation extends BaseAppDelegation {
}
else {
$con->rollback();
- throw(new Exception( "This AppDelegation row doesn't exist!" ));
+ throw(new Exception( "This AppDelegation row doesn't exists!" ));
}
}
catch (Exception $oError) {
@@ -203,20 +207,44 @@ class AppDelegation extends BaseAppDelegation {
// TasTypeDay = 1 => working days
// TasTypeDay = 2 => calendar days
- function calculateDueDate()
+ function calculateDueDate($sNextTasParam)
{
//Get Task properties
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
+ $aData['TAS_UID'] = $this->getTasUid();
+ //Added to allow User defined Timing Control at Run time from Derivation screen
+ if(isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true')
+ {
+ $aData['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
+ $aData['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
+ $aData['TAS_TYPE_DAY'] = $sNextTasParam['NEXT_TASK']['TAS_TYPE_DAY'];
+ if(isset($sNextTasParam['NEXT_TASK']['TAS_CALENDAR']) && $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] != '')
+ $aCalendarUID = $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'];
+ else
+ $aCalendarUID = '';
+ //Updating the task Table , so that user will see updated values in the assign screen in consequent cases
+ $oTask = new Task();
+ $oTask->update($aData);
+ }
+ else
+ {
+ $aData['TAS_DURATION'] = $task->getTasDuration();
+ $aData['TAS_TIMEUNIT'] = $task->getTasTimeUnit();
+ $aData['TAS_TYPE_DAY'] = $task->getTasTypeDay();
+ $aCalendarUID = '';
+ }
+
//use the dates class to calculate dates
$dates = new dates();
$iDueDate = $dates->calculateDate( $this->getDelDelegateDate(),
- $task->getTasDuration(),
- $task->getTasTimeUnit(), //hours or days, ( we only accept this two types or maybe weeks
- $task->getTasTypeDay(), //working or calendar days
+ $aData['TAS_DURATION'],
+ $aData['TAS_TIMEUNIT'], //hours or days, ( we only accept this two types or maybe weeks
+ $aData['TAS_TYPE_DAY'], //working or calendar days
$this->getUsrUid(),
$task->getProUid(),
- $this->getTasUid() );
+ $aData['TAS_UID'],
+ $aCalendarUID);
return $iDueDate;
}
@@ -226,7 +254,7 @@ function getDiffDate ( $date1, $date2 ) {
}
function calculateDuration() {
try {
- //patch rows with initdate = null and finish_date
+ //patch rows with initdate = null and finish_date
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(AppDelegationPeer::APP_UID );
@@ -272,7 +300,7 @@ function getDiffDate ( $date1, $date2 ) {
$c->addSelectColumn(TaskPeer::TAS_DURATION);
$c->addSelectColumn(TaskPeer::TAS_TIMEUNIT);
$c->addSelectColumn(TaskPeer::TAS_TYPE_DAY);
-
+
$c->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN );
//$c->add(AppDelegationPeer::DEL_INIT_DATE, NULL, Criteria::ISNULL);
//$c->add(AppDelegationPeer::APP_UID, '7694483844a37bfeb0931b1063501289');
@@ -289,7 +317,7 @@ function getDiffDate ( $date1, $date2 ) {
$row = $rs->getRow();
$i =0;
//print "";
-//print "| iDelegateDate | iInitDate | iDueDate | iFinishDate | isStarted | isFinished | isDelayed | queueDuration | delDuration | delayDuration |
";
+//print "| iDelegateDate | iInitDate | iDueDate | iFinishDate | isStarted | isFinished | isDelayed | queueDuration | delDuration | delayDuration |
";
$now = strtotime ( 'now' );
while ( is_array($row) ) {
$fTaskDuration = $row['TAS_DURATION'];
@@ -304,9 +332,9 @@ $i =0;
$delDuration = 0;
$delayDuration = 0;
$overduePercentage = 0.0;
- //get the object,
+ //get the object,
$oAppDel = AppDelegationPeer::retrieveByPk($row['APP_UID'], $row['DEL_INDEX'] );
- //if the task is not started
+ //if the task is not started
if ( $isStarted == 0 ) {
if ( $row['DEL_INIT_DATE'] != NULL && $row['DEL_INIT_DATE'] != '' ) {
$oAppDel->setDelStarted(1);
@@ -322,7 +350,7 @@ $i =0;
$oAppDel->setDelDelayDuration( $delayDuration);
if ( $fTaskDuration != 0) {
$overduePercentage = $delayDuration / $fTaskDuration;
- $oAppDel->setAppOverduePercentage( $overduePercentage);
+ $oAppDel->setAppOverduePercentage( $overduePercentage);
if ( $iDueDate < $now ) {
$oAppDel->setDelDelayed(1);
}
@@ -352,7 +380,7 @@ $i =0;
if ( $row['DEL_INIT_DATE'] != NULL && $row['DEL_INIT_DATE'] != '' ) {
$delDuration = $this->getDiffDate ($now, $iInitDate );
}
- else
+ else
$delDuration = $this->getDiffDate ($now, $iDelegateDate);
$oAppDel->setDelDuration( $delDuration);
@@ -361,7 +389,7 @@ $i =0;
$oAppDel->setDelDelayDuration( $delayDuration);
if ( $fTaskDuration != 0) {
$overduePercentage = $delayDuration / $fTaskDuration;
- $oAppDel->setAppOverduePercentage($overduePercentage );
+ $oAppDel->setAppOverduePercentage($overduePercentage );
if ( $iDueDate < $now ) {
$oAppDel->setDelDelayed(1);
}
@@ -369,26 +397,26 @@ $i =0;
}
}
-
-
+
+
//and finally save the record
$RES = $oAppDel->save();
//print "| $iDelegateDate | $iInitDate | $iDueDate | $iFinishDate | $isStarted | $isFinished | $isDelayed | $queueDuration | $delDuration | " .
-// "$delayDuration | $overduePercentage | " . $row['DEL_INDEX'] . " $RES |
";
+// "$delayDuration | $overduePercentage | " . $row['DEL_INDEX'] . " $RES | ";
//UPDATE APP_DELEGATION SET DEL_DELAYED = 0
-//where
+//where
// APP_OVERDUE_PERCENTAGE < 0
$rs->next();
$row = $rs->getRow();
-
+
}
}
catch ( Exception $oError) {
//krumo ( $oError->getMessage() );
}
}
-
+
function getLastDeleration($APP_UID){
$c = new Criteria('workflow');
$c->addSelectColumn(AppDelegationPeer::APP_UID );
@@ -404,7 +432,7 @@ $i =0;
$c->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
$c->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
$c->addSelectColumn(AppDelegationPeer::USR_UID);
-
+
$c->add(AppDelegationPeer::APP_UID, $APP_UID);
$c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
$rs = AppDelegationPeer::doSelectRS($c);
diff --git a/workflow/engine/classes/model/map/TaskMapBuilder.php b/workflow/engine/classes/model/map/TaskMapBuilder.php
index 66dec821d..f92028eb4 100644
--- a/workflow/engine/classes/model/map/TaskMapBuilder.php
+++ b/workflow/engine/classes/model/map/TaskMapBuilder.php
@@ -144,7 +144,7 @@ class TaskMapBuilder {
$tMap->addColumn('TAS_BOUNDARY', 'TasBoundary', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS', 'Please select a valid value for TAS_TYPE.');
+ $tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN', 'Please select a valid value for TAS_TYPE.');
$tMap->addValidator('TAS_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'MINUTES|HOURS|DAYS|WEEKS|MONTHS', 'Please select a valid value for TAS_TIMEUNIT.');
diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml
index e2f2cdca3..d438a0bc6 100644
--- a/workflow/engine/config/schema.xml
+++ b/workflow/engine/config/schema.xml
@@ -3489,7 +3489,7 @@
-
+
diff --git a/workflow/engine/js/processmap/core/images/8.gif b/workflow/engine/js/processmap/core/images/8.gif
new file mode 100755
index 000000000..1a52939f3
Binary files /dev/null and b/workflow/engine/js/processmap/core/images/8.gif differ
diff --git a/workflow/engine/js/processmap/core/images/8t.gif b/workflow/engine/js/processmap/core/images/8t.gif
new file mode 100755
index 000000000..bcd626aac
Binary files /dev/null and b/workflow/engine/js/processmap/core/images/8t.gif differ
diff --git a/workflow/engine/js/processmap/core/processes_Map.js b/workflow/engine/js/processmap/core/processes_Map.js
index 05d356f0a..f7230e80f 100644
--- a/workflow/engine/js/processmap/core/processes_Map.js
+++ b/workflow/engine/js/processmap/core/processes_Map.js
@@ -43,7 +43,17 @@ var saveDataTaskTemporal = function(iForm)
{
oTaskData.TAS_ASSIGN_TYPE = 'EVALUATE';
}
+ if (getField('TAS_ASSIGN_TYPE][STATIC_MI').checked)
+ {
+ oTaskData.TAS_ASSIGN_TYPE = 'STATIC_MI';
+ }
+ if (getField('TAS_ASSIGN_TYPE][CANCEL_MI').checked)
+ {
+ oTaskData.TAS_ASSIGN_TYPE = 'CANCEL_MI';
+ }
oTaskData.TAS_ASSIGN_VARIABLE = getField('TAS_ASSIGN_VARIABLE').value;
+ oTaskData.TAS_MI_INSTANCE_VARIABLE = getField('TAS_MI_INSTANCE_VARIABLE').value;
+ oTaskData.TAS_MI_COMPLETE_VARIABLE = getField('TAS_MI_COMPLETE_VARIABLE').value;
break;
case 3:
case '3':
@@ -51,7 +61,7 @@ var saveDataTaskTemporal = function(iForm)
oTaskData.TAS_TIMEUNIT = getField('TAS_TIMEUNIT').value;
oTaskData.TAS_TYPE_DAY = getField('TAS_TYPE_DAY').value;
oTaskData.TAS_CALENDAR = getField('TAS_CALENDAR').value;
- //oTaskData.TAS_TRANSFER_FLY = (getField('TAS_TRANSFER_FLY').checked ? 'TRUE' : 'FALSE');
+ oTaskData.TAS_TRANSFER_FLY = (getField('TAS_TRANSFER_FLY').checked ? 'TRUE' : 'FALSE');
break;
case 4:
case '4':
diff --git a/workflow/engine/js/processmap/core/processmap.js b/workflow/engine/js/processmap/core/processmap.js
index fea159e4a..5a6690c60 100644
--- a/workflow/engine/js/processmap/core/processmap.js
+++ b/workflow/engine/js/processmap/core/processmap.js
@@ -171,132 +171,136 @@ var processmap=function(){
bbk[lanzado]();
},
panel:function()
- {
- /* Toolbar Begin */
- var panel;
- panel = this.panels.toolbar=new leimnud.module.panel();
- this.panels.toolbar.options={
- limit :true,
- size :{w:230,h:31},
- position:{x:this.options.target.clientWidth-242,y:4},
- title :"",
- theme :"processmaker",
- target :this.options.target,
- //limit :true,
- titleBar:false,
- statusBar:false,
- elementToDrag:"content",
- cursorToDrag:"default",
- control :{drag:true,resize:false},
- fx :{opacity:true,shadow:false}
- };
- panel.setStyle={
- containerWindow:{border:"1px solid buttonshadow"},
- frontend:{backgroundColor:"buttonface"},
- content:{border:"1px solid transparent",backgroundColor:"transparent",margin:0,overflow:"hidden",padding:1}
- };
- this.panels.toolbar.make();
- var div = document.createElement("div");
- this.parent.dom.setStyle(div,{
- textAlign:"center"
- });
- var dr1 = document.createElement("img");
- dr1.src = this.options.images_dir+"0.gif";
- dr1.title = G_STRINGS.ID_PROCESSMAP_SEQUENTIAL;
- div.appendChild(dr1);
- //dr1.style.marginTop=7;
- //div.appendChild(document.createElement("p"));
- var dr2 = document.createElement("img");
- //dr2.style.marginTop=7;
- dr2.src = this.options.images_dir+"1.gif";
- dr2.title = G_STRINGS.ID_PROCESSMAP_SELECTION;
+ {
+ /* Toolbar Begin */
+ var panel;
+ panel = this.panels.toolbar=new leimnud.module.panel();
+ this.panels.toolbar.options={
+ limit :true,
+ size :{w:260,h:31},
+ position:{x:this.options.target.clientWidth-278,y:4},
+ title :"",
+ theme :"processmaker",
+ target :this.options.target,
+ //limit :true,
+ titleBar:false,
+ statusBar:false,
+ elementToDrag:"content",
+ cursorToDrag:"default",
+ control :{drag:true,resize:false},
+ fx :{opacity:true,shadow:false}
+ };
+ panel.setStyle={
+ containerWindow:{border:"1px solid buttonshadow"},
+ frontend:{backgroundColor:"buttonface"},
+ content:{border:"1px solid transparent",backgroundColor:"transparent",margin:0,overflow:"hidden",padding:1}
+ };
+ this.panels.toolbar.make();
+ var div = document.createElement("div");
+ this.parent.dom.setStyle(div,{
+ textAlign:"center"
+ });
+ var dr1 = document.createElement("img");
+ dr1.src = this.options.images_dir+"0.gif";
+ dr1.title = G_STRINGS.ID_PROCESSMAP_SEQUENTIAL;
+ div.appendChild(dr1);
+ //dr1.style.marginTop=7;
+ //div.appendChild(document.createElement("p"));
+ var dr2 = document.createElement("img");
+ //dr2.style.marginTop=7;
+ dr2.src = this.options.images_dir+"1.gif";
+ dr2.title = G_STRINGS.ID_PROCESSMAP_SELECTION;
- div.appendChild(dr2);
- //div.appendChild(document.createElement("p"));
- var dr3 = document.createElement("img");
- dr3.src = this.options.images_dir+"2.gif";
- dr3.title = G_STRINGS.ID_PROCESSMAP_EVALUATION;
- //dr3.style.marginTop=7;
- div.appendChild(dr3);
- //div.appendChild(document.createElement("p"));
- var dr4 = document.createElement("img");
- dr4.src = this.options.images_dir+"3.gif";
- dr4.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_FORK;
- //dr4.style.marginTop=7;
- div.appendChild(dr4);
- //div.appendChild(document.createElement("p"));
- var dr5 = document.createElement("img");
- dr5.src = this.options.images_dir+"4.gif";
- dr5.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_EVALUATION_FORK;
- //dr5.style.marginTop=7;
- div.appendChild(dr5);
+ div.appendChild(dr2);
+ //div.appendChild(document.createElement("p"));
+ var dr3 = document.createElement("img");
+ dr3.src = this.options.images_dir+"2.gif";
+ dr3.title = G_STRINGS.ID_PROCESSMAP_EVALUATION;
+ //dr3.style.marginTop=7;
+ div.appendChild(dr3);
+ //div.appendChild(document.createElement("p"));
+ var dr4 = document.createElement("img");
+ dr4.src = this.options.images_dir+"3.gif";
+ dr4.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_FORK;
+ //dr4.style.marginTop=7;
+ div.appendChild(dr4);
+ //div.appendChild(document.createElement("p"));
+ var dr5 = document.createElement("img");
+ dr5.src = this.options.images_dir+"4.gif";
+ dr5.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_EVALUATION_FORK;
+ //dr5.style.marginTop=7;
+ div.appendChild(dr5);
- var dr6 = document.createElement("img");
- dr6.src = this.options.images_dir+"5.gif";
- dr6.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_JOIN;
- div.appendChild(dr6);
+ var dr6 = document.createElement("img");
+ dr6.src = this.options.images_dir+"5.gif";
+ dr6.title = G_STRINGS.ID_PROCESSMAP_PARALLEL_JOIN;
+ div.appendChild(dr6);
- var fin = document.createElement("img");
- fin.src = this.options.images_dir+"6.gif";
- fin.title = G_STRINGS.ID_END_OF_PROCESS;
- div.appendChild(fin);
+ var fin = document.createElement("img");
+ fin.src = this.options.images_dir+"6.gif";
+ fin.title = G_STRINGS.ID_END_OF_PROCESS;
+ div.appendChild(fin);
- var ini = document.createElement("img");
- ini.src = this.options.images_dir+"7.gif";
- ini.title = "Starting task";
- div.appendChild(ini);
+ var ini = document.createElement("img");
+ ini.src = this.options.images_dir+"7.gif";
+ ini.title = "Starting task";
+ div.appendChild(ini);
+ var dis = document.createElement("img");
+ dis.src = this.options.images_dir+"8.gif";
+ dis.title = "Discriminator";
+ div.appendChild(dis);
- [dr1,dr2,dr3,dr4,dr5,dr6,fin,ini].map(function(el){
- el.className ="processmap_toolbarItem___"+this.options.theme
- }.extend(this));
- this.dragables.derivation = new this.parent.module.drag({
- elements:[dr1,dr2,dr3,dr4,dr5,dr6,fin,ini],
- fx:{
- type : "clone",
- target : this.panels.editor.elements.content,
- zIndex : 11
- }
- });
- this.dragables.derivation.typesDerivation=["simple","double","conditional","conditional1","conditional2","conditional3","final","initial"];
- this.dragables.derivation.events={
- init :[function(){
- this.dragables.derivation.noDrag=true;
- }.extend(this)],
- move:this.dropables.derivation.capture.args(this.dragables.derivation),
- finish : this.parent.closure({instance:this,method:function(){
- //clearInterval(this.timeToOutControl);
+ [dr1,dr2,dr3,dr4,dr5,dr6,fin,ini,dis].map(function(el){
+ el.className ="processmap_toolbarItem___"+this.options.theme
+ }.extend(this));
+ this.dragables.derivation = new this.parent.module.drag({ //Add to enable dragging of image from panel
+ elements:[dr1,dr2,dr3,dr4,dr5,dr6,fin,ini,dis],
+ fx:{
+ type : "clone",
+ target : this.panels.editor.elements.content,
+ zIndex : 11
+ }
+ });
+ this.dragables.derivation.typesDerivation=["simple","double","conditional","conditional1","conditional2","conditional3","final","initial","discriminator"];
+ this.dragables.derivation.events={
+ init :[function(){
+ this.dragables.derivation.noDrag=true;
+ }.extend(this)],
+ move:this.dropables.derivation.capture.args(this.dragables.derivation),
+ finish : this.parent.closure({instance:this,method:function(){
+ //clearInterval(this.timeToOutControl);
- this.parent.dom.remove(this.dropables.derivation.drag || this.dragables.derivation.currentElementDrag);
- this.parent.dom.remove(this.dragables.derivation.currentElementDrag);
- if(this.dropables.derivation.selected!==false)
- {
- this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.out);
- vAux = this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.click);
- this.dropables.derivation.selected = false;
- return vAux;
- }
- else
- {
- this.dragables.derivation.noDrag=false;
- }
- }})
- };
- this.dragables.derivation.make();
- //drg.options.elements=[];
- this.parent.dom.setStyle([dr1,dr2,dr3,dr4,dr5,dr6,fin,ini],{
- cursor:"move"
- });
- panel.loader.hide();
- panel.addContent(div);
+ this.parent.dom.remove(this.dropables.derivation.drag || this.dragables.derivation.currentElementDrag);
+ this.parent.dom.remove(this.dragables.derivation.currentElementDrag);
+ if(this.dropables.derivation.selected!==false)
+ {
+ this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.out);
+ vAux = this.dropables.derivation.launchEvents(this.dropables.derivation.elements[this.dropables.derivation.selected].events.click);
+ this.dropables.derivation.selected = false;
+ return vAux;
+ }
+ else
+ {
+ this.dragables.derivation.noDrag=false;
+ }
+ }})
+ };
+ this.dragables.derivation.make();
+ //drg.options.elements=[];
+ this.parent.dom.setStyle([dr1,dr2,dr3,dr4,dr5,dr6,fin,ini,dis],{
+ cursor:"move"
+ });
+ panel.loader.hide();
+ panel.addContent(div);
- leimnud._panel=['O'],leimnud.ipanel=0;
- /* Toolbar End */
- },
- components:{
+ leimnud._panel=['O'],leimnud.ipanel=0;
+ /* Toolbar End */
+ },
+ components:{
- }
- },
+ }
+ },
base:function(xml)
{
this.panels.editor.loader.hide();
@@ -376,6 +380,7 @@ var processmap=function(){
{separator:true},
{image:"/images/add.png",text:G_STRINGS.ID_PROCESSMAP_ADD_TASK,launch:this.addTask.extend(this,{tp:'task'})},
{image:"/images/subProcess.png",text:G_STRINGS.ID_PROCESSMAP_ADD_SUBPROCESS,launch:this.addTask.extend(this,{tp:'subprocess'})}, //add subprocess whith blabla
+ {image:"/images/add.png",text:"Add Task Hidden",launch:this.addTask.extend(this,{tp:'hidden'})}, //add subprocess whith blabla
{image:"/images/addtext.png",text:G_STRINGS.ID_PROCESSMAP_ADD_TEXT,launch:this.addText.extend(this)},
{image:"/images/linhori.png",text:G_STRINGS.ID_PROCESSMAP_HORIZONTAL_LINE,launch:this.addGuide.extend(this,"horizontal")},
{image:"/images/linver.png",text:G_STRINGS.ID_PROCESSMAP_VERTICAL_LINE,launch:this.addGuide.extend(this,"vertical")},
@@ -647,103 +652,161 @@ var processmap=function(){
r.make();
}.extend(this)} ,
{image:"/images/events.gif",text:G_STRINGS.ID_EVENTS,submenu:[
- {image:"/images/event_message.png",text:"Message",launch:function(event){
- this.tmp.eventsPanel = panel =new leimnud.module.panel();
- panel.options={
- limit :true,
- size :{w:700,h:380},
- position:{x:50,y:50,center:true},
- title :G_STRINGS.ID_EVENT_MESSAGE,
- theme :this.options.theme,
- control :{close:true,resize:false},fx:{modal:true},
- statusBar:false,
- fx :{shadow:true,modal:true}
- };
- panel.make();
- panel.loader.show();
- var r = new leimnud.module.rpc.xmlhttp({
- url:this.options.dataServer,
- args:"action=events&data="+{
- pro_uid :this.options.uid,
+ {image:"/images/event_message.png",text:"start message event",launch:function(event){
+ this.tmp.editProcessPanel = panel =new leimnud.module.panel();
+ panel.options={
+ limit :true,
+ size :{w:500,h:380},
+ position:{x:50,y:50,center:true},
+ title :G_STRINGS.ID_WEB_ENTRY,
+ theme :this.options.theme,
+ control :{close:true,resize:false},fx:{modal:true},
+ statusBar:false,
+ fx :{shadow:true,modal:true}
+ };
+ panel.make();
+ panel.loader.show();
+ var r = new leimnud.module.rpc.xmlhttp({
+ url:this.options.dataServer,
+ args:"action=webEntry&data="+{
+ pro_uid :this.options.uid
+ }.toJSONString()
+ });
+ r.callback=function(rpc,panel)
+ {
+ panel.loader.hide();
+ var scs = rpc.xmlhttp.responseText.extractScript();
+ panel.addContent(rpc.xmlhttp.responseText);
+ scs.evalScript();
+ //Pm.objeto.innerHTML="asdasd";
+ }.extend(this,panel);
+ r.make();
+ }.extend(this)},
+
+ {image:"/images/event_timer.png",text:"Start timer event",launch:function(event){
+ this.tmp.eventsPanel = panel =new leimnud.module.panel();
+ panel.options={
+ limit :true,
+ size :{w:830,h:800},
+ position:{x:50,y:50,center:true},
+ title :"CASES SCHEDULER",
+ theme :this.options.theme,
+ control :{close:true,resize:false},fx:{modal:true},
+ statusBar:false,
+ fx :{shadow:true,modal:true}
+ };
+ panel.make();
+ panel.loader.show();
+ var r = new leimnud.module.rpc.xmlhttp({
+ url:this.options.dataServer,
+ args:"action=case_scheduler&PRO_UID="+this.options.uid
+ });
+ r.callback=function(rpc,panel)
+ {
+ panel.loader.hide();
+ var scs = rpc.xmlhttp.responseText.extractScript();
+ panel.addContent(rpc.xmlhttp.responseText);
+ scs.evalScript();
+ //Pm.objeto.innerHTML="asdasd";
+ }.extend(this,panel);
+ r.make();
+ }.extend(this)},
+ {image:"/images/event_messageThrow.png",text:"intermediate message event",launch:function(event){
+ this.tmp.eventsPanel = panel =new leimnud.module.panel();
+ panel.options={
+ limit :true,
+ size :{w:700,h:380},
+ position:{x:50,y:50,center:true},
+ title :G_STRINGS.ID_EVENT_MESSAGE,
+ theme :this.options.theme,
+ control :{close:true,resize:false},fx:{modal:true},
+ statusBar:false,
+ fx :{shadow:true,modal:true}
+ };
+ panel.make();
+ panel.loader.show();
+ var r = new leimnud.module.rpc.xmlhttp({
+ url:this.options.dataServer,
+ args:"action=events&data="+{
+ pro_uid :this.options.uid,
+ type:"message"
+ }.toJSONString()
+ });
+ r.callback=function(rpc,panel)
+ {
+ panel.loader.hide();
+ var scs = rpc.xmlhttp.responseText.extractScript();
+ panel.addContent(rpc.xmlhttp.responseText);
+ scs.evalScript();
+ //Pm.objeto.innerHTML="asdasd";
+ }.extend(this,panel);
+ r.make();
+ }.extend(this)},
+ {image:"/images/event_timer.png",text:"intermediate timer event ",launch:function(event){
+
+ this.tmp.eventsPanel = panel =new leimnud.module.panel();
+ panel.options={
+ limit :true,
+ size :{w:700,h:380},
+ position:{x:50,y:50,center:true},
+ title :G_STRINGS.ID_EVENT_MULTIPLE,
+ theme :this.options.theme,
+ control :{close:true,resize:false},fx:{modal:true},
+ statusBar:false,
+ fx :{shadow:true,modal:true}
+ };
+ panel.make();
+ panel.loader.show();
+ var r = new leimnud.module.rpc.xmlhttp({
+ url:this.options.dataServer,
+ args:"action=events&data="+{
+ pro_uid :this.options.uid,
+ type:"multiple"
+ }.toJSONString()
+ });
+ r.callback=function(rpc,panel)
+ {
+ panel.loader.hide();
+ var scs = rpc.xmlhttp.responseText.extractScript();
+ panel.addContent(rpc.xmlhttp.responseText);
+ scs.evalScript();
+ //Pm.objeto.innerHTML="asdasd";
+ }.extend(this,panel);
+ r.make();
+ }.extend(this)},
+ {image:"/images/event_timer.png",text:" intermediate Boundary timer event",launch:function(event){}},
+ /* {image:"/images/event_messageThrow.png",text:"end message event",launch:function(event){
+ this.tmp.eventsPanel = panel =new leimnud.module.panel();
+ panel.options={
+ limit :true,
+ size :{w:700,h:380},
+ position:{x:50,y:50,center:true},
+ title :G_STRINGS.ID_EVENT_MESSAGE,
+ theme :this.options.theme,
+ control :{close:true,resize:false},fx:{modal:true},
+ statusBar:false,
+ fx :{shadow:true,modal:true}
+ };
+ panel.make();
+ panel.loader.show();
+ var r = new leimnud.module.rpc.xmlhttp({
+ url:this.options.dataServer,
+ args:"action=events&data="+{
+ pro_uid :this.options.uid,
type:"message"
- }.toJSONString()
- });
- r.callback=function(rpc,panel)
- {
- panel.loader.hide();
- var scs = rpc.xmlhttp.responseText.extractScript();
- panel.addContent(rpc.xmlhttp.responseText);
- scs.evalScript();
- //Pm.objeto.innerHTML="asdasd";
- }.extend(this,panel);
- r.make();
- }.extend(this)},
-
- {image:"/images/event_conditional.png",text:"Conditional",launch:function(event){
- this.tmp.eventsPanel = panel =new leimnud.module.panel();
- panel.options={
- limit :true,
- size :{w:700,h:380},
- position:{x:50,y:50,center:true},
- title :G_STRINGS.ID_EVENT_CONDITIONAL,
- theme :this.options.theme,
- control :{close:true,resize:false},fx:{modal:true},
- statusBar:false,
- fx :{shadow:true,modal:true}
- };
- panel.make();
- panel.loader.show();
- var r = new leimnud.module.rpc.xmlhttp({
- url:this.options.dataServer,
- args:"action=events&data="+{
- pro_uid :this.options.uid,
- type:"conditional"
- }.toJSONString()
- });
- r.callback=function(rpc,panel)
- {
- panel.loader.hide();
- var scs = rpc.xmlhttp.responseText.extractScript();
- panel.addContent(rpc.xmlhttp.responseText);
- scs.evalScript();
- //Pm.objeto.innerHTML="asdasd";
- }.extend(this,panel);
- r.make();
- }.extend(this)},
- {image:"/images/event_multiple.png",text:"Multiple",launch:function(event){
- this.tmp.eventsPanel = panel =new leimnud.module.panel();
- panel.options={
- limit :true,
- size :{w:700,h:380},
- position:{x:50,y:50,center:true},
- title :G_STRINGS.ID_EVENT_MULTIPLE,
- theme :this.options.theme,
- control :{close:true,resize:false},fx:{modal:true},
- statusBar:false,
- fx :{shadow:true,modal:true}
- };
- panel.make();
- panel.loader.show();
- var r = new leimnud.module.rpc.xmlhttp({
- url:this.options.dataServer,
- args:"action=events&data="+{
- pro_uid :this.options.uid,
- type:"multiple"
- }.toJSONString()
- });
- r.callback=function(rpc,panel)
- {
- panel.loader.hide();
- var scs = rpc.xmlhttp.responseText.extractScript();
- panel.addContent(rpc.xmlhttp.responseText);
- scs.evalScript();
- //Pm.objeto.innerHTML="asdasd";
- }.extend(this,panel);
- r.make();
- }.extend(this)}
-
-
- ]}
+ }.toJSONString()
+ });
+ r.callback=function(rpc,panel)
+ {
+ panel.loader.hide();
+ var scs = rpc.xmlhttp.responseText.extractScript();
+ panel.addContent(rpc.xmlhttp.responseText);
+ scs.evalScript();
+ //Pm.objeto.innerHTML="asdasd";
+ }.extend(this,panel);
+ r.make();
+ }.extend(this)},*/
+ ]}
]
});
@@ -752,19 +815,24 @@ var processmap=function(){
this.data.render.task();
},
task:function()
- {
- var lngt = this.data.db.task.length;
- for(var i =0;iAddContent('template', '', '', '', $oTemplatePower);
$oCase = new Cases();
-
+
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
$sStatus = $Fields['APP_STATUS'];
@@ -95,15 +96,12 @@
$APP_NUMBER = $Fields['APP_NUMBER'];
$APP_TITLE = $Fields['TITLE'];
- //optimize for speed, we are reading process info once
- //$oProcess = new Process();
- //$oProcessFields = $oProcess->Load($_SESSION['PROCESS']);
- $oProcess = ProcessPeer::retrieveByPk( $_SESSION['PROCESS'] );
- $oProcessFields = $oProcess->toArray(BasePeer::TYPE_FIELDNAME);
+ $oProcess = new Process();
+ $oProcessFieds = $oProcess->Load($_SESSION['PROCESS']);
#trigger debug routines...
- if( isset($oProcessFields['PRO_DEBUG']) && $oProcessFields['PRO_DEBUG'] ) { #here we must verify if is a debugg session
+ if( isset($oProcessFieds['PRO_DEBUG']) && $oProcessFieds['PRO_DEBUG'] ) { #here we must verify if is a debugg session
$_SESSION['TRIGGER_DEBUG']['ISSET'] = 1;
$_SESSION['PMDEBUGGER']= true;
}
@@ -115,7 +113,7 @@
//cleaning debug variables
if( !isset($_GET['breakpoint']) ) {
if( isset($_SESSION['TRIGGER_DEBUG']['info']) ) unset($_SESSION['TRIGGER_DEBUG']['info']);
-
+
if (!isset($_SESSION['_NO_EXECUTE_TRIGGERS_'])) {
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array();
}
@@ -154,7 +152,7 @@
* Here we throw the debug view
*/
if ( isset($_GET['breakpoint']) ) {
-
+
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader');
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker');
G::RenderPage('publish', 'blank');
@@ -204,7 +202,7 @@
/** Added By erik 16-05-08
* Description: this was added for the additional database connections */
G::LoadClass ('dbConnections');
- $oDbConnections = new dbConnections(NULL);
+ $oDbConnections = new dbConnections($_SESSION['PROCESS']);
$oDbConnections->loadAdditionalConnections();
$_SESSION['CURRENT_DYN_UID'] = $_GET['UID'];
@@ -213,7 +211,7 @@
case 'INPUT_DOCUMENT':
$oInputDocument = new InputDocument();
- $Fields = $oInputDocument->load($_GET['UID']);
+ $Fields = $oInputDocument->load($_GET['UID']);
if (!$aPreviousStep) {
$Fields['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['PREVIOUS_STEP_LABEL'] = '';
@@ -221,7 +219,7 @@
else {
$Fields['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = $aPreviousStep['PAGE'];
$Fields['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = G::loadTranslation("ID_PREVIOUS_STEP");
-
+
$Fields['PREVIOUS_STEP'] = $aPreviousStep['PAGE'];
$Fields['PREVIOUS_STEP_LABEL'] = G::loadTranslation("ID_PREVIOUS_STEP");
}
@@ -248,14 +246,14 @@
$Fields['MESSAGE2'] = G::LoadTranslation('ID_PLEASE_SELECT_FILE');
//START: If there is a Break Step registered from Plugin Similar as a Trigger debug
$oPluginRegistry =& PMPluginRegistry::getSingleton();
- if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
- $oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED']) );
- }
+ if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
+ $oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED']) );
+ }
//END: If there is a Break Step registered from Plugin
-
+
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['UID']), array_merge(array('DOC_UID'=>$_GET['UID']),$Fields));//$aFields
-
- //call plugin
+
+ //call plugin
//if ( $oPluginRegistry->existsTrigger ( PM_CASE_DOCUMENT_LIST ) ) {
// $folderData = new folderData (null, null, $_SESSION['APPLICATION'], null, $_SESSION['USER_LOGGED'] );
// $oPluginRegistry =& PMPluginRegistry::getSingleton();
@@ -264,15 +262,15 @@
//}
//else
// $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['UID']), array_merge(array('DOC_UID'=>$_GET['UID']),$Fields));//$aFields
-
- $oHeadPublisher =& headPublisher::getSingleton();
+
+ $oHeadPublisher =& headPublisher::getSingleton();
$titleDocument="".$Fields['INP_DOC_TITLE']."
".G::LoadTranslation('ID_INPUT_DOCUMENT')."
";
if($Fields['INP_DOC_DESCRIPTION']) $titleDocument.= " ".str_replace("\n","",str_replace("'","\'",nl2br(htmlentities(utf8_decode($Fields['INP_DOC_DESCRIPTION'])))))."";
-
+
$oHeadPublisher->addScriptCode("documentName='{$titleDocument}';");
break;
- case 'VIEW':
+ case 'VIEW':
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$oAppDocument = new AppDocument();
@@ -304,7 +302,6 @@
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load( $_GET['UID'] );
-
if (!$aPreviousStep) {
$aOD['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
}
@@ -319,43 +316,19 @@
case 'GENERATE':
//START: If there is a Break Step registered from Plugin Similar as a Trigger debug
$oPluginRegistry =& PMPluginRegistry::getSingleton();
- if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
- $oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED'],'DOC_UID'=>$_GET['UID'],'PRO_UID'=>$_SESSION['PROCESS']) );
- }
+ if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT_BEFORE ) ) {//If a Plugin has registered a Break Page Evaluator
+ $oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED']) );
+ }
//END: If there is a Break Step registered from Plugin
-
+
$sFilename = ereg_replace('[^A-Za-z0-9_]', '_', G::replaceDataField($aOD['OUT_DOC_FILENAME'], $Fields['APP_DATA']));
if ( $sFilename == '' ) $sFilename='_';
$pathOutput = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP . 'outdocs'. PATH_SEP ;
G::mk_dir ( $pathOutput );
switch ( $aOD['OUT_DOC_TYPE'] ) {
- case 'HTML' :
- $aProperties = array(); //maui
-
- if(!isset($aOD['OUT_DOC_MEDIA']))
- $aOD['OUT_DOC_MEDIA'] = 'Letter';
- if(!isset($aOD['OUT_DOC_LEFT_MARGIN']))
- $aOD['OUT_DOC_LEFT_MARGIN'] = '15';
- if(!isset($aOD['OUT_DOC_RIGHT_MARGIN']))
- $aOD['OUT_DOC_RIGHT_MARGIN'] = '15';
- if(!isset($aOD['OUT_DOC_TOP_MARGIN']))
- $aOD['OUT_DOC_TOP_MARGIN'] = '15';
- if(!isset($aOD['OUT_DOC_BOTTOM_MARGIN']))
- $aOD['OUT_DOC_BOTTOM_MARGIN'] = '15';
-
- if(isset($aOD['OUT_DOC_VERSIONING']) && $aOD['OUT_DOC_VERSIONING']!=0){
- $oAppDocument= new AppDocument();
- $lastDocVersion=$oAppDocument->getLastDocVersion($_GET['UID'],$_SESSION['APPLICATION']);
- $lastDocVersion = $lastDocVersion +1;
- $lastDocVersion = '_'.$lastDocVersion;
- }else {
- $lastDocVersion='';
- }
-
- $aProperties['media']=$aOD['OUT_DOC_MEDIA'];
- $aProperties['margins']=array('left' => $aOD['OUT_DOC_LEFT_MARGIN'], 'right' => $aOD['OUT_DOC_RIGHT_MARGIN'], 'top' => $aOD['OUT_DOC_TOP_MARGIN'], 'bottom' => $aOD['OUT_DOC_BOTTOM_MARGIN'],);
+ case 'HTML' :
$oOutputDocument->generate( $_GET['UID'], $Fields['APP_DATA'], $pathOutput,
- $sFilename.$lastDocVersion, $aOD['OUT_DOC_TEMPLATE'], (boolean)$aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'],$aProperties );
+ $sFilename, $aOD['OUT_DOC_TEMPLATE'], (boolean)$aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'] );
break;
case 'JRXML' :
//creating the xml with the application data;
@@ -365,22 +338,22 @@
}
$xmlData .= "\n";
$iSize = file_put_contents ( $javaOutput . 'addressBook.xml' , $xmlData );
-
+
G::LoadClass ('javaBridgePM');
$JBPM = new JavaBridgePM();
$JBPM->checkJavaExtension();
-
+
$util = new Java("com.processmaker.util.pmutils");
$util->setInputPath( $javaInput );
$util->setOutputPath( $javaOutput );
-
+
//$content = file_get_contents ( PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.jrxml' );
//$iSize = file_put_contents ( $javaInput . $aOD['OUT_DOC_UID'] . '.jrxml', $content );
copy ( PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.jrxml', $javaInput . $aOD['OUT_DOC_UID'] . '.jrxml' );
-
+
$outputFile = $javaOutput . $sFilename . '.pdf' ;
print $util->jrxml2pdf( $aOD['OUT_DOC_UID'] . '.jrxml' , basename($outputFile) );
-
+
//$content = file_get_contents ( $outputFile );
//$iSize = file_put_contents ( $pathOutput . $sFilename . '.pdf' , $content );
copy ( $outputFile, $pathOutput . $sFilename . '.pdf' );
@@ -394,46 +367,46 @@
}
$xmlData .= "\n";
//$iSize = file_put_contents ( $javaOutput . 'addressBook.xml' , $xmlData );
-
+
G::LoadClass ('javaBridgePM');
$JBPM = new JavaBridgePM();
$JBPM->checkJavaExtension();
-
+
$util = new Java("com.processmaker.util.pmutils");
$util->setInputPath( $javaInput );
$util->setOutputPath( $javaOutput );
-
+
copy ( PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.pdf', $javaInput . $aOD['OUT_DOC_UID'] . '.pdf' );
-
+
$outputFile = $javaOutput . $sFilename . '.pdf' ;
print $util->writeVarsToAcroFields( $aOD['OUT_DOC_UID'] . '.pdf' , $xmlData );
-
+
copy ( $javaOutput. $aOD['OUT_DOC_UID'] . '.pdf', $pathOutput . $sFilename . '.pdf' );
-
+
break;
default :
throw ( new Exception ('invalid output document' ));
}
-
+
require_once 'classes/model/AppFolder.php';
require_once 'classes/model/AppDocument.php';
-
- //Get the Custom Folder ID (create if necessary)
+
+ //Get the Custom Folder ID (create if necessary)
$oFolder=new AppFolder();
$folderId=$oFolder->createFromPath($aOD['OUT_DOC_DESTINATION_PATH']);
-
+
//Tags
$fileTags=$oFolder->parseTags($aOD['OUT_DOC_TAGS']);
-
+
//Get last Document Version and apply versioning if is enabled
-
- $oAppDocument= new AppDocument();
+
+ $oAppDocument= new AppDocument();
$lastDocVersion=$oAppDocument->getLastDocVersion($_GET['UID'],$_SESSION['APPLICATION']);
-
+
//if(($aOD['OUT_DOC_VERSIONING'])||($lastDocVersion==0)){
// $lastDocVersion++;
//}
-
+
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDocumentPeer::APP_UID, $_SESSION['APPLICATION']);
//$oCriteria->add(AppDocumentPeer::DEL_INDEX, $_SESSION['INDEX']);
@@ -442,9 +415,9 @@
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
$oDataset = AppDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
- $oDataset->next();
- if(($aOD['OUT_DOC_VERSIONING'])&&($lastDocVersion!=0)){//Create new Version of current output
- if ($aRow = $oDataset->getRow()) {
+ $oDataset->next();
+ if(($aOD['OUT_DOC_VERSIONING'])&&($lastDocVersion!=0)){//Create new Version of current output
+ if ($aRow = $oDataset->getRow()) {
$aFields = array('APP_DOC_UID' => $aRow['APP_DOC_UID'],
'APP_UID' => $_SESSION['APPLICATION'],
'DEL_INDEX' => $_SESSION['INDEX'],
@@ -456,12 +429,12 @@
'APP_DOC_FILENAME' => $sFilename,
'FOLDER_UID' => $folderId,
'APP_DOC_TAGS' => $fileTags);
- $oAppDocument = new AppDocument();
- $oAppDocument->create($aFields);
+ $oAppDocument = new AppDocument();
+ $oAppDocument->create($aFields);
$sDocUID = $aRow['APP_DOC_UID'];
}
}else{//No versioning so Update a current Output or Create new if no exist
- if ($aRow = $oDataset->getRow()) { //Update
+ if ($aRow = $oDataset->getRow()) { //Update
$aFields = array('APP_DOC_UID' => $aRow['APP_DOC_UID'],
'APP_UID' => $_SESSION['APPLICATION'],
'DEL_INDEX' => $_SESSION['INDEX'],
@@ -476,7 +449,7 @@
$oAppDocument = new AppDocument();
$oAppDocument->update($aFields);
$sDocUID = $aRow['APP_DOC_UID'];
- }else{ //create
+ }else{ //create
if($lastDocVersion==0) $lastDocVersion++;
$aFields = array('APP_UID' => $_SESSION['APPLICATION'],
'DEL_INDEX' => $_SESSION['INDEX'],
@@ -490,7 +463,7 @@
'APP_DOC_TAGS' => $fileTags);
$oAppDocument = new AppDocument();
$aFields['APP_DOC_UID']=$sDocUID = $oAppDocument->create($aFields);
-
+
}
}
@@ -506,17 +479,17 @@
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry =& PMPluginRegistry::getSingleton();
- if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) {
- $triggerDetail=$oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
- $aFields['APP_DOC_PLUGIN']=$triggerDetail->sNamespace;
-
+ if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) {
+ $triggerDetail=$oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
+ $aFields['APP_DOC_PLUGIN']=$triggerDetail->sNamespace;
+
$oAppDocument1 = new AppDocument();
$oAppDocument1->update($aFields);
-
+
$sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP;
$oData['APP_UID'] = $_SESSION['APPLICATION'];
- $oData['ATTACHMENT_FOLDER'] = true;
+ $oData['ATTACHMENT_FOLDER'] = true;
switch($aOD['OUT_DOC_GENERATE']){
case "BOTH":
$documentData = new uploadDocumentData (
@@ -534,7 +507,7 @@
if($uploadReturn){//Only delete if the file was saved correctly
unlink ( $pathOutput . $sFilename. '.pdf' );
}
-
+
$documentData = new uploadDocumentData (
@@ -597,55 +570,50 @@
G::header('location: '.$outputNextStep);
die;
break;
- case 'VIEW':
+ case 'VIEW':
require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument();
$lastVersion=$oAppDocument->getLastAppDocVersion($_GET['DOC'],$_SESSION['APPLICATION']);
$aFields = $oAppDocument->load($_GET['DOC'],$lastVersion);
+
$listing=false;
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if($oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) {
$folderData = new folderData(null, null, $_SESSION['APPLICATION'], null, $_SESSION['USER_LOGGED']);
$folderData->PMType = "OUTPUT";
- $folderData->returnList = true;
- $listing=$oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData);
+ $folderData->returnList = true;
+ $listing=$oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData);
}
-
+
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aGields = $oOutputDocument->load($aFields['DOC_UID']);
-
- if(isset($aGields['OUT_DOC_VERSIONING']) && $aGields['OUT_DOC_VERSIONING']!=0){
- $oAppDocument= new AppDocument();
- $lastDocVersion=$oAppDocument->getLastDocVersion($_GET['UID'],$_SESSION['APPLICATION']);
- }else {
- $lastDocVersion='';
- }
+
$aFields['VIEW1'] = G::LoadTranslation('ID_OPEN');
-
+
$aFields['VIEW2'] = G::LoadTranslation('ID_OPEN');
- $aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$lastDocVersion . '&ext=doc&random=' . rand();
+ $aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$aFields['DOC_VERSION'] . '&ext=doc&random=' . rand();
+
+ $aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$aFields['DOC_VERSION'] . '&ext=pdf&random=' . rand();
- $aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&v='.$lastDocVersion . '&ext=pdf&random=' . rand();
-
if ( is_array ($listing) ){//If exist in Plugin Document List
foreach($listing as $folderitem) {
- if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='DOC')){
+ if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='DOC')){
$aFields['VIEW1'] = G::LoadTranslation('ID_GET_EXTERNAL_FILE');
$aFields['FILE1'] = $folderitem->downloadScript;
continue;
}
- if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='PDF')){
+ if(($folderitem->filename==$aFields['APP_DOC_UID'])&&($folderitem->type=='PDF')){
$aFields['VIEW2'] = G::LoadTranslation('ID_GET_EXTERNAL_FILE');
$aFields['FILE2'] = $folderitem->downloadScript;
continue;
}
}
- }
-
+ }
+
if(($aGields['OUT_DOC_GENERATE']=='BOTH')||($aGields['OUT_DOC_GENERATE']==''))
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocument1', '', G::array_merges($aOD, $aFields), '');
@@ -655,17 +623,16 @@
if($aGields['OUT_DOC_GENERATE']=='PDF')
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocument3', '', G::array_merges($aOD, $aFields), '');
-
+
break;
}
break;
case 'ASSIGN_TASK':
$oDerivation = new Derivation();
- //$oProcess = new Process(); //optimized for speed, we already load process row
+ $oProcess = new Process();
$aData = $oCase->loadCase($_SESSION['APPLICATION']);
- //$aFields['PROCESS'] = $oProcess->load($_SESSION['PROCESS']);
- $aFields['PROCESS'] = $oProcessFields;
+ $aFields['PROCESS'] = $oProcess->load($_SESSION['PROCESS']);
$aFields['PREVIOUS_PAGE'] = $aPreviousStep['PAGE'];
$aFields['PREVIOUS_PAGE_LABEL'] = G::LoadTranslation('ID_PREVIOUS_STEP');
$aFields['ASSIGN_TASK'] = G::LoadTranslation('ID_ASSIGN_TASK');
@@ -677,18 +644,23 @@
$aFields['CONTINUE'] = G::LoadTranslation('ID_CONTINUE');
$aFields['CONTINUE_WITH_OPTION'] = G::LoadTranslation('ID_CONTINUE_WITH_OPTION');
$aFields['FINISH_WITH_OPTION'] = G::LoadTranslation('ID_FINISH_WITH_OPTION');
+ $aFields['TAS_TIMING_TITLE'] = 'Timing Control';
+ $aFields['TAS_DURATION'] = 'Task Duration';
+ $aFields['TAS_TIMEUNIT'] = 'Task Unit';
+ $aFields['TAS_TYPE_DAY'] = 'Count Days By';
+ $aFields['TAS_CALENDAR'] = 'Calendar';
$aFields['TASK'] = $oDerivation->prepareInformation(
array( 'USER_UID' => $_SESSION['USER_LOGGED'],
'APP_UID' => $_SESSION['APPLICATION'],
'DEL_INDEX' => $_SESSION['INDEX'])
);
if ( empty($aFields['TASK']) ) {
- throw ( new Exception ( G::LoadTranslation ( 'ID_NO_DERIVATION_RULE') ) );
+ throw ( new Exception ( G::LoadTranslation( 'ID_NO_DERIVATION_RULE') ) );
}
//take the first derivation rule as the task derivation rule type.
$aFields['PROCESS']['ROU_TYPE'] = $aFields['TASK'][1]['ROU_TYPE'];
$aFields['PROCESS']['ROU_FINISH_FLAG'] = false;
-
+
foreach ( $aFields['TASK'] as $sKey => &$aValues)
{
$sPriority = '';//set priority value
@@ -715,7 +687,7 @@
$hiddenName = "form[TASKS][" . $sKey . "][USR_UID]";
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_UID'] = $aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED']['USR_FULLNAME'];
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_HIDDEN_FIELD'] = '';
-
+ //var_dump($aFields);
//there is a error with reportsTo, when the USR_UID is empty means there are no manager for this user, so we are disabling buttons
//but this validation is not for SELF_SERVICE
if ( $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'] != 'SELF_SERVICE' )
@@ -739,6 +711,96 @@
$aFields['TASK'][$sKey]['NEXT_TASK']['USR_UID'] = $sAux;
break;
+ case 'CANCEL_MI':
+ case 'STATIC_MI':
+ //count the Users in the group
+ $cntInstanceUsers = count($aValues['NEXT_TASK']['USER_ASSIGNED']);
+
+ //set TAS_MI_INSTANCE_VARIABLE value
+ $sMIinstanceVar = '';
+ if ($aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'] != '') {
+ if (isset($aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'])]))
+ {
+ $sMIinstanceVar = $aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'])];
+ if($sMIinstanceVar > $cntInstanceUsers)
+ throw (new Exception("Total Multiple Instance Task cannot be greater than number of users in the group."));
+ else if($sMIinstanceVar == 0)
+ throw (new Exception("Total Multiple Instance Task cannot be zero."));
+ }
+ else if(is_int((int)$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE']))
+ {
+ $sMIinstanceVar = $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_INSTANCE_VARIABLE'];
+ if($sMIinstanceVar > $cntInstanceUsers)
+ throw (new Exception("Total Multiple Instance Task cannot be greater than number of users in the group."));
+ }
+ else
+ throw (new Exception("Total Multiple Instance Task variable doesn't have valid value."));
+ }
+ else
+ throw (new Exception("Total Multiple Instance Task variable doesn't have valid value."));
+ ////set TAS_MI_INSTANCE_VARIABLE value
+
+ //set TAS_MI_COMPLETE_VARIABLE value
+ $sMIcompleteVar = '';
+ if ($aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'] != '') {
+ if (isset($aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'])]))
+ {
+ $sMIcompleteVar = $aData['APP_DATA'][str_replace('@@', '', $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'])];
+ //
+ if($sMIcompleteVar > $sMIinstanceVar)
+ throw (new Exception("Total Multiple Instance Task to complete cannot be greater than Total number of Instances."));
+ }
+ else if(is_int((int)$aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE']))
+ {
+ $sMIcompleteVar = $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_MI_COMPLETE_VARIABLE'];
+ if($sMIcompleteVar > $sMIinstanceVar)
+ throw (new Exception("Total Multiple Instance Task to complete cannot be greater than Total number of Instances."));
+ }
+ else
+ throw ( new Exception("Total Multiple Instance Task to complete variable doesn't have valid value.") ) ;
+
+ }
+ else
+ throw ( new Exception("Total Multiple Instance Task to complete variable doesn't have valid value.") ) ;
+ //set TAS_MI_COMPLETE_VARIABLE value
+ $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_NEXT'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'];
+
+ //If the Users in the group is equal to the MI Instance variable then Show all the users without Dropdown
+ if($sMIinstanceVar == $cntInstanceUsers)
+ {
+ foreach ($aValues['NEXT_TASK']['USER_ASSIGNED'] as $key=>$aUser)
+ {
+ $hiddenName = "form[TASKS][" . $sKey . "][NEXT_TASK][USER_ASSIGNED][".$key."][USR_UID]";
+ $aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED'][$key]['USR_UID'] = $aUser['USR_FULLNAME'];
+ $aFields['TASK'][$sKey]['NEXT_TASK']['USER_ASSIGNED'][$key]['USR_HIDDEN_FIELD'] = '';
+ }
+ }
+ //If the Users in the group is not equal to the MI Instance variable then Show Only count users in dropdown
+ else
+ {
+ $Aux = array();
+ foreach ($aValues['NEXT_TASK']['USER_ASSIGNED'] as $aUser)
+ {
+ $Aux[$aUser['USR_UID']] = $aUser['USR_FULLNAME'];
+ }
+ asort($Aux);
+ $aAux = '';
+ foreach ($Aux as $akey => $value)
+ {
+ $aAux .= '';
+ }
+
+ for($key=0; $key < $sMIinstanceVar; $key++)
+ {
+ $hiddenName = "form[TASKS][" . $sKey . "][NEXT_TASK][USER_ASSIGNED][".$key."][USR_UID]";
+ $sAux = "
-
+
{if $PROCESS.ERROR eq '' && $PROCESS.ROU_TYPE neq 'SELECT' && $PROCESS.ROU_FINISH_FLAG }
| {$END_OF_PROCESS} |
@@ -44,66 +44,107 @@
{$ASSIGN_TASK} |
{/if}
-
+
{foreach key=id item=data from=$TASK}
| |
|
-
+
{if $PROCESS.ROU_TYPE eq 'SELECT'}
- {/if}
- {/foreach}
+ {/if}
+ {/foreach}
{if $PROCESS.ERROR eq '' && $PROCESS.ROU_TYPE neq 'SELECT' && ! $PROCESS.ROU_FINISH_FLAG }
|
|
- {/if}
+ {/if}
{if $PROCESS.ERROR eq '' && $PROCESS.ROU_TYPE neq 'SELECT' && $PROCESS.ROU_FINISH_FLAG }
|
@@ -112,12 +153,12 @@
|
{/if}
-
+
-
+
@@ -155,7 +196,7 @@ if(!sw){
{literal} if (client.browser == "msie" || client.browser == "safari" || client.browser == "firefox"){ {/literal}
document.frmDerivation.submit();
{literal} } {/literal}
- {literal}
+ {literal}
}.extend(document.getElementById('btnContinue'))); {/literal}
diff --git a/workflow/engine/xmlform/patterns/patterns_Discriminator.html b/workflow/engine/xmlform/patterns/patterns_Discriminator.html
new file mode 100755
index 000000000..b14f3052e
--- /dev/null
+++ b/workflow/engine/xmlform/patterns/patterns_Discriminator.html
@@ -0,0 +1,54 @@
+
\ No newline at end of file
diff --git a/workflow/engine/xmlform/patterns/patterns_Discriminator.xml b/workflow/engine/xmlform/patterns/patterns_Discriminator.xml
new file mode 100755
index 000000000..787be5194
--- /dev/null
+++ b/workflow/engine/xmlform/patterns/patterns_Discriminator.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Discriminator
+
+
+
+
+
+
+
+ Cancel
+
+
+
+ Save
+
+
+= routeCount)
+ {
+ new leimnud.module.app.alert().make({label: 'No of Discriminators cannot be Greater than equal to Parallel Tasks'});
+ return false;
+ }
+ else if(oCond.value == 0)
+ {
+ new leimnud.module.app.alert().make({label: 'Zero Task cannot be Discriminated'});
+ return false;
+ }
+ aData.data.push(oAux.value);
+ i++;
+ }
+ Pm.data.build.derivation(aData);
+ ajax_post(oForm.action, oForm, 'POST');
+ bModified = false;
+ Pm.tmp.derivationsPanel.remove();
+};
+
+function cancel(){
+ Pm.tmp.derivationsPanel.remove();
+}
+]]>
+
+
\ No newline at end of file
diff --git a/workflow/engine/xmlform/patterns/patterns_GridDiscriminator.xml b/workflow/engine/xmlform/patterns/patterns_GridDiscriminator.xml
new file mode 100755
index 000000000..13cd73192
--- /dev/null
+++ b/workflow/engine/xmlform/patterns/patterns_GridDiscriminator.xml
@@ -0,0 +1,20 @@
+
+
+
+Next Task
+
+
+
+ No of Task to be Discriminated
+
+
+
+Type of Discriminator
+
+
+
+
+
+
\ No newline at end of file
diff --git a/workflow/engine/xmlform/processes/processes_Export.xml b/workflow/engine/xmlform/processes/processes_Export.xml
index 520a15d8d..3858a350c 100644
--- a/workflow/engine/xmlform/processes/processes_Export.xml
+++ b/workflow/engine/xmlform/processes/processes_Export.xml
@@ -9,6 +9,10 @@
Process Title
+
+ Process Uid
+
+
Description
@@ -18,12 +22,18 @@
+
+
File
+
+ File xpdl
+
+
+
+
+
+
\ No newline at end of file
diff --git a/workflow/engine/xmlform/processes/processes_ImportExistingXpdl.xml b/workflow/engine/xmlform/processes/processes_ImportExistingXpdl.xml
new file mode 100644
index 000000000..4b8110182
--- /dev/null
+++ b/workflow/engine/xmlform/processes/processes_ImportExistingXpdl.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+ Importing Existing Process ]]>
+
+
+
+ The process you are trying to import already exists. Please select one of the following options to continue:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Save
+
+
+ Cancel
+
+
+
+
+
\ No newline at end of file
diff --git a/workflow/engine/xmlform/processes/processes_ImportXpdl.html b/workflow/engine/xmlform/processes/processes_ImportXpdl.html
new file mode 100644
index 000000000..fa814fbe4
--- /dev/null
+++ b/workflow/engine/xmlform/processes/processes_ImportXpdl.html
@@ -0,0 +1,37 @@
+
+
+
+
+
diff --git a/workflow/engine/xmlform/processes/processes_ImportXpdl.xml b/workflow/engine/xmlform/processes/processes_ImportXpdl.xml
new file mode 100644
index 000000000..d93f0e85b
--- /dev/null
+++ b/workflow/engine/xmlform/processes/processes_ImportXpdl.xml
@@ -0,0 +1,38 @@
+
+
+
+
+ Import Process
+
+
+
+
+ File
+
+
+
+ Import
+
+
+
+ Cancel
+
+
+
+
+
\ No newline at end of file
diff --git a/workflow/engine/xmlform/setup/emails.xml b/workflow/engine/xmlform/setup/emails.xml
index d1f6328c5..85fded9ad 100644
--- a/workflow/engine/xmlform/setup/emails.xml
+++ b/workflow/engine/xmlform/setup/emails.xml
@@ -86,12 +86,12 @@ var send_test_mail;
var mail_to;
function verifyFields(oForm)
-{
+{
switch (getField('MESS_ENGINE').value) {
- case 'PHPMAILER':
+ case 'PHPMAILER':
verifyPassword = 0;
oAuxS = $('form[MESS_SERVER]').value;
- if (oAuxS == ''){
+ if (oAuxS == ''){
new leimnud.module.app.alert().make({
label:G_STRINGS.ID_SERVER_REQUIRED
});
@@ -99,7 +99,7 @@ function verifyFields(oForm)
}
else{
oAuxA = $('form[MESS_ACCOUNT]').value;
- if(oAuxA == ''){
+ if(oAuxA == ''){
new leimnud.module.app.alert().make({
label:G_STRINGS.ID_MESS_ACCOUNT_REQUIRED
});
@@ -108,22 +108,22 @@ function verifyFields(oForm)
else{
if ($('form[MESS_RAUTH]').checked) {
oAuxP = $('form[MESS_PASSWORD]').value;
- if (oAuxP == ''){
+ if (oAuxP == ''){
new leimnud.module.app.alert().make({
label:G_STRINGS.ID_PASSWORD_REQUIRED
});
return false;
}
- else{
+ else{
verifyPassword = 1;
- }
+ }
} else {
verifyPassword = 1;
- }
+ }
if(verifyPassword == 1){
if ($('form[MESS_TEST_MAIL]').checked) {
oAuxE = $('form[MESS_TEST_MAIL_TO]').value;
- if (oAuxE == ''){
+ if (oAuxE == ''){
new leimnud.module.app.alert().make({
label:G_STRINGS.ID_EMAIL_REQUIRED
});
@@ -131,7 +131,7 @@ function verifyFields(oForm)
}
else{
testConnection();
- }
+ }
} else {
testConnection();
}
@@ -142,7 +142,7 @@ function verifyFields(oForm)
case 'MAIL':
if ($('form[MESS_TEST_MAIL]').checked) {
oAuxE = $('form[MESS_TEST_MAIL_TO]').value;
- if (oAuxE == ''){
+ if (oAuxE == ''){
new leimnud.module.app.alert().make({
label:G_STRINGS.ID_EMAIL_REQUIRED
});
@@ -150,13 +150,13 @@ function verifyFields(oForm)
}
else{
testConnectionMail();
- }
- }
+ }
+ }
else {
testConnectionMail();
}
break;
-
+
}
}
function testConnection() {
@@ -216,7 +216,7 @@ function testConnection() {
-function testConnectionMail()
+function testConnectionMail()
{
resultset = true;
if ($('form[MESS_TEST_MAIL]').checked) {
@@ -245,14 +245,14 @@ function testConnectionMail()
else {
if( result == 'FAILED' ) {
alert(G_STRINGS.ID_MAIL_FAILED);
- }
+ }
if( result == 'INVALID' ) {
alert(G_STRINGS.ID_INVALID_EMAIL);
- }
+ }
}
}.extend(this);
oRPC.make();
- }
+ }
else {
alert(G_STRINGS.ID_CHECK_REQUIRED);
}
@@ -354,7 +354,7 @@ function AJAX()
function initSet(){
- //$('form[MESS_RAUTH]').checked = true;
+ //$('form[MESS_RAUTH]').checked = true;
hideRowById('MESS_TEST_MAIL_TO');
if(!($('form[MESS_ENABLED]').checked)) {
hideRowById('MESS_ENGINE');
@@ -394,7 +394,7 @@ leimnud.event.add(getField('MESS_RAUTH'), 'click', function() {
leimnud.event.add(getField('MESS_TEST_MAIL'), 'click', function() {
if (this.checked) {
showRowById('MESS_TEST_MAIL_TO');
-
+
} else {
hideRowById('MESS_TEST_MAIL_TO');
}
@@ -422,7 +422,7 @@ leimnud.event.add(getField('MESS_ENABLED'), 'click', function() {
hideRowById('MESS_TEST_MAIL_TO');
}
$('form[SAVE_CHANGES]').disabled = true;
-
+
break;
case 'PHPMAILER':
hideRowById('SAVE_CHANGES2');
diff --git a/workflow/engine/xmlform/tasks/tasks_AssignmentRules.xml b/workflow/engine/xmlform/tasks/tasks_AssignmentRules.xml
index 85507a740..97c905870 100644
--- a/workflow/engine/xmlform/tasks/tasks_AssignmentRules.xml
+++ b/workflow/engine/xmlform/tasks/tasks_AssignmentRules.xml
@@ -12,16 +12,46 @@
- Case to be assigned by
+ Case to be assigned by
Variable for Value Based Assignment
+
+ Variable for No of Instances
+
+
+
+ Variable for No of Instances to complete
+
+
+ Allow user defined timing control
+
+
Task duration
@@ -18,27 +22,53 @@
Count days by
+
SELECT CALENDAR_UID, CALENDAR_NAME FROM availableCalendars
Calendar
-
\ No newline at end of file