Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a47b38b
test: Pass of data from sub-process to parent process using Message E…
caleeli Sep 30, 2025
5bb5d60
feat: Add support for Data Input Associations and Assignment properties
caleeli Sep 30, 2025
32d1763
feat: Introduce new properties and methods for BPMN interfaces
caleeli Sep 30, 2025
ddfc7fe
feat: Add methods to create DataInputAssociation and Assignment in Re…
caleeli Sep 30, 2025
37c6a8c
feat: Implement Assignment and DataInputAssociation classes with upda…
caleeli Sep 30, 2025
e375107
fix: Refactor EndEvent class to initialize properties and update data…
caleeli Sep 30, 2025
7ea8518
chore: Update SonarQube workflow to check coverage using a dedicated …
caleeli Sep 30, 2025
e9c5b8a
Remove non required code
caleeli Oct 1, 2025
0b75eb8
fix: Update return type annotations in Assignment class methods to in…
caleeli Oct 1, 2025
1d13a52
feat: Implement getSources and getTransformation methods in DataInput…
caleeli Oct 1, 2025
15dc3bc
refactor: Remove unused dataInputs variable
caleeli Oct 1, 2025
6fa2d4a
feat: Enhance MessageEventToParent BPMN to test all inputs and associ…
caleeli Oct 1, 2025
48b5720
feat: Add tests for setDotData and getDotData methods in DataStore class
caleeli Oct 1, 2025
4fa04f9
feat: Introduce getDotData method for dot notation access
caleeli Oct 1, 2025
e031a12
feat: Implements DataInputAssociation Transformation and sourceRef
caleeli Oct 1, 2025
4c3b90a
fix: Add __invoke to Interface to handle cursor bot observation
caleeli Oct 1, 2025
12fb638
fix: Ensure callable checks for transformation and assignments in Mes…
caleeli Oct 1, 2025
c9b4223
refactor: Refactor evaluateMessagePayload to reduce its Cognitive Com…
caleeli Oct 1, 2025
1c68adc
fix: Handle missing data store in MessageEventDefinition by providing…
caleeli Oct 1, 2025
282cab0
fix: Ensure non-empty target in callable checks for assignments in Me…
caleeli Oct 1, 2025
f021157
Merge pull request #232 from ProcessMaker/FOUR-26839
caleeli Oct 2, 2025
3d622df
test: MessageEvent to Parent Catch Mapping with multiple data inputs
caleeli Oct 2, 2025
e6afbd2
feat: Add DataOutputAssociation handling and extend CatchEventTrait w…
caleeli Oct 2, 2025
fcdba7d
refactor: Remove unused code
caleeli Oct 2, 2025
4d966f3
fix: Improve variable names
caleeli Oct 2, 2025
7b77af6
fix: Do not throw exception if node exists but not yet implemented
caleeli Oct 2, 2025
37d3273
fix: Update condition to check for empty element in BpmnDocument
caleeli Oct 3, 2025
a9d98e0
Merge pull request #233 from ProcessMaker/FOUR-26911
caleeli Oct 3, 2025
62e6510
fix: Allow missing target or source references for backward compatibi…
caleeli Oct 3, 2025
66b1106
Merge pull request #235 from ProcessMaker/feature/FOUR-26791_compatib…
caleeli Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
- name: Run PHPUnit tests
run: ./vendor/bin/phpunit -d memory_limit=-1

- name: List coverage files
run: ls -l coverage
- name: Check coverage
run: ./check_coverage.php

- uses: sonarsource/sonarqube-scan-action@master
env:
Expand Down
34 changes: 34 additions & 0 deletions src/ProcessMaker/Nayra/Bpmn/Assignment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace ProcessMaker\Nayra\Bpmn;

use ProcessMaker\Nayra\Contracts\Bpmn\AssignmentInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface;

