Files
crm.clientright.ru/modules/Workflow2/lib/Workflow/BPMN/Element.php
Fedor ac7467f0b4 Major CRM updates: AI Assistant, Court Status API, S3 integration improvements, and extensive file storage system
- Added comprehensive AI Assistant system (aiassist/ directory):
  * Vector search and embedding capabilities
  * Typebot proxy integration
  * Elastic search functionality
  * Message classification and chat history
  * MCP proxy for external integrations

- Implemented Court Status API (GetCourtStatus.php):
  * Real-time court document status checking
  * Integration with external court systems
  * Comprehensive error handling and logging

- Enhanced S3 integration:
  * Improved file backup system with metadata
  * Batch processing capabilities
  * Enhanced error logging and recovery
  * Copy operations with URL fixing

- Added Telegram contact creation API
- Improved error logging across all modules
- Enhanced callback system for AI responses
- Extensive backup file storage with timestamps
- Updated documentation and README files

- File storage improvements:
  * Thousands of backup files with proper metadata
  * Fix operations for broken file references
  * Project-specific backup and recovery systems
  * Comprehensive file integrity checking

Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
2025-10-16 11:17:21 +03:00

130 lines
2.9 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: StefanWarnat
* Date: 26.03.2019
* Time: 17:54
*/
namespace Workflow\BPMN;
class Element
{
const TYPE_STARTEVENT = 'startEvent';
const TYPE_TASK = 'task';
const TYPE_EXCLUSIVEGATEWAY = 'exclusiveGateway';
private $id = null;
private $name = null;
private $type = null;
/**
* @var Element[]
*/
private $outgoing = array();
/**
* @var Element[]
*/
private $incoming = array();
private $sizes = array(
self::TYPE_EXCLUSIVEGATEWAY => array(50, 50),
self::TYPE_STARTEVENT => array(36, 36),
self::TYPE_TASK => array(100, 80),
);
/**
* @var Element
*/
private $parent = null;
private $maxChildCount = 1;
public function __construct($id, $name, $type)
{
$this->id = $id;
$this->name = $name;
$this->type = $type;
}
public function getChildCount() {
$all = Flow::getAll();
$currentMax = 1;
if(empty($this->outgoing)) {
return 0;
}
foreach($this->outgoing as $outgoing) {
$tmpChildCount = $outgoing->getChildCount();
if($tmpChildCount > $currentMax) {
$currentMax = $tmpChildCount;
}
}
return $childCount;
}
/*
public function updateChilds() {
if($this->maxChildCount < $childCount) {
$this->maxChildCount = $childCount;
if($this->parent !== null) {
$this->parent->adjustMaxChild($childCount);
}
}
}
*/
public function setParent(Element &$parent) {
$this->parent = &$parent;
}
public function addOutgoing($childObj) {
$this->outgoing[] = $childObj;
}
public function addIncoming($childObj) {
$this->incoming[] = $childObj;
}
public function addChild(Element $child) {
$child->setParent($this);
$child->addIncoming($this);
$this->addOutgoing($child);
}
public function getId() {
return $this->id;
}
public function getName() {
return $this->id;
}
/**
* @param $xml \DOMDocument
*/
public function addXML($xml) {
$process = $xml->getElementsByTagName('bpmn:process')[0];
$block = $xml->createElement('bpmn:'.$this->type);
$block->setAttribute('id', $this->getId());
$block->setAttribute('name',$this->getName());
$process->appendChild($block);
foreach($this->incoming as $incoming) {
$flow = $xml->createElement('bpmn:incoming', Flow::getId($incoming->getId(), $this->id));
$block->appendChild($flow);
}
foreach($this->outgoing as $outgoing) {
$flow = $xml->createElement('bpmn:outgoing', Flow::getId($this->id, $outgoing->getId()));
$block->appendChild($flow);
}
}
}