PM-00000 "Fix in class Bpmn.php and cases_Step.php" SOLVED

Issue:
    - Problems in method Bpmn::getElementsBetweenElementOriginAndElementDest
    - Problems in cases_Step.php with OutputDocuments
Cause:
    - No control of repetitive loop in method Bpmn::getElementsBetweenElementOriginAndElementDest
    - No defined variables DEL_INDEX and TAS_UID
Solution:
    - Added validation for the control of repetitive loop in method Bpmn::getElementsBetweenElementOriginAndElementDest
    - Defined variables DEL_INDEX and TAS_UID
This commit is contained in:
Victor Saisa Lopez
2015-05-08 12:31:18 -04:00
parent 26b60adcd4
commit a618307029
2 changed files with 18 additions and 9 deletions

View File

@@ -160,16 +160,15 @@ if ($flagExecuteBeforeTriggers) {
if (! isset( $_SESSION['_NO_EXECUTE_TRIGGERS_'] )) {
//Execute before triggers - Start
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], $_GET['TYPE'], $_GET['UID'], 'BEFORE', $Fields['APP_DATA'] );
$Fields['DEL_INDEX'] = $_SESSION['INDEX'];
$Fields['TAS_UID'] = $_SESSION['TASK'];
//Execute before triggers - End
} else {
unset( $_SESSION['_NO_EXECUTE_TRIGGERS_'] );
$Fields['DEL_INDEX'] = $_SESSION['INDEX'];
$Fields['TAS_UID'] = $_SESSION['TASK'];
}
}
$Fields["DEL_INDEX"] = $_SESSION["INDEX"];
$Fields["TAS_UID"] = $_SESSION["TASK"];
if (isset( $_GET['breakpoint'] )) {
$_POST['NextStep'] = $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'];
}
@@ -518,7 +517,7 @@ try {
$util = new Java( "com.processmaker.util.pmutils" );
$util->setInputPath( $javaInput );
$util->setOutputPath( $javaOutput );
G::LoadSystem('inputfilter');
$filter = new InputFilter();
@@ -553,17 +552,17 @@ try {
$util = new Java( "com.processmaker.util.pmutils" );
$util->setInputPath( $javaInput );
$util->setOutputPath( $javaOutput );
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$locationFrom = PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.pdf';
$locationFrom = $filter->validateInput($locationFrom, "path");
copy( $locationFrom, $javaInput . $aOD['OUT_DOC_UID'] . '.pdf' );
$outputFile = $javaOutput . $sFilename . '.pdf';
print $util->writeVarsToAcroFields( $aOD['OUT_DOC_UID'] . '.pdf', $xmlData );
$locationFrom = $javaOutput . $aOD['OUT_DOC_UID'] . '.pdf';
$locationFrom = $filter->validateInput($locationFrom, "path");
copy( $locationFrom, $pathOutput . $sFilename . '.pdf' );

View File

@@ -83,6 +83,7 @@ class Bpmn extends Handler
"lane" => array("BOU_ELEMENT_TYPE", "BOU_SIZE_IDENTICAL", "BOU_UID")
);
private $arrayElementOriginChecked = array();
public function __construct($data = null)
{
@@ -1378,6 +1379,13 @@ class Bpmn extends Handler
$index
) {
try {
if (isset($this->arrayElementOriginChecked[$elementOriginUid]) && $this->arrayElementOriginChecked[$elementOriginUid] == $elementOriginType) {
//Return
return array();
}
$this->arrayElementOriginChecked[$elementOriginUid] = $elementOriginType;
if ($elementOriginType == $elementDestType && $elementOriginUid == $elementDestUid) {
$arrayEvent = array();
$arrayEvent[$index] = array($elementDestUid, $elementDestType);
@@ -1403,7 +1411,7 @@ class Bpmn extends Handler
$index + 1
);
if (count($arrayEvent) > 0) {
if (!empty($arrayEvent)) {
$arrayEvent[$index] = array($elementOriginUid, $elementOriginType);
//Return
@@ -1431,6 +1439,8 @@ class Bpmn extends Handler
$arrayEventType = array("END", "INTERMEDIATE");
$arrayEventMarker = array("MESSAGETHROW");
$this->arrayElementOriginChecked = array();
$arrayEventAux = $this->getElementsBetweenElementOriginAndElementDest(
$elementOriginUid,
$elementOriginType,