Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -83,9 +83,9 @@ class BpmnEventMapBuilder
|
||||
|
||||
$tMap->addColumn('EVN_CANCEL_ACTIVITY', 'EvnCancelActivity', 'int', CreoleTypes::TINYINT, false, null);
|
||||
|
||||
$tMap->addColumn('EVN_ACTIVITY REF', 'EvnActivity ref', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
$tMap->addColumn('EVN_ACTIVITY_REF', 'EvnActivityRef', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
$tMap->addColumn('EVN_WAIT_FOR COMPLETION', 'EvnWaitFor completion', 'int', CreoleTypes::TINYINT, false, null);
|
||||
$tMap->addColumn('EVN_WAIT_FOR_COMPLETION', 'EvnWaitForCompletion', 'int', CreoleTypes::TINYINT, false, null);
|
||||
|
||||
$tMap->addColumn('EVN_ERROR_NAME', 'EvnErrorName', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
|
||||
@@ -82,16 +82,16 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
protected $evn_cancel_activity = 0;
|
||||
|
||||
/**
|
||||
* The value for the evn_activity ref field.
|
||||
* The value for the evn_activity_ref field.
|
||||
* @var string
|
||||
*/
|
||||
protected $evn_activity ref = '';
|
||||
protected $evn_activity_ref = '';
|
||||
|
||||
/**
|
||||
* The value for the evn_wait_for completion field.
|
||||
* The value for the evn_wait_for_completion field.
|
||||
* @var int
|
||||
*/
|
||||
protected $evn_wait_for completion = 1;
|
||||
protected $evn_wait_for_completion = 1;
|
||||
|
||||
/**
|
||||
* The value for the evn_error_name field.
|
||||
@@ -289,25 +289,25 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [evn_activity ref] column value.
|
||||
* Get the [evn_activity_ref] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEvnActivity ref()
|
||||
public function getEvnActivityRef()
|
||||
{
|
||||
|
||||
return $this->evn_activity ref;
|
||||
return $this->evn_activity_ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [evn_wait_for completion] column value.
|
||||
* Get the [evn_wait_for_completion] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getEvnWaitFor completion()
|
||||
public function getEvnWaitForCompletion()
|
||||
{
|
||||
|
||||
return $this->evn_wait_for completion;
|
||||
return $this->evn_wait_for_completion;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -649,12 +649,12 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
} // setEvnCancelActivity()
|
||||
|
||||
/**
|
||||
* Set the value of [evn_activity ref] column.
|
||||
* Set the value of [evn_activity_ref] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setEvnActivity ref($v)
|
||||
public function setEvnActivityRef($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
@@ -663,20 +663,20 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->evn_activity ref !== $v || $v === '') {
|
||||
$this->evn_activity ref = $v;
|
||||
$this->modifiedColumns[] = BpmnEventPeer::EVN_ACTIVITY REF;
|
||||
if ($this->evn_activity_ref !== $v || $v === '') {
|
||||
$this->evn_activity_ref = $v;
|
||||
$this->modifiedColumns[] = BpmnEventPeer::EVN_ACTIVITY_REF;
|
||||
}
|
||||
|
||||
} // setEvnActivity ref()
|
||||
} // setEvnActivityRef()
|
||||
|
||||
/**
|
||||
* Set the value of [evn_wait_for completion] column.
|
||||
* Set the value of [evn_wait_for_completion] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setEvnWaitFor completion($v)
|
||||
public function setEvnWaitForCompletion($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
@@ -685,12 +685,12 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->evn_wait_for completion !== $v || $v === 1) {
|
||||
$this->evn_wait_for completion = $v;
|
||||
$this->modifiedColumns[] = BpmnEventPeer::EVN_WAIT_FOR COMPLETION;
|
||||
if ($this->evn_wait_for_completion !== $v || $v === 1) {
|
||||
$this->evn_wait_for_completion = $v;
|
||||
$this->modifiedColumns[] = BpmnEventPeer::EVN_WAIT_FOR_COMPLETION;
|
||||
}
|
||||
|
||||
} // setEvnWaitFor completion()
|
||||
} // setEvnWaitForCompletion()
|
||||
|
||||
/**
|
||||
* Set the value of [evn_error_name] column.
|
||||
@@ -991,9 +991,9 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
|
||||
$this->evn_cancel_activity = $rs->getInt($startcol + 8);
|
||||
|
||||
$this->evn_activity ref = $rs->getString($startcol + 9);
|
||||
$this->evn_activity_ref = $rs->getString($startcol + 9);
|
||||
|
||||
$this->evn_wait_for completion = $rs->getInt($startcol + 10);
|
||||
$this->evn_wait_for_completion = $rs->getInt($startcol + 10);
|
||||
|
||||
$this->evn_error_name = $rs->getString($startcol + 11);
|
||||
|
||||
@@ -1294,10 +1294,10 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
return $this->getEvnCancelActivity();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getEvnActivity ref();
|
||||
return $this->getEvnActivityRef();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getEvnWaitFor completion();
|
||||
return $this->getEvnWaitForCompletion();
|
||||
break;
|
||||
case 11:
|
||||
return $this->getEvnErrorName();
|
||||
@@ -1364,8 +1364,8 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
$keys[6] => $this->getEvnIsInterrupting(),
|
||||
$keys[7] => $this->getEvnAttachedTo(),
|
||||
$keys[8] => $this->getEvnCancelActivity(),
|
||||
$keys[9] => $this->getEvnActivity ref(),
|
||||
$keys[10] => $this->getEvnWaitFor completion(),
|
||||
$keys[9] => $this->getEvnActivityRef(),
|
||||
$keys[10] => $this->getEvnWaitForCompletion(),
|
||||
$keys[11] => $this->getEvnErrorName(),
|
||||
$keys[12] => $this->getEvnErrorCode(),
|
||||
$keys[13] => $this->getEvnEscalationName(),
|
||||
@@ -1437,10 +1437,10 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
$this->setEvnCancelActivity($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setEvnActivity ref($value);
|
||||
$this->setEvnActivityRef($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setEvnWaitFor completion($value);
|
||||
$this->setEvnWaitForCompletion($value);
|
||||
break;
|
||||
case 11:
|
||||
$this->setEvnErrorName($value);
|
||||
@@ -1538,11 +1538,11 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[9], $arr)) {
|
||||
$this->setEvnActivity ref($arr[$keys[9]]);
|
||||
$this->setEvnActivityRef($arr[$keys[9]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[10], $arr)) {
|
||||
$this->setEvnWaitFor completion($arr[$keys[10]]);
|
||||
$this->setEvnWaitForCompletion($arr[$keys[10]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[11], $arr)) {
|
||||
@@ -1640,12 +1640,12 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
$criteria->add(BpmnEventPeer::EVN_CANCEL_ACTIVITY, $this->evn_cancel_activity);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(BpmnEventPeer::EVN_ACTIVITY REF)) {
|
||||
$criteria->add(BpmnEventPeer::EVN_ACTIVITY REF, $this->evn_activity ref);
|
||||
if ($this->isColumnModified(BpmnEventPeer::EVN_ACTIVITY_REF)) {
|
||||
$criteria->add(BpmnEventPeer::EVN_ACTIVITY_REF, $this->evn_activity_ref);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(BpmnEventPeer::EVN_WAIT_FOR COMPLETION)) {
|
||||
$criteria->add(BpmnEventPeer::EVN_WAIT_FOR COMPLETION, $this->evn_wait_for completion);
|
||||
if ($this->isColumnModified(BpmnEventPeer::EVN_WAIT_FOR_COMPLETION)) {
|
||||
$criteria->add(BpmnEventPeer::EVN_WAIT_FOR_COMPLETION, $this->evn_wait_for_completion);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(BpmnEventPeer::EVN_ERROR_NAME)) {
|
||||
@@ -1771,9 +1771,9 @@ abstract class BaseBpmnEvent extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setEvnCancelActivity($this->evn_cancel_activity);
|
||||
|
||||
$copyObj->setEvnActivity ref($this->evn_activity ref);
|
||||
$copyObj->setEvnActivityRef($this->evn_activity_ref);
|
||||
|
||||
$copyObj->setEvnWaitFor completion($this->evn_wait_for completion);
|
||||
$copyObj->setEvnWaitForCompletion($this->evn_wait_for_completion);
|
||||
|
||||
$copyObj->setEvnErrorName($this->evn_error_name);
|
||||
|
||||
|
||||
@@ -58,11 +58,11 @@ abstract class BaseBpmnEventPeer
|
||||
/** the column name for the EVN_CANCEL_ACTIVITY field */
|
||||
const EVN_CANCEL_ACTIVITY = 'BPMN_EVENT.EVN_CANCEL_ACTIVITY';
|
||||
|
||||
/** the column name for the EVN_ACTIVITY REF field */
|
||||
const EVN_ACTIVITY REF = 'BPMN_EVENT.EVN_ACTIVITY REF';
|
||||
/** the column name for the EVN_ACTIVITY_REF field */
|
||||
const EVN_ACTIVITY_REF = 'BPMN_EVENT.EVN_ACTIVITY_REF';
|
||||
|
||||
/** the column name for the EVN_WAIT_FOR COMPLETION field */
|
||||
const EVN_WAIT_FOR COMPLETION = 'BPMN_EVENT.EVN_WAIT_FOR COMPLETION';
|
||||
/** the column name for the EVN_WAIT_FOR_COMPLETION field */
|
||||
const EVN_WAIT_FOR_COMPLETION = 'BPMN_EVENT.EVN_WAIT_FOR_COMPLETION';
|
||||
|
||||
/** the column name for the EVN_ERROR_NAME field */
|
||||
const EVN_ERROR_NAME = 'BPMN_EVENT.EVN_ERROR_NAME';
|
||||
@@ -111,9 +111,9 @@ abstract class BaseBpmnEventPeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('EvnUid', 'PrjUid', 'ProUid', 'EvnName', 'EvnType', 'EvnMarker', 'EvnIsInterrupting', 'EvnAttachedTo', 'EvnCancelActivity', 'EvnActivity ref', 'EvnWaitFor completion', 'EvnErrorName', 'EvnErrorCode', 'EvnEscalationName', 'EvnEscalationCode', 'EvnCondition', 'EvnMessage', 'EvnOprerationName', 'EvnOperationImplementationRef', 'EvnTimeDate', 'EvnTimeCycle', 'EvnTimeDuration', 'EvnBehavior', ),
|
||||
BasePeer::TYPE_COLNAME => array (BpmnEventPeer::EVN_UID, BpmnEventPeer::PRJ_UID, BpmnEventPeer::PRO_UID, BpmnEventPeer::EVN_NAME, BpmnEventPeer::EVN_TYPE, BpmnEventPeer::EVN_MARKER, BpmnEventPeer::EVN_IS_INTERRUPTING, BpmnEventPeer::EVN_ATTACHED_TO, BpmnEventPeer::EVN_CANCEL_ACTIVITY, BpmnEventPeer::EVN_ACTIVITY REF, BpmnEventPeer::EVN_WAIT_FOR COMPLETION, BpmnEventPeer::EVN_ERROR_NAME, BpmnEventPeer::EVN_ERROR_CODE, BpmnEventPeer::EVN_ESCALATION_NAME, BpmnEventPeer::EVN_ESCALATION_CODE, BpmnEventPeer::EVN_CONDITION, BpmnEventPeer::EVN_MESSAGE, BpmnEventPeer::EVN_OPRERATION_NAME, BpmnEventPeer::EVN_OPERATION_IMPLEMENTATION_REF, BpmnEventPeer::EVN_TIME_DATE, BpmnEventPeer::EVN_TIME_CYCLE, BpmnEventPeer::EVN_TIME_DURATION, BpmnEventPeer::EVN_BEHAVIOR, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('EVN_UID', 'PRJ_UID', 'PRO_UID', 'EVN_NAME', 'EVN_TYPE', 'EVN_MARKER', 'EVN_IS_INTERRUPTING', 'EVN_ATTACHED_TO', 'EVN_CANCEL_ACTIVITY', 'EVN_ACTIVITY REF', 'EVN_WAIT_FOR COMPLETION', 'EVN_ERROR_NAME', 'EVN_ERROR_CODE', 'EVN_ESCALATION_NAME', 'EVN_ESCALATION_CODE', 'EVN_CONDITION', 'EVN_MESSAGE', 'EVN_OPRERATION_NAME', 'EVN_OPERATION_IMPLEMENTATION_REF', 'EVN_TIME_DATE', 'EVN_TIME_CYCLE', 'EVN_TIME_DURATION', 'EVN_BEHAVIOR', ),
|
||||
BasePeer::TYPE_PHPNAME => array ('EvnUid', 'PrjUid', 'ProUid', 'EvnName', 'EvnType', 'EvnMarker', 'EvnIsInterrupting', 'EvnAttachedTo', 'EvnCancelActivity', 'EvnActivityRef', 'EvnWaitForCompletion', 'EvnErrorName', 'EvnErrorCode', 'EvnEscalationName', 'EvnEscalationCode', 'EvnCondition', 'EvnMessage', 'EvnOprerationName', 'EvnOperationImplementationRef', 'EvnTimeDate', 'EvnTimeCycle', 'EvnTimeDuration', 'EvnBehavior', ),
|
||||
BasePeer::TYPE_COLNAME => array (BpmnEventPeer::EVN_UID, BpmnEventPeer::PRJ_UID, BpmnEventPeer::PRO_UID, BpmnEventPeer::EVN_NAME, BpmnEventPeer::EVN_TYPE, BpmnEventPeer::EVN_MARKER, BpmnEventPeer::EVN_IS_INTERRUPTING, BpmnEventPeer::EVN_ATTACHED_TO, BpmnEventPeer::EVN_CANCEL_ACTIVITY, BpmnEventPeer::EVN_ACTIVITY_REF, BpmnEventPeer::EVN_WAIT_FOR_COMPLETION, BpmnEventPeer::EVN_ERROR_NAME, BpmnEventPeer::EVN_ERROR_CODE, BpmnEventPeer::EVN_ESCALATION_NAME, BpmnEventPeer::EVN_ESCALATION_CODE, BpmnEventPeer::EVN_CONDITION, BpmnEventPeer::EVN_MESSAGE, BpmnEventPeer::EVN_OPRERATION_NAME, BpmnEventPeer::EVN_OPERATION_IMPLEMENTATION_REF, BpmnEventPeer::EVN_TIME_DATE, BpmnEventPeer::EVN_TIME_CYCLE, BpmnEventPeer::EVN_TIME_DURATION, BpmnEventPeer::EVN_BEHAVIOR, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('EVN_UID', 'PRJ_UID', 'PRO_UID', 'EVN_NAME', 'EVN_TYPE', 'EVN_MARKER', 'EVN_IS_INTERRUPTING', 'EVN_ATTACHED_TO', 'EVN_CANCEL_ACTIVITY', 'EVN_ACTIVITY_REF', 'EVN_WAIT_FOR_COMPLETION', 'EVN_ERROR_NAME', 'EVN_ERROR_CODE', 'EVN_ESCALATION_NAME', 'EVN_ESCALATION_CODE', 'EVN_CONDITION', 'EVN_MESSAGE', 'EVN_OPRERATION_NAME', 'EVN_OPERATION_IMPLEMENTATION_REF', 'EVN_TIME_DATE', 'EVN_TIME_CYCLE', 'EVN_TIME_DURATION', 'EVN_BEHAVIOR', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
|
||||
);
|
||||
|
||||
@@ -124,9 +124,9 @@ abstract class BaseBpmnEventPeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('EvnUid' => 0, 'PrjUid' => 1, 'ProUid' => 2, 'EvnName' => 3, 'EvnType' => 4, 'EvnMarker' => 5, 'EvnIsInterrupting' => 6, 'EvnAttachedTo' => 7, 'EvnCancelActivity' => 8, 'EvnActivity ref' => 9, 'EvnWaitFor completion' => 10, 'EvnErrorName' => 11, 'EvnErrorCode' => 12, 'EvnEscalationName' => 13, 'EvnEscalationCode' => 14, 'EvnCondition' => 15, 'EvnMessage' => 16, 'EvnOprerationName' => 17, 'EvnOperationImplementationRef' => 18, 'EvnTimeDate' => 19, 'EvnTimeCycle' => 20, 'EvnTimeDuration' => 21, 'EvnBehavior' => 22, ),
|
||||
BasePeer::TYPE_COLNAME => array (BpmnEventPeer::EVN_UID => 0, BpmnEventPeer::PRJ_UID => 1, BpmnEventPeer::PRO_UID => 2, BpmnEventPeer::EVN_NAME => 3, BpmnEventPeer::EVN_TYPE => 4, BpmnEventPeer::EVN_MARKER => 5, BpmnEventPeer::EVN_IS_INTERRUPTING => 6, BpmnEventPeer::EVN_ATTACHED_TO => 7, BpmnEventPeer::EVN_CANCEL_ACTIVITY => 8, BpmnEventPeer::EVN_ACTIVITY REF => 9, BpmnEventPeer::EVN_WAIT_FOR COMPLETION => 10, BpmnEventPeer::EVN_ERROR_NAME => 11, BpmnEventPeer::EVN_ERROR_CODE => 12, BpmnEventPeer::EVN_ESCALATION_NAME => 13, BpmnEventPeer::EVN_ESCALATION_CODE => 14, BpmnEventPeer::EVN_CONDITION => 15, BpmnEventPeer::EVN_MESSAGE => 16, BpmnEventPeer::EVN_OPRERATION_NAME => 17, BpmnEventPeer::EVN_OPERATION_IMPLEMENTATION_REF => 18, BpmnEventPeer::EVN_TIME_DATE => 19, BpmnEventPeer::EVN_TIME_CYCLE => 20, BpmnEventPeer::EVN_TIME_DURATION => 21, BpmnEventPeer::EVN_BEHAVIOR => 22, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('EVN_UID' => 0, 'PRJ_UID' => 1, 'PRO_UID' => 2, 'EVN_NAME' => 3, 'EVN_TYPE' => 4, 'EVN_MARKER' => 5, 'EVN_IS_INTERRUPTING' => 6, 'EVN_ATTACHED_TO' => 7, 'EVN_CANCEL_ACTIVITY' => 8, 'EVN_ACTIVITY REF' => 9, 'EVN_WAIT_FOR COMPLETION' => 10, 'EVN_ERROR_NAME' => 11, 'EVN_ERROR_CODE' => 12, 'EVN_ESCALATION_NAME' => 13, 'EVN_ESCALATION_CODE' => 14, 'EVN_CONDITION' => 15, 'EVN_MESSAGE' => 16, 'EVN_OPRERATION_NAME' => 17, 'EVN_OPERATION_IMPLEMENTATION_REF' => 18, 'EVN_TIME_DATE' => 19, 'EVN_TIME_CYCLE' => 20, 'EVN_TIME_DURATION' => 21, 'EVN_BEHAVIOR' => 22, ),
|
||||
BasePeer::TYPE_PHPNAME => array ('EvnUid' => 0, 'PrjUid' => 1, 'ProUid' => 2, 'EvnName' => 3, 'EvnType' => 4, 'EvnMarker' => 5, 'EvnIsInterrupting' => 6, 'EvnAttachedTo' => 7, 'EvnCancelActivity' => 8, 'EvnActivityRef' => 9, 'EvnWaitForCompletion' => 10, 'EvnErrorName' => 11, 'EvnErrorCode' => 12, 'EvnEscalationName' => 13, 'EvnEscalationCode' => 14, 'EvnCondition' => 15, 'EvnMessage' => 16, 'EvnOprerationName' => 17, 'EvnOperationImplementationRef' => 18, 'EvnTimeDate' => 19, 'EvnTimeCycle' => 20, 'EvnTimeDuration' => 21, 'EvnBehavior' => 22, ),
|
||||
BasePeer::TYPE_COLNAME => array (BpmnEventPeer::EVN_UID => 0, BpmnEventPeer::PRJ_UID => 1, BpmnEventPeer::PRO_UID => 2, BpmnEventPeer::EVN_NAME => 3, BpmnEventPeer::EVN_TYPE => 4, BpmnEventPeer::EVN_MARKER => 5, BpmnEventPeer::EVN_IS_INTERRUPTING => 6, BpmnEventPeer::EVN_ATTACHED_TO => 7, BpmnEventPeer::EVN_CANCEL_ACTIVITY => 8, BpmnEventPeer::EVN_ACTIVITY_REF => 9, BpmnEventPeer::EVN_WAIT_FOR_COMPLETION => 10, BpmnEventPeer::EVN_ERROR_NAME => 11, BpmnEventPeer::EVN_ERROR_CODE => 12, BpmnEventPeer::EVN_ESCALATION_NAME => 13, BpmnEventPeer::EVN_ESCALATION_CODE => 14, BpmnEventPeer::EVN_CONDITION => 15, BpmnEventPeer::EVN_MESSAGE => 16, BpmnEventPeer::EVN_OPRERATION_NAME => 17, BpmnEventPeer::EVN_OPERATION_IMPLEMENTATION_REF => 18, BpmnEventPeer::EVN_TIME_DATE => 19, BpmnEventPeer::EVN_TIME_CYCLE => 20, BpmnEventPeer::EVN_TIME_DURATION => 21, BpmnEventPeer::EVN_BEHAVIOR => 22, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('EVN_UID' => 0, 'PRJ_UID' => 1, 'PRO_UID' => 2, 'EVN_NAME' => 3, 'EVN_TYPE' => 4, 'EVN_MARKER' => 5, 'EVN_IS_INTERRUPTING' => 6, 'EVN_ATTACHED_TO' => 7, 'EVN_CANCEL_ACTIVITY' => 8, 'EVN_ACTIVITY_REF' => 9, 'EVN_WAIT_FOR_COMPLETION' => 10, 'EVN_ERROR_NAME' => 11, 'EVN_ERROR_CODE' => 12, 'EVN_ESCALATION_NAME' => 13, 'EVN_ESCALATION_CODE' => 14, 'EVN_CONDITION' => 15, 'EVN_MESSAGE' => 16, 'EVN_OPRERATION_NAME' => 17, 'EVN_OPERATION_IMPLEMENTATION_REF' => 18, 'EVN_TIME_DATE' => 19, 'EVN_TIME_CYCLE' => 20, 'EVN_TIME_DURATION' => 21, 'EVN_BEHAVIOR' => 22, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
|
||||
);
|
||||
|
||||
@@ -246,9 +246,9 @@ abstract class BaseBpmnEventPeer
|
||||
|
||||
$criteria->addSelectColumn(BpmnEventPeer::EVN_CANCEL_ACTIVITY);
|
||||
|
||||
$criteria->addSelectColumn(BpmnEventPeer::EVN_ACTIVITY REF);
|
||||
$criteria->addSelectColumn(BpmnEventPeer::EVN_ACTIVITY_REF);
|
||||
|
||||
$criteria->addSelectColumn(BpmnEventPeer::EVN_WAIT_FOR COMPLETION);
|
||||
$criteria->addSelectColumn(BpmnEventPeer::EVN_WAIT_FOR_COMPLETION);
|
||||
|
||||
$criteria->addSelectColumn(BpmnEventPeer::EVN_ERROR_NAME);
|
||||
|
||||
|
||||
@@ -3260,8 +3260,8 @@
|
||||
<column name="EVN_IS_INTERRUPTING" type="TINYINT" required="false" default="1"/>
|
||||
<column name="EVN_ATTACHED_TO" type="VARCHAR" size="32" required="false" default=""/>
|
||||
<column name="EVN_CANCEL_ACTIVITY" type="TINYINT" required="false" default="0"/>
|
||||
<column name="EVN_ACTIVITY REF" type="VARCHAR" size="32" required="false" default=""/>
|
||||
<column name="EVN_WAIT_FOR COMPLETION" type="TINYINT" required="false" default="1"/>
|
||||
<column name="EVN_ACTIVITY_REF" type="VARCHAR" size="32" required="false" default=""/>
|
||||
<column name="EVN_WAIT_FOR_COMPLETION" type="TINYINT" required="false" default="1"/>
|
||||
<column name="EVN_ERROR_NAME" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="EVN_ERROR_CODE" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="EVN_ESCALATION_NAME" type="VARCHAR" size="255" required="false"/>
|
||||
|
||||
@@ -1788,8 +1788,8 @@ CREATE TABLE `BPMN_EVENT`
|
||||
`EVN_IS_INTERRUPTING` TINYINT default 1,
|
||||
`EVN_ATTACHED_TO` VARCHAR(32) default '',
|
||||
`EVN_CANCEL_ACTIVITY` TINYINT default 0,
|
||||
`EVN_ACTIVITY REF` VARCHAR(32) default '',
|
||||
`EVN_WAIT_FOR COMPLETION` TINYINT default 1,
|
||||
`EVN_ACTIVITY_REF` VARCHAR(32) default '',
|
||||
`EVN_WAIT_FOR_COMPLETION` TINYINT default 1,
|
||||
`EVN_ERROR_NAME` VARCHAR(255),
|
||||
`EVN_ERROR_CODE` VARCHAR(255),
|
||||
`EVN_ESCALATION_NAME` VARCHAR(255),
|
||||
|
||||
379
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Model.php
Normal file
379
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Model.php
Normal file
@@ -0,0 +1,379 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Adapter\Bpmn;
|
||||
|
||||
use \BpmnProject as Project;
|
||||
use \BpmnProcess as Process;
|
||||
use \BpmnDiagram as Diagram;
|
||||
use \BpmnLaneset as Laneset;
|
||||
use \BpmnLane as Lane;
|
||||
use \BpmnActivity as Activity;
|
||||
use \BpmnBound as Bound;
|
||||
use \BpmnEvent as Event;
|
||||
use \BpmnGateway as Gateway;
|
||||
use \BpmnFlow as Flow;
|
||||
use \BpmnArtifact as Artifact;
|
||||
|
||||
use \BpmnProjectPeer as ProjectPeer;
|
||||
use \BpmnProcessPeer as ProcessPeer;
|
||||
use \BpmnDiagramPeer as DiagramPeer;
|
||||
use \BpmnLanesetPeer as LanesetPeer;
|
||||
use \BpmnLanePeer as LanePeer;
|
||||
use \BpmnActivityPeer as ActivityPeer;
|
||||
use \BpmnBoundPeer as BoundPeer;
|
||||
use \BpmnEventPeer as EventPeer;
|
||||
use \BpmnGatewayPeer as GatewayPeer;
|
||||
use \BpmnFlowPeer as FlowPeer;
|
||||
use \BpmnArtifactPeer as ArtifactPeer;
|
||||
|
||||
use \ProcessMaker\Util\Hash;
|
||||
use \BasePeer;
|
||||
|
||||
/**
|
||||
* Class Model
|
||||
*
|
||||
* @package ProcessMaker\Adapter\Bpmn
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class Model
|
||||
{
|
||||
public function createProject($data)
|
||||
{
|
||||
$data = array_change_key_case($data, CASE_UPPER);
|
||||
$uids = array();
|
||||
$oldPrjUid = $data['PRJ_UID'];
|
||||
$diagrams = $data['DIAGRAMS'];
|
||||
|
||||
unset($data['PRJ_UID']);
|
||||
|
||||
/*
|
||||
* 1. Create a project record
|
||||
* 2. Create a default diagram record
|
||||
* 3. Create a default process record
|
||||
*/
|
||||
|
||||
$project = new Project();
|
||||
$project->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
$project->setPrjUid(Hash::generateUID());
|
||||
$project->setPrjCreateDate(date("Y-m-d H:i:s"));
|
||||
$project->save();
|
||||
$prjUid = $project->getPrjUid();
|
||||
$prjName = $project->getPrjName();
|
||||
$uids[] = array('old_uid' => $oldPrjUid, 'new_uid' => $prjUid, 'object' => 'project');
|
||||
|
||||
// By now, is thought create only one diagram for each project (1:1)
|
||||
$diagramData = (array) $diagrams[0];
|
||||
$oldDiaUid = $diagramData['dia_uid'];
|
||||
|
||||
$diagram = new Diagram();
|
||||
$diagram->setDiaUid(Hash::generateUID());
|
||||
$diagram->setPrjUid($prjUid);
|
||||
$diagram->setDiaName($prjName);
|
||||
$diagram->save();
|
||||
$diaUid = $diagram->getDiaUid();
|
||||
$uids[] = array('old_uid' => $oldDiaUid, 'new_uid' => $diaUid, 'object' => 'diagram');
|
||||
|
||||
$process = new Process();
|
||||
$process->setProUid(Hash::generateUID());
|
||||
$process->setPrjUid($prjUid);
|
||||
$process->setDiaUid($diaUid);
|
||||
$process->setProName($prjName);
|
||||
$process->save();
|
||||
$proUid = $process->getProUid();
|
||||
|
||||
$uids = array_merge($uids, $this->createDiagram($prjUid, $proUid, $diaUid, $diagramData));
|
||||
|
||||
return $uids;
|
||||
}
|
||||
|
||||
private function createDiagram($prjUid, $proUid, $diaUid, $diagramData)
|
||||
{
|
||||
$uids = array();
|
||||
|
||||
/*
|
||||
* 1. ensure that all related data of objects are defined, if not we define them as empty
|
||||
* 2. create all related objects
|
||||
*/
|
||||
|
||||
$lanesets = array_key_exists('laneset', $diagramData) ? $diagramData['laneset'] : array();
|
||||
$lanes = array_key_exists('lane', $diagramData) ? $diagramData['lanes'] : array();
|
||||
$activities = array_key_exists('activities', $diagramData) ? $diagramData['activities'] : array();
|
||||
$events = array_key_exists('events', $diagramData) ? $diagramData['events'] : array();
|
||||
$gateways = array_key_exists('gateways', $diagramData) ? $diagramData['gateways'] : array();
|
||||
$flows = array_key_exists('flows', $diagramData) ? $diagramData['flows'] : array();
|
||||
$artifacts = array_key_exists('artifacts', $diagramData) ? $diagramData['artifacts'] : array();
|
||||
|
||||
foreach($lanesets as $lanesetData) {
|
||||
$lanesetData = array_change_key_case((array) $lanesetData, CASE_UPPER);
|
||||
|
||||
$laneset = new Laneset();
|
||||
$laneset->fromArray($lanesetData, BasePeer::TYPE_FIELDNAME);
|
||||
$laneset->setLnsUid(Hash::generateUID());
|
||||
$laneset->setPrjUid($prjUid);
|
||||
$laneset->setProUid($proUid);
|
||||
$laneset->save();
|
||||
$lnsUid = $laneset->getLnsUid();
|
||||
$oldLnsUid = $lanesetData['LNS_UID'];
|
||||
|
||||
$uids[] = array('old_uid' => $oldLnsUid, 'new_uid' => $lnsUid, 'object' => 'laneset');
|
||||
}
|
||||
|
||||
foreach($lanes as $laneData) {
|
||||
$laneData = array_change_key_case((array) $laneData, CASE_UPPER);
|
||||
|
||||
$lane = new Lane();
|
||||
$lane->fromArray($laneData, BasePeer::TYPE_FIELDNAME);
|
||||
$lane->setLanUid(Hash::generateUID());
|
||||
$lane->setPrjUid($prjUid);
|
||||
$lane->save();
|
||||
$lanUid = $lane->getLanUid();
|
||||
$oldLanUid = $laneData['LNS_UID'];
|
||||
|
||||
$uids[] = array('old_uid' => $oldLanUid, 'new_uid' => $lanUid, 'object' => 'lane');
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. crate project related object
|
||||
* 2. crate bound record for each object created previously
|
||||
*/
|
||||
|
||||
foreach($activities as $activityData) {
|
||||
$activityData = array_change_key_case((array) $activityData, CASE_UPPER);
|
||||
|
||||
|
||||
$activity = new Activity();
|
||||
$activity->fromArray($activityData, BasePeer::TYPE_FIELDNAME);
|
||||
$activity->setActUid(Hash::generateUID());
|
||||
$activity->setPrjUid($prjUid);
|
||||
$activity->setProUid($proUid);
|
||||
$activity->save();
|
||||
|
||||
$actUid = $activity->getActUid();
|
||||
$oldActUid = $activityData['ACT_UID'];
|
||||
$uids[] = array('old_uid' => $oldActUid, 'new_uid' => $actUid, 'object' => 'activity');
|
||||
|
||||
|
||||
$bound = new Bound();
|
||||
$bound->fromArray($activityData, BasePeer::TYPE_FIELDNAME);
|
||||
$bound->setBouUid(Hash::generateUID());
|
||||
$bound->setPrjUid($prjUid);
|
||||
$bound->setDiaUid($diaUid);
|
||||
$bound->setElementUid($activity->getActUid());
|
||||
$bound->setBouElementType(get_class($activity));
|
||||
$bound->setBouElement('pm_canvas');
|
||||
$bound->setBouContainer('bpmnDiagram');
|
||||
$bound->save();
|
||||
}
|
||||
|
||||
foreach($events as $eventData) {
|
||||
$eventData = array_change_key_case((array) $eventData, CASE_UPPER);
|
||||
|
||||
$event = new Event();
|
||||
$event->fromArray($eventData, BasePeer::TYPE_FIELDNAME);
|
||||
$event->setEvnUid(Hash::generateUID());
|
||||
$event->setPrjUid($prjUid);
|
||||
$event->setProUid($proUid);
|
||||
$event->save();
|
||||
|
||||
$evnUid = $event->getEvnUid();
|
||||
$oldEvnUid = $eventData['EVN_UID'];
|
||||
$uids[] = array('old_uid' => $oldEvnUid, 'new_uid' => $evnUid, 'object' => 'event');
|
||||
|
||||
$bound = new Bound();
|
||||
$bound->fromArray($eventData, BasePeer::TYPE_FIELDNAME);
|
||||
$bound->setBouUid(Hash::generateUID());
|
||||
$bound->setPrjUid($prjUid);
|
||||
$bound->setDiaUid($diaUid);
|
||||
$bound->setElementUid($event->getEvnUid());
|
||||
$bound->setBouElementType(get_class($event));
|
||||
$bound->setBouElement('pm_canvas');
|
||||
$bound->setBouContainer('bpmnDiagram');
|
||||
$bound->save();
|
||||
}
|
||||
|
||||
foreach($gateways as $gatewayData) {
|
||||
$gatewayData = array_change_key_case((array) $gatewayData, CASE_UPPER);
|
||||
|
||||
$gateway = new Gateway();
|
||||
$gateway->fromArray($gatewayData, BasePeer::TYPE_FIELDNAME);
|
||||
$gateway->setGatUid(Hash::generateUID());
|
||||
$gateway->setPrjUid($prjUid);
|
||||
$gateway->setProUid($proUid);
|
||||
$gateway->save();
|
||||
|
||||
$gatUid = $gateway->getGatUid();
|
||||
$oldGatUid = $gatewayData['GAT_UID'];
|
||||
$uids[] = array('old_uid' => $oldGatUid, 'new_uid' => $gatUid, 'object' => 'gateway');
|
||||
|
||||
$bound = new Bound();
|
||||
$bound->fromArray($gatewayData, BasePeer::TYPE_FIELDNAME);
|
||||
$bound->setBouUid(Hash::generateUID());
|
||||
$bound->setPrjUid($prjUid);
|
||||
$bound->setDiaUid($diaUid);
|
||||
$bound->setElementUid($gateway->getGatUid());
|
||||
$bound->setBouElementType(get_class($gateway));
|
||||
$bound->setBouElement('pm_canvas');
|
||||
$bound->setBouContainer('bpmnDiagram');
|
||||
$bound->save();
|
||||
}
|
||||
|
||||
foreach($flows as $flowData) {
|
||||
$flowData = array_change_key_case((array) $flowData, CASE_UPPER);
|
||||
|
||||
$floState = json_encode($flowData['FLO_STATE']);
|
||||
unset($flowData['FLO_STATE']);
|
||||
|
||||
$flow = new Flow();
|
||||
$flow->fromArray($flowData, BasePeer::TYPE_FIELDNAME);
|
||||
$flow->setFloUid(Hash::generateUID());
|
||||
$flow->setPrjUid($prjUid);
|
||||
$flow->setDiaUid($diaUid);
|
||||
$flow->setFloState($floState);
|
||||
$flow->save();
|
||||
|
||||
$floUid = $flow->getFloUid();
|
||||
$oldFloUid = $flowData['FLO_UID'];
|
||||
$uids[] = array('old_uid' => $oldFloUid, 'new_uid' => $floUid, 'object' => 'flow');
|
||||
}
|
||||
|
||||
foreach($artifacts as $artifactData) {
|
||||
$artifactData = array_change_key_case((array) $artifactData, CASE_UPPER);
|
||||
|
||||
$artifact = new Artifact();
|
||||
$artifact->fromArray($artifactData, BasePeer::TYPE_FIELDNAME);
|
||||
$artifact->setArtUid(Hash::generateUID());
|
||||
$artifact->setPrjUid($prjUid);
|
||||
$artifact->setProUid($proUid);
|
||||
$artifact->save();
|
||||
|
||||
$artUid = $artifact->getFloUid();
|
||||
$oldArtUid = $artifactData['ART_UID'];
|
||||
$uids[] = array('old_uid' => $oldArtUid, 'new_uid' => $artUid, 'object' => 'artifact');
|
||||
}
|
||||
|
||||
return $uids;
|
||||
}
|
||||
|
||||
public function loadProject($prjUid)
|
||||
{
|
||||
/*
|
||||
* 1. load object of project
|
||||
* 2. load object of process
|
||||
* 3. load object of diagram
|
||||
* 4. load collection of lanesets
|
||||
* 5. load collection of lanes
|
||||
* 6. load collection of activities
|
||||
* 7. load collection of events
|
||||
* 8. load collection of gateways
|
||||
* 9. load collection of flows
|
||||
* 10. load collection of artifacts
|
||||
* 11. compose project data structure
|
||||
*/
|
||||
|
||||
$project = self::getBpmnObjectBy('Project', ProjectPeer::PRJ_UID, $prjUid, true);
|
||||
$process = self::getBpmnObjectBy('Process', ProcessPeer::PRJ_UID, $prjUid, true);
|
||||
$diagram = self::getBpmnObjectBy('Diagram', DiagramPeer::DIA_UID, $process['dia_uid'], true);
|
||||
$lanesets = self::getBpmnCollectionBy('Laneset', LanesetPeer::PRJ_UID, $prjUid, true);
|
||||
$lanes = self::getBpmnCollectionBy('Lane', LanePeer::PRJ_UID, $prjUid, true);
|
||||
$activities = self::getBpmnCollectionBy('Activity', ActivityPeer::PRJ_UID, $prjUid, true);
|
||||
$events = self::getBpmnCollectionBy('Event', EventPeer::PRJ_UID, $prjUid, true);
|
||||
$gateways = self::getBpmnCollectionBy('Gateway', GatewayPeer::PRJ_UID, $prjUid, true);
|
||||
$flows = self::getBpmnCollectionBy('Flow', FlowPeer::PRJ_UID, $prjUid, true);
|
||||
$artifacts = self::getBpmnCollectionBy('Artifact', ArtifactPeer::PRJ_UID, $prjUid, true);
|
||||
|
||||
// getting activity bound data
|
||||
foreach ($activities as $i => $activity) {
|
||||
$activities[$i] = array_merge(
|
||||
$activities[$i],
|
||||
self::getBpmnObjectBy('Bound', BoundPeer::ELEMENT_UID, $activity['act_uid'], true)
|
||||
);
|
||||
}
|
||||
|
||||
// getting event bound data
|
||||
foreach ($events as $i => $event) {
|
||||
$events[$i] = array_merge(
|
||||
$events[$i],
|
||||
self::getBpmnObjectBy('Bound', BoundPeer::ELEMENT_UID, $event['evn_uid'], true)
|
||||
);
|
||||
}
|
||||
|
||||
// getting gateway bound data
|
||||
foreach ($gateways as $i => $gateway) {
|
||||
$gateways[$i] = array_merge(
|
||||
$gateways[$i],
|
||||
self::getBpmnObjectBy('Bound', BoundPeer::ELEMENT_UID, $gateway['gat_uid'], true)
|
||||
);
|
||||
}
|
||||
|
||||
$project = array_change_key_case($project);
|
||||
$project['diagrams'] = array($diagram);
|
||||
$project['diagrams'][0]['lanesets'] = $lanesets;
|
||||
$project['diagrams'][0]['lanes'] = $lanes;
|
||||
$project['diagrams'][0]['activities'] = $activities;
|
||||
$project['diagrams'][0]['events'] = $events;
|
||||
$project['diagrams'][0]['gateways'] = $gateways;
|
||||
$project['diagrams'][0]['flows'] = $flows;
|
||||
$project['diagrams'][0]['artifacts'] = $artifacts;
|
||||
|
||||
return $project;
|
||||
}
|
||||
|
||||
public static function loadProjects()
|
||||
{
|
||||
$projectsList = self::getAllBpmnCollectionFrom('Project', true);
|
||||
$projects = array();
|
||||
|
||||
foreach ($projectsList as $project) {
|
||||
$projects[] = self::loadProject($project['prj_uid']);
|
||||
}
|
||||
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/*** Private Functions ***/
|
||||
|
||||
private static function getAllBpmnCollectionFrom($class, $changeCase = false)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
$c = new \Criteria('workflow');
|
||||
//$c->add($field, $value);
|
||||
|
||||
$classPeer = 'Bpmn' . $class . 'Peer';
|
||||
$rs = $classPeer::doSelectRS($c);
|
||||
|
||||
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rs->next()) {
|
||||
$data[] = $changeCase ? array_change_key_case($rs->getRow(), CASE_LOWER) : $rs->getRow();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private static function getBpmnCollectionBy($class, $field, $value, $changeCase = false)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
$c = new \Criteria('workflow');
|
||||
$c->add($field, $value);
|
||||
|
||||
$classPeer = 'Bpmn' . $class . 'Peer';
|
||||
$rs = $classPeer::doSelectRS($c);
|
||||
|
||||
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rs->next()) {
|
||||
$data[] = $changeCase ? array_change_key_case($rs->getRow(), CASE_LOWER) : $rs->getRow();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private static function getBpmnObjectBy($class, $field, $value, $changeCase = false)
|
||||
{
|
||||
$record = self::getBpmnCollectionBy($class, $field, $value, $changeCase);
|
||||
|
||||
return empty($record) ? null : $record[0];
|
||||
}
|
||||
}
|
||||
|
||||
48
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Port.php
Normal file
48
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Port.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Adapter\Bpmn;
|
||||
|
||||
use \Process;
|
||||
|
||||
/**
|
||||
* Class Port
|
||||
*
|
||||
* @package ProcessMaker\Adapter\Bpmn
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class Port
|
||||
{
|
||||
public function convertBpmnProjectToPmWorkflow($bpmnProject)
|
||||
{
|
||||
$proUid = $bpmnProject['prj_uid'];
|
||||
|
||||
$process = array();
|
||||
$process['PRO_UID'] = $proUid;
|
||||
$process['PRO_TITLE'] = $bpmnProject['prj_name'];
|
||||
$process['PRO_DESCRIPTION'] = '';
|
||||
$process['PRO_CATEGORY'] = '';
|
||||
$process['PRO_UID'] = $proUid;
|
||||
$process['PRO_UID'] = $proUid;
|
||||
$process['tasks'] = array();
|
||||
|
||||
$diagram = $bpmnProject['prj_name']['diagrams'][0];
|
||||
|
||||
foreach ($diagram['activities'] as $activity) {
|
||||
$process['tasks'][] = array(
|
||||
'TAS_UID' => $activity['act_uid'],
|
||||
'TAS_TITLE' => $activity['act_name'],
|
||||
'TAS_DESCRIPTION' => $activity['act_name'],
|
||||
'TAS_POSX' => $activity['bou_x'],
|
||||
'TAS_POSY' => $activity['bou_y'],
|
||||
'TAS_START' => ''
|
||||
);
|
||||
}
|
||||
|
||||
$process['routes'][] = array(
|
||||
'ROU_UID' => '',
|
||||
'TAS_UID' => '',
|
||||
'ROU_NEXT_TASK' => '',
|
||||
'ROU_TYPE' => ''
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services;
|
||||
|
||||
class Api
|
||||
/**
|
||||
* Abstract Class Api
|
||||
*
|
||||
* Api class be be extended by Restler Classes
|
||||
*
|
||||
* @package ProcessMaker\Services
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
abstract class Api
|
||||
{
|
||||
private static $workspace;
|
||||
private static $userId;
|
||||
|
||||
68
workflow/engine/src/ProcessMaker/Util/Hash.php
Normal file
68
workflow/engine/src/ProcessMaker/Util/Hash.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Util;
|
||||
|
||||
class Hash
|
||||
{
|
||||
/**
|
||||
* Generate random number
|
||||
*
|
||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public static function generateUID()
|
||||
{
|
||||
do {
|
||||
$sUID = str_replace('.', '0', uniqid(rand(0, 999999999), true));
|
||||
} while (strlen( $sUID ) != 32);
|
||||
|
||||
return $sUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a numeric or alphanumeric code
|
||||
*
|
||||
* @author Julio Cesar Laura Avendaño <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param int $iDigits
|
||||
* @param string $sType
|
||||
* @return string
|
||||
*/
|
||||
public function generateCode($iDigits = 4, $sType = 'NUMERIC')
|
||||
{
|
||||
if (($iDigits < 4) || ($iDigits > 50)) {
|
||||
$iDigits = 4;
|
||||
}
|
||||
if (($sType != 'NUMERIC') && ($sType != 'ALPHA') && ($sType != 'ALPHANUMERIC')) {
|
||||
$sType = 'NUMERIC';
|
||||
}
|
||||
|
||||
$aValidCharacters = array(
|
||||
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H',
|
||||
'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
|
||||
);
|
||||
|
||||
switch ($sType) {
|
||||
case 'NUMERIC':
|
||||
$iMin = 0;
|
||||
$iMax = 9;
|
||||
break;
|
||||
case 'ALPHA':
|
||||
$iMin = 10;
|
||||
$iMax = 35;
|
||||
break;
|
||||
case 'ALPHANUMERIC':
|
||||
$iMin = 0;
|
||||
$iMax = 35;
|
||||
break;
|
||||
}
|
||||
|
||||
$sCode = '';
|
||||
for ($i = 0; $i < $iDigits; $i ++) {
|
||||
$sCode .= $aValidCharacters[rand($iMin, $iMax)];
|
||||
}
|
||||
|
||||
return $sCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Util;
|
||||
|
||||
/**
|
||||
* Singleton Class Logger
|
||||
*
|
||||
* This Utility is usefull to log local messages
|
||||
* @package ProcessMaker\Util
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class Logger
|
||||
{
|
||||
private static $instance;
|
||||
|
||||
52
workflow/engine/src/Services/Api/ProcessMaker/Project.php
Normal file
52
workflow/engine/src/Services/Api/ProcessMaker/Project.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker;
|
||||
|
||||
use Luracast\Restler\RestException;
|
||||
use ProcessMaker\Services\Api;
|
||||
use ProcessMaker\Adapter\Bpmn\Model as BpmnModel;
|
||||
|
||||
/**
|
||||
* Class Project
|
||||
*
|
||||
* @package Services\Api\ProcessMaker
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Project extends Api
|
||||
{
|
||||
function index()
|
||||
{
|
||||
//return \BusinessModel\Process::loadProcess('647625648528d91278a87f5076732980');
|
||||
|
||||
try {
|
||||
$projects = BpmnModel::loadProjects();
|
||||
|
||||
return $projects;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function post($request_data)
|
||||
{
|
||||
try {
|
||||
$bpmnModel = new BpmnModel();
|
||||
|
||||
return $bpmnModel->createProject($request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function get($prjUid)
|
||||
{
|
||||
try {
|
||||
$project = BpmnModel::loadProject($prjUid);
|
||||
|
||||
return $project;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user