/**
* Assignment class that implements AssignmentInterface
*/
class Assignment implements AssignmentInterface
{
use BaseTrait;

/**
* Get the 'from' formal expression.
*
* @return FormalExpressionInterface|callable
*/
public function getFrom()
{
return $this->getProperty(self::BPMN_PROPERTY_FROM);
}

/**
* Get the 'to' formal expression.
*
* @return FormalExpressionInterface|callable
*/
public function getTo()
{
return $this->getProperty(self::BPMN_PROPERTY_TO);
}
}
6 changes: 6 additions & 0 deletions src/ProcessMaker/Nayra/Bpmn/CatchEventTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected function initCatchEventTrait()
{
$this->setProperty(CatchEventInterface::BPMN_PROPERTY_EVENT_DEFINITIONS, new Collection);
$this->setProperty(CatchEventInterface::BPMN_PROPERTY_PARALLEL_MULTIPLE, false);
$this->setProperty(CatchEventInterface::BPMN_PROPERTY_DATA_OUTPUT_ASSOCIATION, new Collection);
}

/**
Expand All @@ -42,6 +43,11 @@ public function getEventDefinitions()
return $this->getProperty(CatchEventInterface::BPMN_PROPERTY_EVENT_DEFINITIONS);
}

public function getDataOutputAssociations()
{
return $this->getProperty(CatchEventInterface::BPMN_PROPERTY_DATA_OUTPUT_ASSOCIATION);
}

/**
* Register catch events.
*
Expand Down
38 changes: 38 additions & 0 deletions src/ProcessMaker/Nayra/Bpmn/DataInputAssociation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace ProcessMaker\Nayra\Bpmn;

use ProcessMaker\Nayra\Contracts\Bpmn\DataInputAssociationInterface;

/**
* Transition to check if the activity is a loop not yet completed or a single instance
*/
class DataInputAssociation implements DataInputAssociationInterface
{
use BaseTrait;

protected function initDataInputAssociation()
{
$this->properties[static::BPMN_PROPERTY_ASSIGNMENT] = new Collection;
}

public function getSource()
{
return $this->getProperty(static::BPMN_PROPERTY_SOURCES_REF);
}

public function getTarget()
{
return $this->getProperty(static::BPMN_PROPERTY_TARGET_REF);
}

public function getTransformation()
{
return $this->getProperty(static::BPMN_PROPERTY_TRANSFORMATION);
}

public function getAssignments()
{
return $this->getProperty(static::BPMN_PROPERTY_ASSIGNMENT);
}
}
38 changes: 38 additions & 0 deletions src/ProcessMaker/Nayra/Bpmn/DataOutputAssociation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace ProcessMaker\Nayra\Bpmn;

use ProcessMaker\Nayra\Contracts\Bpmn\DataOutputAssociationInterface;

/**
* DataOutputAssociation class for handling data output associations in BPMN processes
*/
class DataOutputAssociation implements DataOutputAssociationInterface
{
use BaseTrait;

protected function initDataOutputAssociation()
{
$this->properties[static::BPMN_PROPERTY_ASSIGNMENT] = new Collection;
}

public function getSource()
{
return $this->getProperty(static::BPMN_PROPERTY_SOURCES_REF);
}

public function getTarget()
{
return $this->getProperty(static::BPMN_PROPERTY_TARGET_REF);
}

public function getTransformation()
{
return $this->getProperty(static::BPMN_PROPERTY_TRANSFORMATION);
}

public function getAssignments()
{
return $this->getProperty(static::BPMN_PROPERTY_ASSIGNMENT);
}
}
72 changes: 72 additions & 0 deletions src/ProcessMaker/Nayra/Bpmn/DataStoreTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,76 @@ public function getItemSubject()
{
return $this->itemSubject;
}

/**
* Get data using dot notation.
*
* @param string $path Dot notation path (e.g., 'user.profile.name')
* @param mixed $default Default value if path doesn't exist
*
* @return mixed
*/
public function getDotData($path, $default = null)
{
$keys = explode('.', $path);
$current = $this->data;

// Navigate through the path
foreach ($keys as $key) {
// Handle numeric keys for arrays
if (is_numeric($key)) {
$key = (int) $key;
}

if (!isset($current[$key])) {
return $default;
}

$current = $current[$key];
}

return $current;
}

