Changeset 7655 for trunk/workflow/inc/class.workflow_processmanager.inc.php
- Timestamp:
- 12/14/12 14:30:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/class.workflow_processmanager.inc.php
r3167 r7655 390 390 $transitions=Array(); 391 391 $jobs = array(); 392 for($i=0;$i<count($this->tree[1]['children']);$i++) { 392 $tree_count = count($this->tree[1]['children']); 393 for($i=0;$i<$tree_count;++$i) { 393 394 // Process attributes 394 395 $z=$this->tree[1]['children'][$i]; … … 397 398 //config values 398 399 if ($name=='configs') { 399 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 400 $tree_z_count = count($this->tree[$z]['children']); 401 for($j=0;$j<$tree_z_count;++$j) { 400 402 $z2 = $this->tree[$z]['children'][$j]; 401 403 // this is a config $name = $this->tree[$z2]['name']; 402 404 $aux = Array(); 403 405 if($this->tree[$z2]['name']=='config') { 404 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 406 $tree_z_count = count($this->tree[$z2]['children']); 407 for($k=0;$k<$tree_z_count;++$k) { 405 408 $z3 = $this->tree[$z2]['children'][$k]; 406 409 $name = trim($this->tree[$z3]['name']); … … 414 417 //activities 415 418 elseif($name=='activities') { 416 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 419 $tree_z_count = count($this->tree[$z]['children']); 420 for($j=0;$j<$tree_z_count;++$j) { 417 421 $z2 = $this->tree[$z]['children'][$j]; 418 422 // this is an activity $name = $this->tree[$z2]['name']; 419 423 $aux = Array(); 420 424 if($this->tree[$z2]['name']=='activity') { 421 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 425 $tree_z2_count = count($this->tree[$z2]['children']); 426 for($k=0;$k<$tree_z2_count;++$k) { 422 427 $z3 = $this->tree[$z2]['children'][$k]; 423 428 $name = trim($this->tree[$z3]['name']); … … 425 430 if($name=='roles') { 426 431 $roles=Array(); 427 for($l=0;$l<count($this->tree[$z3]['children']);$l++) { 432 $tree_z3_count = count($this->tree[$z3]['children']); 433 for($l=0;$l<$tree_z3_count;++$l) { 428 434 $z4 = $this->tree[$z3]['children'][$l]; 429 435 $name = trim($this->tree[$z4]['name']); … … 445 451 { 446 452 $agents=Array(); 447 for($l=0;$l<count($this->tree[$z3]['children']);$l++) 453 $tree_z3_count = count($this->tree[$z3]['children']); 454 for($l=0;$l<$tree_z3_count;++$l) 448 455 { 449 456 $z4 = $this->tree[$z3]['children'][$l]; … … 453 460 { 454 461 $agent = array(); 455 for($m=0;$m<count($this->tree[$z4]['children']);$m++) 462 $tree_z4_count = count($this->tree[$z4]['children']); 463 for($m=0;$m<$tree_z4_count;++$m) 456 464 { 457 465 $z5 = $this->tree[$z4]['children'][$m]; … … 466 474 elseif ($name=='agent_datas') 467 475 { 468 for($n=0;$n<count($this->tree[$z5]['children']);$n++) 476 $tree_z5_count = count($this->tree[$z5]['children']); 477 for($n=0;$n<$tree_z5_count;++$n) 469 478 { 470 479 $z6 = $this->tree[$z5]['children'][$n]; … … 474 483 if ($name=='agent_data') 475 484 { 476 for($o=0;$o<count($this->tree[$z6]['children']);$o++) 485 $tree_z6_count = count($this->tree[$z6]['children']); 486 for($o=0;$o<$tree_z6_count;++$o) 477 487 { 478 488 $z7 = $this->tree[$z6]['children'][$o]; … … 510 520 } 511 521 } elseif($name=='transitions') { 512 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 522 $tree_z_count = count($this->tree[$z]['children']); 523 for($j=0;$j<$tree_z_count;++$j) { 513 524 $z2 = $this->tree[$z]['children'][$j]; 514 525 // this is an activity $name = $this->tree[$z2]['name']; 515 526 $aux=Array(); 516 527 if($this->tree[$z2]['name']=='transition') { 517 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 528 $tree_z2_count = count($this->tree[$z2]['children']); 529 for($k=0;$k<$tree_z2_count;++$k) { 518 530 $z3 = $this->tree[$z2]['children'][$k]; 519 531 $name = trim($this->tree[$z3]['name']); … … 527 539 } 528 540 } elseif($name=='includes') { 529 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 541 $tree_z_count = count($this->tree[$z]['children']); 542 for($j=0;$j<$tree_z_count;++$j) { 530 543 $z2 = $this->tree[$z]['children'][$j]; 531 544 // this is an activity $name = $this->tree[$z2]['name']; 532 545 $aux=Array(); 533 546 if($this->tree[$z2]['name']=='include') { 534 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 547 $tree_z2_count = count($this->tree[$z2]['children']); 548 for($k=0;$k<$tree_z2_count;++$k) { 535 549 $z3 = $this->tree[$z2]['children'][$k]; 536 550 $name = trim($this->tree[$z3]['name']); … … 542 556 } 543 557 } elseif($name=='templates') { 544 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 558 $tree_z_count = count($this->tree[$z]['children']); 559 for($j=0;$j<$tree_z_count;++$j) { 545 560 $z2 = $this->tree[$z]['children'][$j]; 546 561 // this is an activity $name = $this->tree[$z2]['name']; 547 562 $aux=Array(); 548 563 if($this->tree[$z2]['name']=='template') { 549 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 564 $tree_z2_count = count($this->tree[$z2]['children']); 565 for($k=0;$k<$tree_z2_count;++$k) { 550 566 $z3 = $this->tree[$z2]['children'][$k]; 551 567 $name = trim($this->tree[$z3]['name']); … … 557 573 } 558 574 } elseif($name=='resources') { 559 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 575 $tree_z_count = count($this->tree[$z]['children']); 576 for($j=0;$j<$tree_z_count;++$j) { 560 577 $z2 = $this->tree[$z]['children'][$j]; 561 578 // this is an activity $name = $this->tree[$z2]['name']; 562 579 $aux=Array(); 563 580 if($this->tree[$z2]['name']=='resource') { 564 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 581 $tree_z2_count = count($this->tree[$z2]['children']); 582 for($k=0;$k<$tree_z2_count;++$k) { 565 583 $z3 = $this->tree[$z2]['children'][$k]; 566 584 $name = trim($this->tree[$z3]['name']); … … 572 590 } 573 591 } 574 elseif ($name == 'jobs') 575 { 576 for ($j = 0; $j < count($this->tree[$z]['children']); $j++) 577 { 578 $job = array(); 579 $jobIndex = $this->tree[$z]['children'][$j]; 580 if($this->tree[$jobIndex]['name'] == 'job') 581 { 582 for ($k = 0; $k < count($this->tree[$jobIndex]['children']); $k++) 583 { 584 $propertyIndex = $this->tree[$jobIndex]['children'][$k]; 585 $job[trim($this->tree[$propertyIndex]['name'])] = trim($this->tree[$propertyIndex]['data']); 586 } 587 } 588 $jobs[] = $job; 589 } 592 elseif ($name == 'jobs'){ 593 $tree_z_count = count($this->tree[$z]['children']); 594 for ($j = 0; $j < $tree_z_count; ++$j) 595 { 596 $job = array(); 597 $jobIndex = $this->tree[$z]['children'][$j]; 598 if($this->tree[$jobIndex]['name'] == 'job') 599 { 600 $tree_jobIndex_count = count($this->tree[$jobIndex]['children']); 601 for ($k = 0; $k < $tree_jobIndex_count; ++$k) 602 { 603 $propertyIndex = $this->tree[$jobIndex]['children'][$k]; 604 $job[trim($this->tree[$propertyIndex]['name'])] = trim($this->tree[$propertyIndex]['data']); 605 } 606 } 607 $jobs[] = $job; 608 } 590 609 } 591 610 else {
Note: See TracChangeset
for help on using the changeset viewer.