/**
* Set data using dot notation.
*
* @param string $path Dot notation path (e.g., 'user.profile.name')
* @param mixed $value Value to set
*
* @return $this
*/
public function setDotData($path, $value)
{
$keys = explode('.', $path);
$firstKey = $keys[0];
$current = &$this->data;

// Navigate to the parent of the target key
for ($i = 0; $i < count($keys) - 1; $i++) {
$key = $keys[$i];

// Handle numeric keys for arrays
if (is_numeric($key)) {
$key = (int) $key;
}

if (!isset($current[$key]) || !is_array($current[$key])) {
$current[$key] = [];
}
$current = &$current[$key];
}

// Set the final value
$finalKey = $keys[count($keys) - 1];
if (is_numeric($finalKey)) {
$finalKey = (int) $finalKey;
}

$current[$finalKey] = $value;
// Keep compatibility with putData method (required by PM Core)
$this->putData($firstKey, $this->data[$firstKey]);

return $this;
}
}
19 changes: 13 additions & 6 deletions src/ProcessMaker/Nayra/Bpmn/Models/EndEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ProcessMaker\Nayra\Bpmn\Models;

use ProcessMaker\Nayra\Bpmn\Collection;
use ProcessMaker\Nayra\Bpmn\EndEventTrait;
use ProcessMaker\Nayra\Contracts\Bpmn\EndEventInterface;
use ProcessMaker\Nayra\Model\DataInputAssociationInterface;
Expand All @@ -19,12 +20,18 @@ class EndEvent implements EndEventInterface
{
use EndEventTrait;

private $dataInputs;

private $dataInputAssociations;

private $inputSet;

/**
* Initialize intermediate throw event.
*/
protected function initEndEvent()
{
$this->properties[static::BPMN_PROPERTY_DATA_INPUT_ASSOCIATION] = new Collection();
$this->properties[static::BPMN_PROPERTY_DATA_INPUT] = new Collection;
$this->setProperty(static::BPMN_PROPERTY_EVENT_DEFINITIONS, new Collection);
}

/**
* Array map of custom event classes for the bpmn element.
*
Expand Down Expand Up @@ -52,7 +59,7 @@ public function getTargetInstances(EventDefinitionInterface $message, TokenInter
*/
public function getDataInputs()
{
return $this->dataInputs;
return $this->getProperty(static::BPMN_PROPERTY_DATA_INPUT);
}

/**
Expand All @@ -62,7 +69,7 @@ public function getDataInputs()
*/
public function getDataInputAssociations()
{
return $this->getDataInputAssociations();
return $this->getProperty(static::BPMN_PROPERTY_DATA_INPUT_ASSOCIATION);
}

/**
Expand Down
18 changes: 4 additions & 14 deletions src/ProcessMaker/Nayra/Bpmn/Models/IntermediateThrowEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ class IntermediateThrowEvent implements IntermediateThrowEventInterface
{
use IntermediateThrowEventTrait;

/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\DataInputAssociationInterface[]
*/
private $dataInputAssociations;

/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\DataInputInterface[]
*/
private $dataInputs;

/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\InputSetInterface
*/
Expand All @@ -38,8 +28,8 @@ class IntermediateThrowEvent implements IntermediateThrowEventInterface
*/
protected function initIntermediateThrowEvent()
{
$this->dataInputAssociations = new Collection;
$this->dataInputs = new Collection;
$this->properties[static::BPMN_PROPERTY_DATA_INPUT_ASSOCIATION] = new Collection;
$this->properties[static::BPMN_PROPERTY_DATA_INPUT] = new Collection;
$this->setProperty(static::BPMN_PROPERTY_EVENT_DEFINITIONS, new Collection);
}

Expand All @@ -60,7 +50,7 @@ protected function getBpmnEventClasses()
*/
public function getDataInputAssociations()
{
return $this->dataInputAssociations;
return $this->getProperty(static::BPMN_PROPERTY_DATA_INPUT_ASSOCIATION);
}

/**
Expand All @@ -70,7 +60,7 @@ public function getDataInputAssociations()
*/
public function getDataInputs()
{
return $this->dataInputs;
return $this->getProperty(static::BPMN_PROPERTY_DATA_INPUT);
}

/**
Expand Down
Loading