repo stringlengths 7 63 | file_url stringlengths 81 284 | file_path stringlengths 5 200 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:02:33 2026-01-05 05:24:06 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ServiceInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ServiceInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* ServiceInterface (BPMN Interface) defines a set of operations that are implemented by Services.
*/
interface ServiceInterface extends EntityInterface
{
const BPMN_PROPERTY_IMPLEMENTATION_REF = 'implementationRef';
const BPMN_PROPERTY_OPERATIONS = 'operations';
const BPMN_PROPERTY_CALLABLE_ELEMENTS = 'callableElements';
/**
* Get the name of the element
*
* @return string
*/
public function getName();
/**
* Set the name of the element
*
* @param string $name
*
* @return $this
*/
public function setName($name);
/**
* Get the reference to a concrete artifact in the underlying implementation
* representing the service.
*
* @return mixed
*/
public function getImplementationRef();
/**
* Set the reference to a concrete artifact in the underlying implementation
* representing the service.
*
* @param mixed $implementation
*
* @return $this
*/
public function setImplementationRef($implementation);
/**
* Get the operations that are defined as part of the Service Interface
*
* @return OperationInterface[]
*/
public function getOperations();
/**
* Set the operations that are defined as part of the Service Interface
*
* @param CollectionInterface $operations
*
* @return $this
*/
public function setOperations(CollectionInterface $operations);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/StandardLoopCharacteristicsInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/StandardLoopCharacteristicsInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface;
interface StandardLoopCharacteristicsInterface extends LoopCharacteristicsInterface
{
const BPMN_PROPERTY_TEST_BEFORE = 'testBefore';
const BPMN_PROPERTY_LOOP_MAXIMUM = 'loopMaximum';
const BPMN_PROPERTY_LOOP_CONDITION = 'loopCondition';
/**
* Gets as testBefore
*
* @return bool
*/
public function getTestBefore();
/**
* Sets a new testBefore
*
* @param bool $testBefore
*
* @return self
*/
public function setTestBefore(bool $testBefore);
/**
* Gets as loopMaximum
*
* @return string
*/
public function getLoopMaximum();
/**
* Sets a new loopMaximum
*
* @param string $loopMaximum
* @return self
*/
public function setLoopMaximum(string $loopMaximum);
/**
* Gets as loopCondition
*
* @return FormalExpressionInterface
*/
public function getLoopCondition();
/**
* Sets a new loopCondition
*
* @param FormalExpressionInterface $loopCondition
* @return self
*/
public function setLoopCondition(FormalExpressionInterface $loopCondition);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/TimerEventDefinitionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/TimerEventDefinitionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Engine\EngineInterface;
/**
* TimerEventDefinition interface.
*/
interface TimerEventDefinitionInterface extends EventDefinitionInterface
{
const BPMN_PROPERTY_TIME_DATE = 'timeDate';
const BPMN_PROPERTY_TIME_CYCLE = 'timeCycle';
const BPMN_PROPERTY_TIME_DURATION = 'timeDuration';
const EVENT_THROW_EVENT_DEFINITION = 'ThrowTimerEvent';
const EVENT_CATCH_EVENT_DEFINITION = 'CatchTimerEvent';
/**
* Get the date expression for the timer event definition.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface
*/
public function getTimeDate();
/**
* Get the cycle expression for the timer event definition.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface
*/
public function getTimeCycle();
/**
* Get the duration expression for the timer event definition.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface
*/
public function getTimeDuration();
/**
* Set the date expression for the timer event definition.
*
* @param callable $timeExpression
*/
public function setTimeDate(callable $timeExpression);
/**
* Set the cycle expression for the timer event definition.
*
* @param callable $timeExpression
*/
public function setTimeCycle(callable $timeExpression);
/**
* Set the duration expression for the timer event definition.
*
* @param callable $timeExpression
*/
public function setTimeDuration(callable $timeExpression);
/**
* Register in catch events.
*
* @param EngineInterface $engine
* @param FlowElementInterface $element
* @param TokenInterface|null $token
*/
public function scheduleTimerEvents(EngineInterface $engine, FlowElementInterface $element, TokenInterface $token = null);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ItemDefinitionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ItemDefinitionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* An ItemDefinition is used to define the payload of the Message.
*/
interface ItemDefinitionInterface extends EntityInterface
{
const BPMN_PROPERTY_ITEM_KIND = 'itemKind';
const BPMN_PROPERTY_STRUCTURE = 'structure';
const BPMN_PROPERTY_STRUCTURE_REF = 'structureRef';
const BPMN_PROPERTY_IS_COLLECTION = 'isCollection';
const ITEM_KIND_PHYSICAL = 'physical';
const ITEM_KIND_INFORMATION = 'information';
/**
* Get the nature of the Item. Possible values are physical
* or information.
*
* @return string
*/
public function getItemKind();
/**
* Get the concrete data structure to be used.
*
* @return mixed
*/
public function getStructure();
/**
* Get true if the data structure represents a collection.
*
* @return bool
*/
public function isCollection();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ItemAwareElementInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ItemAwareElementInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* This element can store or convey items during process execution.
*/
interface ItemAwareElementInterface extends FlowElementInterface
{
/**
* Get the items that are stored or conveyed by the ItemAwareElement.
*
* @return ItemDefinitionInterface
*/
public function getItemSubject();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/InputSetInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/InputSetInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* InputSet interface.
*/
interface InputSetInterface extends EntityInterface
{
const BPMN_PROPERTY_DATA_INPUTS = 'dataInputs';
const BPMN_PROPERTY_DATA_INPUT_REFS = 'dataInputRefs';
/**
* Get the DataInput elements that collectively make up this data requirement.
*
* @return DataInputInterface[]
*/
public function getDataInputs();
/**
* Set the DataInput elements that collectively make up this data requirement.
*
* @param CollectionInterface $dataInputs
*
* @return $this
*/
public function setDataInputs(CollectionInterface $dataInputs);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ConditionalEventDefinitionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ConditionalEventDefinitionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* ConditionalEventDefinition interface.
*/
interface ConditionalEventDefinitionInterface extends EventDefinitionInterface
{
const BPMN_PROPERTY_CONDITION = 'condition';
/**
* Get the condition to trigger the event.
*
* @return FormalExpressionInterface
*/
public function getCondition();
/**
* Check if the $eventDefinition should be catch
*
* @param EventDefinitionInterface $eventDefinition
*
* @return bool
*/
public function shouldCatchEventDefinition(EventDefinitionInterface $eventDefinition);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/EventDefinitionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/EventDefinitionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Engine\EngineInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* EventDefinition interface.
*/
interface EventDefinitionInterface extends EntityInterface
{
/**
* Returns the element's id
*
* @return mixed
*/
public function getId();
/**
* Sets the element id
*
* @param mixed $value
*/
public function setId($value);
/**
* Assert the event definition rule for trigger the event.
*
* @param EventDefinitionInterface $event
* @param FlowNodeInterface $target
* @param ExecutionInstanceInterface|null $instance
* @param TokenInterface|null $token
*
* @return bool
*/
public function assertsRule(self $event, FlowNodeInterface $target, ExecutionInstanceInterface $instance = null, TokenInterface $token = null);
/**
* Implement the event definition behavior when an event is triggered.
*
* @param EventDefinitionInterface $event
* @param FlowNodeInterface $target
* @param ExecutionInstanceInterface|null $instance
* @param TokenInterface|null $token
*
* @return $this
*/
public function execute(self $event, FlowNodeInterface $target, ExecutionInstanceInterface $instance = null, TokenInterface $token = null);
/**
* Register event with a catch event
*
* @param EngineInterface $engine
* @param CatchEventInterface $element
*
* @return void
*/
public function registerWithCatchEvent(EngineInterface $engine, CatchEventInterface $element);
/**
* Occurs when the catch event was activated
*
* @param EngineInterface $engine
* @param CatchEventInterface $element
* @param TokenInterface|null $token
*
* @return void
*/
public function catchEventActivated(EngineInterface $engine, CatchEventInterface $element, TokenInterface $token = null);
/**
* Check if the event definition should be catched
*
* @param EventDefinitionInterface $sourceEvent
*
* @return bool
*/
public function shouldCatchEventDefinition(self $sourceEvent);
/**
* Get data contained in the event payload
*
* @param TokenInterface|null $token
* @param CatchEventInterface|null $target
*
* @return mixed
*/
public function getPayloadData(TokenInterface $token = null, CatchEventInterface $target = null);
/**
* Set do not trigger start events
*
* @param bool $value
*
* @return $this
*/
public function setDoNotTriggerStartEvents($value);
/**
* Get do not trigger start events value
*
* @return bool
*/
public function getDoNotTriggerStartEvents();
/**
* Returns the event of the event definition (message, signal, etc.)
*
* @return SignalInterface|MessageInterface|ErrorInterface|mixed
*/
public function getPayload();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/TokenInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/TokenInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
use Throwable;
/**
* Token of a process instance.
*/
interface TokenInterface extends EntityInterface
{
const BPMN_PROPERTY_MESSAGE = 'message';
const BPMN_PROPERTY_STATUS = 'status';
const BPMN_PROPERTY_INDEX = 'index';
const BPMN_PROPERTY_EVENT_ID = 'event_id';
const BPMN_PROPERTY_EVENT_DEFINITION_CAUGHT = 'event_definition_caught';
const BPMN_PROPERTY_EVENT_TYPE = 'event_type';
/**
* Get the owner of the token.
*
* @return StateInterface
*/
public function getOwner();
/**
* Set the owner of the token.
*
* @param StateInterface $owner
*
* @return mixed
*/
public function setOwner(StateInterface $owner);
/**
* Get owner status for the current token.
*
* @return string
*/
public function getOwnerStatus();
/**
* Get token internal status.
*
* @return string
*/
public function getStatus();
/**
* Set token internal status.
*
* @param string $status
*
* @return $this
*/
public function setStatus($status);
/**
* Get token internal index.
*
* @return index
*/
public function getIndex();
/**
* Set token internal index.
*
* @param int $index
*
* @return $this
*/
public function setIndex($index);
/**
* Set the owner execution instance of the token.
*
* @param ExecutionInstanceInterface|null $instance
*
* @return $this
*/
public function setInstance(ExecutionInstanceInterface $instance = null);
/**
* Get the owner execution instance of the token.
*
* @return ExecutionInstanceInterface $instance
*/
public function getInstance();
/**
* Get the owner element of the token.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface
*/
public function getOwnerElement();
/**
* Log an error when executing the token
*
* @param \Throwable $error
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowElementInterface $bpmnElement
*/
public function logError(Throwable $error, FlowElementInterface $bpmnElement);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/MultiInstanceLoopCharacteristicsInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/MultiInstanceLoopCharacteristicsInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* MultiInstanceLoopCharacteristics interface allows for creation of a desired
* number of Activity instances. The instances MAY execute in parallel or MAY
* be sequential. Either an Expression is used to specify or calculate the
* desired number of instances or a data driven setup can be used. In that case
* a data input can be specified, which is able to
*/
interface MultiInstanceLoopCharacteristicsInterface extends LoopCharacteristicsInterface
{
const BPMN_PROPERTY_IS_SEQUENTIAL = 'isSequential';
const BPMN_PROPERTY_BEHAVIOR = 'behavior';
const BPMN_PROPERTY_LOOP_CARDINALITY = 'loopCardinality';
const BPMN_PROPERTY_ONE_BEHAVIOR_EVENT_REF = 'oneBehaviorEventRef';
const BPMN_PROPERTY_NONE_BEHAVIOR_EVENT_REF = 'oneBehaviorEventRef';
const BPMN_PROPERTY_LOOP_DATA_INPUT_REF = 'loopDataInputRef';
const BPMN_PROPERTY_LOOP_DATA_OUTPUT_REF = 'loopDataOutputRef';
const BPMN_PROPERTY_LOOP_DATA_INPUT = 'loopDataInputRef';
const BPMN_PROPERTY_LOOP_DATA_OUTPUT = 'loopDataOutputRef';
const BPMN_PROPERTY_INPUT_DATA_ITEM = 'inputDataItem';
const BPMN_PROPERTY_OUTPUT_DATA_ITEM = 'outputDataItem';
const BPMN_PROPERTY_COMPLEX_BEHAVIOR_DEFINITION = 'complexBehaviorDefinition';
const BPMN_PROPERTY_COMPLETION_CONDITION = 'completionCondition';
/**
* Gets as isSequential
*
* @return bool
*/
public function getIsSequential();
/**
* Sets a new isSequential
*
* @param bool $isSequential
*
* @return self
*/
public function setIsSequential(bool $isSequential);
/**
* Gets as behavior
*
* @return string
*/
public function getBehavior();
/**
* Sets a new behavior
*
* @param string $behavior
* @return self
*/
public function setBehavior($behavior);
/**
* Gets as oneBehaviorEventRef
*
* @return string
*/
public function getOneBehaviorEventRef();
/**
* Sets a new oneBehaviorEventRef
*
* @param string $oneBehaviorEventRef
* @return self
*/
public function setOneBehaviorEventRef($oneBehaviorEventRef);
/**
* Gets as noneBehaviorEventRef
*
* @return string
*/
public function getNoneBehaviorEventRef();
/**
* Sets a new noneBehaviorEventRef
*
* @param string $noneBehaviorEventRef
* @return self
*/
public function setNoneBehaviorEventRef($noneBehaviorEventRef);
/**
* Gets as loopCardinality
*
* @return FormalExpressionInterface
*/
public function getLoopCardinality();
/**
* Sets a new loopCardinality
*
* @param FormalExpressionInterface $loopCardinality
* @return self
*/
public function setLoopCardinality(FormalExpressionInterface $loopCardinality);
/**
* Gets as loopDataInputRef
*
* @return string
*/
public function getLoopDataInputRef();
/**
* Sets a new loopDataInputRef
*
* @param string $loopDataInputRef
* @return self
*/
public function setLoopDataInputRef($loopDataInputRef);
/**
* Gets as loopDataInputRef
*
* @return DataInputInterface
*/
public function getLoopDataInput();
/**
* Sets a new loopDataInputRef
*
* @param DataInputInterface $loopDataInput
* @return self
*/
public function setLoopDataInput(DataInputInterface $loopDataInput);
/**
* Gets as loopDataOutputRef
*
* @return string
*/
public function getLoopDataOutputRef();
/**
* Sets a new loopDataOutputRef
*
* @param string $loopDataOutputRef
* @return self
*/
public function setLoopDataOutputRef($loopDataOutputRef);
/**
* Gets as loopDataOutputRef
*
* @return DataOutputInterface
*/
public function getLoopDataOutput();
/**
* Sets a new loopDataOutputRef
*
* @param DataOutputInterface $loopDataOutput
*
* @return self
*/
public function setLoopDataOutput(DataOutputInterface $loopDataOutput);
/**
* Gets as inputDataItem
*
* @return DataInputInterface
*/
public function getInputDataItem();
/**
* Sets a new inputDataItem
*
* @param DataInputInterface $inputDataItem
* @return self
*/
public function setInputDataItem(DataInputInterface $inputDataItem);
/**
* Gets as outputDataItem
*
* @return DataOutputInterface
*/
public function getOutputDataItem();
/**
* Sets a new outputDataItem
*
* @param DataOutputInterface $outputDataItem
* @return self
*/
public function setOutputDataItem(DataOutputInterface $outputDataItem);
/**
* Gets as complexBehaviorDefinition
*
* @return ComplexBehaviorDefinitionInterface
*/
public function getComplexBehaviorDefinition();
/**
* Sets a new complexBehaviorDefinition
*
* @param ComplexBehaviorDefinitionInterface $complexBehaviorDefinition
* @return self
*/
public function setComplexBehaviorDefinition(ComplexBehaviorDefinitionInterface $complexBehaviorDefinition);
/**
* Gets as completionCondition
*
* @return FormalExpressionInterface
*/
public function getCompletionCondition();
/**
* Sets a new completionCondition
*
* @param FormalExpressionInterface $completionCondition
* @return self
*/
public function setCompletionCondition(FormalExpressionInterface $completionCondition);
/**
* Get error when the data input is invalid
*
* @param ExecutionInstanceInterface $instance
* @param TokenInterface $token
*
* @return string
*/
public function getDataInputError(ExecutionInstanceInterface $instance, TokenInterface $token);
/**
* When a token is terminated
*
* @param TokenInterface $token
*
* @return void
*/
public function onTokenTerminated(TokenInterface $token);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ServiceTaskInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ServiceTaskInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Defines the interface to be used by the ScriptTasks
*/
interface ServiceTaskInterface extends ActivityInterface
{
const BPMN_PROPERTY_IMPLEMENTATION = 'implementation';
const EVENT_SERVICE_TASK_ACTIVATED = 'ServiceTaskActivated';
/**
* Sets the service task implementation
*
* @param mixed $implementation
*
* @return $this
*/
public function setImplementation($implementation);
/**
* Returns the service task implementation
*
* @return mixed
*/
public function getImplementation();
/**
* Runs the Service Task
*
* @param TokenInterface $token
*
* @return $this
*/
public function run(TokenInterface $token);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/FlowElementInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/FlowElementInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Flow Element is an abstract class for all the elements that can appear in
* a Process.
*/
interface FlowElementInterface extends EntityInterface
{
/**
* @return $this
*/
public function setOwnerProcess(ProcessInterface $ownerProcess);
/**
* @return ProcessInterface
*/
public function getOwnerProcess();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/TraversableInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/TraversableInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Bpmn\Collection;
/**
* Interface to search paths through elements.
*/
interface TraversableInterface
{
/**
* Find all the paths that complies with the $condition and $while.
*
* @param callable $condition
* @param callable $while
* @param array $path
* @param array $passedthru
* @param array $paths
*
* @return Collection
*/
public function paths(callable $condition, callable $while, $path = [], &$passedthru = [], &$paths = []);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ErrorEventDefinitionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ErrorEventDefinitionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ErrorInterface;
/**
* ErrorEventDefinition interface.
*/
interface ErrorEventDefinitionInterface extends EventDefinitionInterface
{
const BPMN_PROPERTY_ERROR_REF = 'errorRef';
const BPMN_PROPERTY_ERROR = 'error';
const EVENT_THROW_EVENT_DEFINITION = 'ThrowErrorEvent';
const EVENT_CATCH_EVENT_DEFINITION = 'CatchErrorEvent';
/**
* Get the error of the event definition.
*
* @return ErrorInterface
*/
public function getError();
/**
* Returns the event definition payload (message, signal, etc.)
*
* @return ErrorInterface
*/
public function getPayload();
/**
* Set the error of the event definition.
*
* @param ErrorInterface $error
*
* @return $this
*/
public function setError(ErrorInterface $error);
/**
* Check if the $eventDefinition should be catch
*
* @param EventDefinitionInterface $eventDefinition
*
* @return bool
*/
public function shouldCatchEventDefinition(EventDefinitionInterface $eventDefinition);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/MessageListenerInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/MessageListenerInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Behavior that must implement objects that listen to message notifications
*/
interface MessageListenerInterface
{
/**
* Method to be called when a message event arrives
*
* @param EventDefinitionInterface $message
* @param ExecutionInstanceInterface $instance
*
* @return $this
*/
public function execute(EventDefinitionInterface $message, ExecutionInstanceInterface $instance);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/EventBasedGatewayInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/EventBasedGatewayInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Event Based Gateway Interface
*/
interface EventBasedGatewayInterface extends GatewayInterface
{
const EVENT_CATCH_EVENT_TRIGGERED = 'EventBasedGatewayCatchEventTriggered';
/**
* Get the next Event Elements after the gateway
*
* @return CatchEventInterface
*/
public function getNextEventElements();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/GatewayCollectionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/GatewayCollectionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Collection of gateways.
*/
interface GatewayCollectionInterface extends CollectionInterface
{
/**
* Add an element to the collection.
*
* @param GatewayInterface $element
*
* @return $this
*/
public function add(GatewayInterface $element);
/**
* Get a item by index
*
* @param $index
*
* @return GatewayInterface
*/
public function item($index);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DataInputInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DataInputInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* DataInput interface.
*/
interface DataInputInterface extends ItemAwareElementInterface
{
const BPMN_PROPERTY_ITEM_SUBJECT = 'itemSubject';
const BPMN_PROPERTY_ITEM_SUBJECT_REF = 'itemSubjectRef';
const BPMN_PROPERTY_IS_COLLECTION = 'isCollection';
/**
* Get true if the DataInput represents a collection of elements.
*
* @return bool
*/
public function isCollection();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/CorrelationKeyInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/CorrelationKeyInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
interface CorrelationKeyInterface
{
/**
* Get the CorrelationProperties representing the partial keys of
* this CorrelationKey.
*
* @return CorrelationPropertyInterface[]
*/
public function getCorrelationProperty();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DataStoreCollectionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DataStoreCollectionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Collection of data stores.
*/
interface DataStoreCollectionInterface extends CollectionInterface
{
/**
* Add an element to the collection.
*
* @param DataStoreInterface $element
*
* @return $this
*/
public function add(DataStoreInterface $element);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DataStoreInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DataStoreInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Data store interface.
*/
interface DataStoreInterface extends ItemAwareElementInterface
{
/**
* Type of element.
*/
const TYPE = 'bpmnDataStore';
/**
* Properties.
*/
const PROPERTIES = [
'APP_UID' => '',
'APP_TITLE' => null,
'APP_DESCRIPTION' => null,
'APP_NUMBER' => '0',
'APP_PARENT' => '0',
'APP_STATUS' => '',
'APP_STATUS_ID' => '0',
'PRO_UID' => '',
'APP_PROC_STATUS' => '',
'APP_PROC_CODE' => '',
'APP_PARALLEL' => 'NO',
'APP_INIT_USER' => '',
'APP_CUR_USER' => '',
'APP_CREATE_DATE' => null,
'APP_INIT_DATE' => null,
'APP_FINISH_DATE' => null,
'APP_UPDATE_DATE' => null,
'APP_DATA' => null,
'APP_PIN' => '',
'APP_DURATION' => '0',
'APP_DELAY_DURATION' => '0',
'APP_DRIVE_FOLDER_UID' => '',
'APP_ROUTING_DATA' => null,
];
/**
* Child elements.
*/
const ELEMENTS = [
];
/**
* Get data from store.
*
* @param string $name
* @param mixed $default
*
* @return mixed
*/
public function getData($name = null, $default = null);
/**
* Set data of the store.
*
* @param mixed $data
*
* @return $this
*/
public function setData($data);
/**
* Put data to store.
*
* @param string $name
* @param mixed $data
*
* @return $this
*/
public function putData($name, $data);
/**
* 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);
/**
* 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);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ParallelGatewayInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ParallelGatewayInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
interface ParallelGatewayInterface extends GatewayInterface
{
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/SignalInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/SignalInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Behavior that must implement all event messages
*/
interface SignalInterface extends EntityInterface
{
/**
* Returns the id of the message
*
* @return string
*/
public function getId();
/**
* Sets the id of the message
* @param string $value
*/
public function setId($value);
/**
* Returns the name of the message
*
* @return string
*/
public function getName();
/**
* Sets the name of the signal
* @param string $value
*/
public function setName($value);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/CallActivityInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/CallActivityInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* The Call Activity acts as a ‘wrapper’ for the invocation of a global
* Process or Global Task within the execution.
*/
interface CallActivityInterface extends ActivityInterface
{
const BPMN_PROPERTY_CALLED_ELEMENT = 'calledElement';
/**
* Get the element to be called.
*
* @return ProcessInterface
*/
public function getCalledElement();
/**
* Set the called element by the activity.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CallableElementInterface|string $callableElement
*
* @return $this
*/
public function setCalledElement($callableElement);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/CatchEventInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/CatchEventInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Engine\EngineInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* CatchEvent interface.
*/
interface CatchEventInterface extends EventInterface
{
const BPMN_PROPERTY_PARALLEL_MULTIPLE = 'parallelMultiple';
const TOKEN_STATE_EVENT_CATCH = 'EVENT_CATCH';
const EVENT_CATCH_TOKEN_ARRIVES = 'CatchEventTokenArrives';
const BPMN_PROPERTY_DATA_OUTPUT = 'dataOutput';
const BPMN_PROPERTY_DATA_OUTPUT_SET = 'outputSet';
const BPMN_PROPERTY_DATA_OUTPUT_ASSOCIATION = 'dataOutputAssociation';
/**
* Get EventDefinitions that are triggers expected for a catch Event.
*
* @return EventDefinitionInterface[]|CollectionInterface
*/
public function getEventDefinitions();
/**
* Register catch events.
*
* @param EngineInterface $engine
*
* @return $this
*/
public function registerCatchEvents(EngineInterface $engine);
/**
* Register the BPMN elements with the engine.
*
* @param EngineInterface $engine
*
* @return FlowElementInterface
*/
public function registerWithEngine(EngineInterface $engine);
/**
* Execute the catch event element using an $event and $instance
*
* @param EventDefinitionInterface $event
* @param ExecutionInstanceInterface|null $instance
*
* @return $this
*/
public function execute(EventDefinitionInterface $event, ExecutionInstanceInterface $instance = null);
/**
* Get the active state of the element
*
* @return StateInterface
*/
public function getActiveState();
/**
* Get the data output associations.
*
* @return DataOutputAssociationInterface[]
*/
public function getDataOutputAssociations();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/EventInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/EventInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface;
/**
* EventInterface
*/
interface EventInterface extends FlowNodeInterface
{
const BPMN_PROPERTY_EVENT_DEFINITIONS = 'eventDefinitions';
const BPMN_PROPERTY_DATA_INPUT = 'dataInput';
const BPMN_PROPERTY_DATA_INPUT_SET = 'inputSet';
const BPMN_PROPERTY_DATA_INPUT_ASSOCIATION = 'dataInputAssociation';
const TYPE_START = 'START';
const TYPE_INTERMEDIATE = 'INTERMEDIATE';
const TYPE_END = 'END';
const MARKER_EMPTY = 'EMPTY';
const MARKER_MESSAGETHROW = 'MESSAGETHROW';
const MARKER_EMAIL = 'EMAIL';
const MARKER_MESSAGECATCH = 'MESSAGECATCH';
const BEHAVIOR_THROW = 'THROW';
const BEHAVIOR_CATCH = 'CATCH';
/**
* Events
*/
const EVENT_EVENT_TRIGGERED = 'EventTriggered';
/**
* Token states defined for Event
*/
const TOKEN_STATE_ACTIVE = 'ACTIVE';
const TOKEN_STATE_COMPLETED = 'COMPLETED';
/**
* Get Process of the event.
*
* @return ProcessInterface
*/
public function getProcess();
/**
* Get Process of the event.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface $process
*
* @return ProcessInterface
*/
public function setProcess(ProcessInterface $process);
/**
* Get the event EventDefinitions that are results expected for a throw
* Event.
*
* @return EventDefinitionInterface[]
*/
public function getEventDefinitions();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ProcessInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ProcessInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* Process describes a business work using a sequence or flow of activities.
*/
interface ProcessInterface extends CallableElementInterface
{
/**
* Type of element.
*/
const TYPE = 'process';
/**
* Properties.
*/
const BPMN_PROPERTY_IS_CLOSED = 'isClosed';
const BPMN_PROPERTY_IS_EXECUTABLE = 'isExecutable';
const BPMN_PROPERTY_PROCESS_TYPE = 'processType';
const BPMN_PROPERTY_PARTICIPANT = 'participant';
const BPMN_PROPERTY_LANE_SET = 'laneSet';
/**
* Events defined for Activity
*/
const EVENT_PROCESS_INSTANCE_CREATED = 'ProcessInstanceCreated';
const EVENT_PROCESS_INSTANCE_COMPLETED = 'ProcessInstanceCompleted';
/**
* Get Diagram of the process.
*
* @return DiagramInterface
*/
public function getDiagram();
/**
* Get Diagram of the process.
*
* @param DiagramInterface $diagram
*
* @return DiagramInterface
*/
public function setDiagram(DiagramInterface $diagram);
/**
* Get Activities of the process.
*
* @return ActivityCollectionInterface
*/
public function getActivities();
/**
* Get Activities of the process.
*
* @param ActivityCollectionInterface $activities
*
* @return ActivityCollectionInterface
*/
public function setActivities(ActivityCollectionInterface $activities);
/**
* Get Gateways of the process.
*
* @return GatewayCollectionInterface
*/
public function getGateways();
/**
* Get Gateways of the process.
*
* @param GatewayCollectionInterface $gateways
*
* @return GatewayCollectionInterface
*/
public function setGateways(GatewayCollectionInterface $gateways);
/**
* Get Events of the process.
*
* @return EventCollectionInterface
*/
public function getEvents();
/**
* Get Events of the process.
*
* @param EventCollectionInterface $events
*
* @return EventCollectionInterface
*/
public function setEvents(EventCollectionInterface $events);
/**
* Get Artifacts of the process.
*
* @return ArtifactCollectionInterface
*/
public function getArtifacts();
/**
* Get Artifacts of the process.
*
* @param ArtifactCollectionInterface $artifacts
*
* @return ArtifactCollectionInterface
*/
public function setArtifacts(ArtifactCollectionInterface $artifacts);
/**
* Get Flows of the process.
*
* @return FlowCollectionInterface
*/
public function getFlows();
/**
* Get Flows of the process.
*
* @param FlowCollectionInterface $flows
*
* @return FlowCollectionInterface
*/
public function setFlows(FlowCollectionInterface $flows);
/**
* Get data stores of the process.
*
* @return DataStoreCollectionInterface
*/
public function getDataStores();
/**
* Get data stores of the process.
*
* @param DataStoreCollectionInterface $dataStore
*
* @return DataStoreCollectionInterface
*/
public function setDataStores(DataStoreCollectionInterface $dataStore);
/**
* Get the transition rules of the process.
*
* @param RepositoryInterface $factory
*
* @return TransitionInterface[]
*/
public function getTransitions(RepositoryInterface $factory);
/**
* Get the dispatcher of the process.
*
* @return \ProcessMaker\Nayra\Contracts\EventBusInterface
*/
public function getDispatcher();
/**
* Set the dispatcher of the process.
*
* @param mixed $dispatcher
*
* @return $this
*/
public function setDispatcher($dispatcher);
/**
* Add an activity to the process.
*
* @param ActivityInterface $activity
*
* @return $this
*/
public function addActivity(ActivityInterface $activity);
/**
* Add an event to the process.
*
* @param EventInterface $event
*
* @return $this
*/
public function addEvent(EventInterface $event);
/**
* Add a gateway to the process.
*
* @param GatewayInterface $gateway
*
* @return $this
*/
public function addGateway(GatewayInterface $gateway);
/**
* Get the loaded process instances.
*
* @return \ProcessMaker\Nayra\Bpmn\Collection
*/
public function getInstances();
/**
* Add process instance reference.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $instance
*
* @return $this
*/
public function addInstance(ExecutionInstanceInterface $instance);
/**
* Get lane sets of the process.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\LaneSetInterface[]
*/
public function getLaneSets();
/**
* Set the lane sets of the process
*
* @param CollectionInterface $laneSets
*
* @return $this
*/
public function setLaneSets(CollectionInterface $laneSets);
/**
* Notify an process instance event.
*
* @param string $eventName
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $instance
* @param mixed $event
*
* @return $this
*/
public function notifyInstanceEvent($eventName, ExecutionInstanceInterface $instance, $event = null);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ComplexBehaviorDefinitionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ComplexBehaviorDefinitionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Complex Behavior Definition This element controls when and which Events are
* thrown in case behavior of the Multi-Instance Activity is set to complex.
*/
interface ComplexBehaviorDefinitionInterface extends EntityInterface
{
const BPMN_PROPERTY_CONDITION = 'condition';
const BPMN_PROPERTY_EVENT = 'event';
/**
* @return FormalExpressionInterface
*/
public function getCondition();
/**
* @param FormalExpressionInterface $condition
*
* @return self
*/
public function setCondition(FormalExpressionInterface $condition);
/**
* @return mixed
*/
public function getEvent();
/**
* @param mixed $event
*
* @return self
*/
public function setEvent($event);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ConnectionNodeInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ConnectionNodeInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Bpmn\Collection;
/**
* Connection node (States and transitions) that define the behavior of
* a bpmn flow node.
*/
interface ConnectionNodeInterface extends EntityInterface
{
/**
* @return Collection Outgoing flows.
*/
public function outgoing();
/**
* @return Collection Incoming flows.
*/
public function incoming();
/**
* Add an outgoing flow.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\ConnectionNodeInterface $target
*/
public function connectTo(self $target);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DiagramInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DiagramInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Diagram contains flow elements of a process.
*/
interface DiagramInterface extends EntityInterface
{
/**
* Type of element.
*/
const TYPE = 'bpmnDiagram';
/**
* Properties.
*/
const PROPERTIES = [
'DIA_UID' => '',
'PRJ_UID' => null,
'DIA_NAME' => null,
'DIA_IS_CLOSABLE' => '0',
];
/**
* Child elements.
*/
const ELEMENTS = [
'shapes' => ShapeInterface::TYPE,
];
/**
* Get Shapes of the diagram.
*
* @return ShapeCollectionInterface
*/
public function getShapes();
/**
* Get Shapes of the diagram.
*
* @return ShapeCollectionInterface
*/
public function setShapes(ShapeCollectionInterface $shapes);
/**
* Get Process of the diagram.
*
* @return ProcessInterface
*/
public function getProcess();
/**
* Get Process of the diagram.
*
* @return ProcessInterface
*/
public function setProcess(ProcessInterface $process);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/LaneSetInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/LaneSetInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Lane set interface.
*/
interface LaneSetInterface extends EntityInterface
{
const BPMN_PROPERTY_LANE = 'lane';
/**
* Get the name of the lane set.
*
* @return string
*/
public function getName();
/**
* Get the lanes of the lane set.
*
* @return CollectionInterface
*/
public function getLanes();
/**
* Set the name of the lane set.
*
* @param string $name
*
* @return $this
*/
public function setName($name);
/**
* Set the lanes of the lane set.
*
* @param CollectionInterface $lanes
*
* @return $this
*/
public function setLanes(CollectionInterface $lanes);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/LoopCharacteristicsInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/LoopCharacteristicsInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Activities MAY be repeated sequentially, essentially behaving like a loop.
* The presence of LoopCharacteristics signifies that the Activity has looping
* behavior. LoopCharacteristics is an abstract class. Concrete subclasses
* define specific kinds of looping behavior.
*/
interface LoopCharacteristicsInterface extends EntityInterface
{
const BPMN_LOOP_INSTANCE_PROPERTY = 'loopCharacteristics';
/**
* Iterate the loop action
*
* @param StateInterface $nextState
* @param ExecutionInstanceInterface $instance
* @param CollectionInterface $consumeTokens
* @param array $properties
* @param TransitionInterface|null $source
*
* @return void
*/
public function iterateNextState(StateInterface $nextState, ExecutionInstanceInterface $instance, CollectionInterface $consumeTokens, array $properties = [], TransitionInterface $source = null);
/**
* Check if the loop was completed
*
* @param ExecutionInstanceInterface $instance
* @param TokenInterface $token
*
* @return bool
*/
public function isLoopCompleted(ExecutionInstanceInterface $instance, TokenInterface $token);
/**
* Check if the loop should continue
*
* @param ExecutionInstanceInterface $instance
* @param TokenInterface $token
*
* @return bool
*/
public function continueLoop(ExecutionInstanceInterface $instance, TokenInterface $token);
/**
* Check if the loop can be formally executed
*
* @return bool
*/
public function isExecutable();
/**
* Get Loop Instance property during execution
*
* @param TokenInterface $token
* @param string $key
* @param mixed $defaultValue
*
* @return mixed
*/
public function getLoopInstanceProperty(TokenInterface $token, $key, $defaultValue = null);
/**
* Check if the loop has a valid data input
*
* @param ExecutionInstanceInterface $instance
* @param TokenInterface $token
*
* @return bool
*/
public function isDataInputValid(ExecutionInstanceInterface $instance, TokenInterface $token);
/**
* When a token is completed
*
* @param TokenInterface $token
*
* @return void
*/
public function onTokenCompleted(TokenInterface $token);
/**
* Merge output data
*
* @param CollectionInterface $consumedTokens
* @param ExecutionInstanceInterface $instance
*
* @return void
*/
public function mergeOutputData(CollectionInterface $consumedTokens, ExecutionInstanceInterface $instance);
/**
* Should close tokens after each loop?
*
* @return bool
*/
public function shouldCloseTokensEachLoop();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/EventCollectionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/EventCollectionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Collection of Events.
*/
interface EventCollectionInterface extends CollectionInterface
{
/**
* Add an element to the collection.
*
* @param EventInterface $element
*
* @return $this
*/
public function add(EventInterface $element);
/**
* Get a item by index
*
* @param $index
*
* @return EventInterface
*/
public function item($index);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/FlowInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/FlowInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* FlowInterface
*/
interface FlowInterface extends EntityInterface
{
/**
* Type of element.
*/
const TYPE = 'bpmnFlow';
const BPMN_PROPERTY_CONDITION_EXPRESSION = 'conditionExpression';
const BPMN_PROPERTY_IS_DEFAULT = 'isDefault';
const BPMN_PROPERTY_SOURCE = 'source';
const BPMN_PROPERTY_TARGET = 'target';
const BPMN_PROPERTY_SOURCE_REF = 'sourceRef';
const BPMN_PROPERTY_TARGET_REF = 'targetRef';
const TYPE_DEFAULT = 'DEFAULT';
const TYPE_SEQUENCE = 'SEQUENCE';
const TYPE_MESSAGE = 'MESSAGE';
/**
* Properties.
*/
const PROPERTIES = [
'FLO_UID' => '',
'DIA_UID' => '',
'FLO_TYPE' => 'SEQUENCE',
'FLO_NAME' => '',
'FLO_ELEMENT_ORIGIN' => '',
'FLO_ELEMENT_ORIGIN_TYPE' => '',
'FLO_ELEMENT_ORIGIN_PORT' => '0',
'FLO_ELEMENT_DEST' => '',
'FLO_ELEMENT_DEST_TYPE' => '',
'FLO_ELEMENT_DEST_PORT' => '0',
'FLO_IS_INMEDIATE' => null,
'FLO_CONDITION' => null,
'FLO_X1' => '0',
'FLO_Y1' => '0',
'FLO_X2' => '0',
'FLO_Y2' => '0',
'FLO_STATE' => null,
'FLO_POSITION' => '0',
];
/**
* Child elements.
*/
const ELEMENTS = [
];
/**
* Get Process of the flow.
*
* @return ProcessInterface
*/
public function getProcess();
/**
* Get Process of the flow.
*
* @return ProcessInterface
*/
public function setProcess(ProcessInterface $process);
/**
* @return FlowNodeInterface
*/
public function getSource();
/**
* @param FlowNodeInterface $source
*
* @return $this
*/
public function setSource(FlowNodeInterface $source);
/**
* @return FlowNodeInterface
*/
public function getTarget();
/**
* @param FlowNodeInterface $target
*
* @return $this
*/
public function setTarget(FlowNodeInterface $target);
/**
* @return bool
*/
public function hasCondition();
/**
* @return callable
*/
public function getCondition();
/**
* @return bool
*/
public function isDefault();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ArtifactCollectionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ArtifactCollectionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Collection of artifacts.
*/
interface ArtifactCollectionInterface extends CollectionInterface
{
/**
* Add an element to the collection.
*
* @param ArtifactInterface $element
*
* @return $this
*/
public function add(ArtifactInterface $element);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/CancelInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/CancelInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* CancelInterface for the CancelEventDefinition.
*/
interface CancelInterface extends EntityInterface
{
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DiagramCollectionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DiagramCollectionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Collection of process diagrams.
*/
interface DiagramCollectionInterface extends CollectionInterface
{
/**
* Add an element to the collection.
*
* @param DiagramInterface $element
*
* @return $this
*/
public function add(DiagramInterface $element);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/CollaborationInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/CollaborationInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* A collaboration is a collection of participants and the messages they exchange.
*/
interface CollaborationInterface extends EntityInterface
{
const BPMN_PROPERTY_PARTICIPANT = 'participant';
const BPMN_PROPERTY_MESSAGE_FLOW = 'messageFlow';
const BPMN_PROPERTY_MESSAGE_FLOWS = 'messageFlows';
/**
* Get a boolean value specifying whether Message Flows not modeled in the
* Collaboration can occur when the Collaboration is carried out.
*
* @return bool
*/
public function isClosed();
/**
* Set a boolean value specifying whether Message Flows not modeled in the
* Collaboration can occur when the Collaboration is carried out.
*
* @param bool $isClosed
*
* @return $this
*/
public function setClosed($isClosed);
/**
* @return ParticipantInterface[]
*/
public function getParticipants();
/**
* @return CorrelationKeyInterface[]
*/
public function getCorrelationKeys();
/**
* @return MessageFlowInterface[]
*/
public function getMessageFlows();
/**
* Add a message flow to the collaboration.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\MessageFlowInterface $messageFlow
*/
public function addMessageFlow(MessageFlowInterface $messageFlow);
/**
* Set the message flows collection.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface $messageFlows
*/
public function setMessageFlows(CollectionInterface $messageFlows);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/AssignmentInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/AssignmentInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Assignment interface.
*/
interface AssignmentInterface extends EntityInterface
{
const BPMN_PROPERTY_FROM = 'from';
const BPMN_PROPERTY_TO = 'to';
/**
* @return FormalExpressionInterface
*/
public function getFrom();
/**
* @return FormalExpressionInterface
*/
public function getTo();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DataInputAssociationInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DataInputAssociationInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* DataInputAssociation interface.
*/
interface DataInputAssociationInterface extends DataAssociationInterface
{
const BPMN_PROPERTY_ASSIGNMENT = 'assignment';
const BPMN_PROPERTY_SOURCES_REF = 'sourceRef';
const BPMN_PROPERTY_TARGET_REF = 'targetRef';
const BPMN_PROPERTY_TRANSFORMATION = 'transformation';
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ArtifactInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ArtifactInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Artifact interface.
*/
interface ArtifactInterface extends EntityInterface
{
/**
* Type of element.
*/
const TYPE = 'bpmnArtifact';
const TYPE_HORIZONTAL_LINE = 'HORIZONTAL_LINE';
const TYPE_VERTICAL_LINE = 'VERTICAL_LINE';
const TYPE_TEXT_ANNOTATION = 'TEXT_ANNOTATION';
/**
* Properties.
*/
const PROPERTIES = [
'ART_UID' => '',
'PRO_ID' => null,
'ART_TYPE' => null,
'ART_NAME' => null,
'ART_CATEGORY_REF' => null,
];
/**
* Child elements.
*/
const ELEMENTS = [
];
/**
* Get Process of the artifact.
*
* @return ProcessInterface
*/
public function getProcess();
/**
* Get Process of the artifact.
*
* @return ProcessInterface
*/
public function setProcess(ProcessInterface $process);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/FlowCollectionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/FlowCollectionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Collection of flows.
*/
interface FlowCollectionInterface extends CollectionInterface
{
/**
* Add an element to the collection.
*
* @param FlowInterface $element
*
* @return $this
*/
public function add(FlowInterface $element);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ThrowEventInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ThrowEventInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* ThrowEvent interface.
*/
interface ThrowEventInterface extends EventInterface
{
/**
* Events defined for the the throw event interface
*/
const EVENT_THROW_TOKEN_ARRIVES = 'ThrowEventTokenArrives';
const EVENT_THROW_EXCEPTION = 'ThrowEventException';
const EVENT_THROW_TOKEN_PASSED = 'ThrowEventTokenPassed';
const EVENT_THROW_TOKEN_CONSUMED = 'ThrowEventTokenConsumed';
const BPMN_PROPERTY_DATA_INPUT = 'dataInput';
const BPMN_PROPERTY_DATA_INPUT_SET = 'inputSet';
const BPMN_PROPERTY_DATA_INPUT_ASSOCIATION = 'dataInputAssociation';
/**
* Get Data Inputs for the throw Event.
*
* @return DataInputInterface[]
*/
public function getDataInputs();
/**
* Get Data Associations of the throw Event.
*
* @return DataInputAssociationInterface[]
*/
public function getDataInputAssociations();
/**
* Get InputSet for the throw Event.
*
* @return InputSetInterface
*/
public function getInputSet();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/LaneInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/LaneInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Lane interface.
*/
interface LaneInterface extends EntityInterface
{
const BPMN_PROPERTY_FLOW_NODE = 'flowNode';
const BPMN_PROPERTY_FLOW_NODE_REF = 'flowNodeRef';
const BPMN_PROPERTY_CHILD_LANE_SET = 'childLaneSet';
/**
* Get the name of the lane.
*
* @return string
*/
public function getName();
/**
* Get the flow nodes of the lane.
*
* @return CollectionInterface
*/
public function getFlowNodes();
/**
* Get the child lanes of the lane.
*
* @return CollectionInterface
*/
public function getChildLaneSets();
/**
* Set the name of the lane.
*
* @param string $name
*
* @return $this
*/
public function setName($name);
/**
* Set the flow nodes of the lane.
*
* @param CollectionInterface $nodes
*
* @return $this
*/
public function setFlowNodes(CollectionInterface $nodes);
/**
* Set the child lanes of the lane.
*
* @param CollectionInterface $nodes
*
* @return $this
*/
public function setChildLaneSets(CollectionInterface $nodes);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/FlowNodeInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/FlowNodeInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* Flow node define the behavior of a element that can be used as
* a source or target element in a flow.
*/
interface FlowNodeInterface extends FlowElementInterface
{
const BPMN_PROPERTY_INCOMING = 'incoming';
const BPMN_PROPERTY_OUTGOING = 'outgoing';
/**
* Create a flow to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface $target
* @param RepositoryInterface $factory
* @param array $properties
*
* @return $this
*
* @internal param FlowRepositoryInterface $flowRepository
*/
public function createFlowTo(self $target, RepositoryInterface $factory, $properties = []);
/**
* Get the outgoing flows.
*
* @return FlowCollectionInterface
*/
public function getFlows();
/**
* Get the incoming flows.
*
* @return FlowCollectionInterface
*/
public function getIncomingFlows();
/**
* Get the outgoing flows.
*
* @return FlowCollectionInterface
*/
public function getOutgoingFlows();
/**
* Add a transition rule for the node element.
*
* @param TransitionInterface $transition
*
* @return $this
*/
public function addTransition(TransitionInterface $transition);
/**
* Get the transitions rules of the node element.
*
* @return TransitionInterface[]
*/
public function getTransitions();
/**
* Build the transition rules of the node element.
*
* @param RepositoryInterface $factory Factory that will be used to create tokens.
*
* @return $this
*/
public function buildTransitions(RepositoryInterface $factory);
/**
* Build the transition rules of the outgoing flows.
*
* @param RepositoryInterface $factory Factory that will be used to create tokens.
*
* @return $this
*/
public function buildFlowTransitions(RepositoryInterface $factory);
/**
* Add a state for the node element.
*
* @param StateInterface $state
*
* @return $this
*/
public function addState(StateInterface $state);
/**
* Get the states of the node element.
*
* @return StateInterface[]
*/
public function getStates();
/**
* Get tokens in the activity.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $instance
*
* @return CollectionInterface
*/
public function getTokens(ExecutionInstanceInterface $instance);
/**
* Load tokens from array.
*
* @param ExecutionInstanceInterface $instance
* @param TokenInterface $token
*
* @return $this
*/
public function addToken(ExecutionInstanceInterface $instance, TokenInterface $token);
/**
* Get an input to the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface|null $targetFlow
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
public function getInputPlace(FlowInterface $targetFlow = null);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/SignalEventDefinitionInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/SignalEventDefinitionInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* MessageEventDefinition interface.
*/
interface SignalEventDefinitionInterface extends EventDefinitionInterface
{
const EVENT_THROW_EVENT_DEFINITION = 'ThrowSignalEvent';
const EVENT_CATCH_EVENT_DEFINITION = 'CatchSignalEvent';
const BPMN_PROPERTY_SIGNAL = 'signal';
const BPMN_PROPERTY_SIGNAL_REF = 'signalRef';
/**
* Returns the event definition payload (message, signal, etc.)
*
* @return mixed
*/
public function getPayload();
/**
* Sets the payload (message, signal, etc.)
*
* @param mixed $value
*
* @return $this
*/
public function setPayload($value);
/**
* Check if the $eventDefinition should be catch
*
* @param EventDefinitionInterface $eventDefinition
*
* @return bool
*/
public function shouldCatchEventDefinition(EventDefinitionInterface $eventDefinition);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DatePeriodInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DatePeriodInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
use DateInterval;
use DateTimeInterface;
use Iterator;
/**
* DatePeriod represents an ISO8601 Repeating intervals
*/
interface DatePeriodInterface extends Iterator
{
/**
* Get start date time
*
* @return DateTimeInterface
*/
public function getStartDate();
/**
* Get date interval
*
* @return DateInterval
*/
public function getDateInterval();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DataAssociationInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DataAssociationInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* DataAssociation interface.
*/
interface DataAssociationInterface extends EntityInterface
{
const BPMN_PROPERTY_ASSIGNMENT = 'assignment';
const BPMN_PROPERTY_SOURCES_REF = 'sourceRef';
const BPMN_PROPERTY_TARGET_REF = 'targetRef';
const BPMN_PROPERTY_TRANSFORMATION = 'transformation';
/**
* Get the source of the data association.
*
* @return ItemAwareElementInterface
*/
public function getSource();
/**
* Get the target of the data association.
*
* @return ItemAwareElementInterface
*/
public function getTarget();
/**
* Get an optional transformation Expression.
*
* @return FormalExpressionInterface
*/
public function getTransformation();
/**
* @return AssignmentInterface[]
*/
public function getAssignments();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/ScriptTaskInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/ScriptTaskInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* Defines the interface to be used by the ScriptTasks
*/
interface ScriptTaskInterface extends ActivityInterface
{
const BPMN_PROPERTY_SCRIPT_FORMAT = 'scriptFormat';
const BPMN_PROPERTY_SCRIPT = 'script';
const EVENT_SCRIPT_TASK_ACTIVATED = 'ScriptTaskActivated';
/**
* Sets the script format of the script task
*
* @param string $scriptFormat
*/
public function setScriptFormat($scriptFormat);
/**
* Sets the script of the script task
*
* @param string $script
*/
public function setScript($script);
/**
* Returns the script format of the script task
*
* @return string
*/
public function getScriptFormat();
/**
* Returns de Script of the script task
*
* @return $string
*/
public function getScript();
/**
* Runs the ScriptTask
* @param TokenInterface $token
* @return
*/
public function runScript(TokenInterface $token);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/InputOutputSpecificationInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/InputOutputSpecificationInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* An ItemDefinition is used to define the payload of the Message.
*/
interface InputOutputSpecificationInterface extends EntityInterface
{
const BPMN_PROPERTY_DATA_INPUT = 'dataInput';
const BPMN_PROPERTY_DATA_OUTPUT = 'dataOutput';
const BPMN_PROPERTY_DATA_INPUT_SET = 'inputSet';
const BPMN_PROPERTY_DATA_OUTPUT_SET = 'outputSet';
/**
* @return DataOutputInterface[]
*/
public function getDataOutput();
/**
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface $dataOutput
*
* @return self
*/
public function setDataOutput(CollectionInterface $dataOutput);
/**
* @return DataInputInterface
*/
public function getDataInput();
/**
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface $dataInput
*
* @return self
*/
public function setDataInput(CollectionInterface $dataInput);
/**
* @return InputSetInterface
*/
public function getInputSet();
/**
* @param InputSetInterface $inputSet
* @return self
*/
public function setInputSet(InputSetInterface $inputSet);
/**
* @return OutputSetInterface
*/
public function getOutputSet();
/**
* @param OutputSetInterface $outputSet
* @return self
*/
public function setOutputSet(OutputSetInterface $outputSet);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Bpmn/DataOutputInterface.php | src/ProcessMaker/Nayra/Contracts/Bpmn/DataOutputInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Bpmn;
/**
* DataOutput interface.
*/
interface DataOutputInterface extends ItemAwareElementInterface
{
const BPMN_PROPERTY_ITEM_SUBJECT = 'itemSubject';
const BPMN_PROPERTY_ITEM_SUBJECT_REF = 'itemSubjectRef';
const BPMN_PROPERTY_IS_COLLECTION = 'isCollection';
/**
* @return bool
*/
public function isCollection();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Repositories/TokenRepositoryInterface.php | src/ProcessMaker/Nayra/Contracts/Repositories/TokenRepositoryInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Repositories;
use ProcessMaker\Nayra\Bpmn\Collection;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CatchEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventBasedGatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StartEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ThrowEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
/**
* Repository for TokenInterface
*/
interface TokenRepositoryInterface
{
/**
* Create a token instance.
*
* @return TokenInterface
*/
public function createTokenInstance();
/**
* Load a token from a persistent storage.
*
* @param string $uid
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface
*/
public function loadTokenByUid($uid);
/**
* Create or update a activity to a persistent storage.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token
* @param bool $saveChildElements
*
* @return $this
*/
public function store(TokenInterface $token, $saveChildElements = false);
/**
* Persists instance and token data when a token arrives to an activity
*
* @param ActivityInterface $activity
* @param TokenInterface $token
*
* @return mixed
*/
public function persistActivityActivated(ActivityInterface $activity, TokenInterface $token);
/**
* Persists instance and token data when a token within an activity change to error state
*
* @param ActivityInterface $activity
* @param TokenInterface $token
*
* @return mixed
*/
public function persistActivityException(ActivityInterface $activity, TokenInterface $token);
/**
* Persists instance and token data when a token is completed within an activity
*
* @param ActivityInterface $activity
* @param TokenInterface $token
*
* @return mixed
*/
public function persistActivityCompleted(ActivityInterface $activity, TokenInterface $token);
/**
* Persists instance and token data when a token is closed by an activity
*
* @param ActivityInterface $activity
* @param TokenInterface $token
*
* @return mixed
*/
public function persistActivityClosed(ActivityInterface $activity, TokenInterface $token);
/**
* Persists instance and token data when a token arrives in a throw event
*
* @param ThrowEventInterface $event
* @param TokenInterface $token
*
* @return mixed
*/
public function persistThrowEventTokenArrives(ThrowEventInterface $event, TokenInterface $token);
/**
* Persists instance and token data when a token is consumed in a throw event
*
* @param ThrowEventInterface $endEvent
* @param TokenInterface $token
*
* @return mixed
*/
public function persistThrowEventTokenConsumed(ThrowEventInterface $endEvent, TokenInterface $token);
/**
* Persists instance and token data when a token is passed in a throw event
*
* @param ThrowEventInterface $endEvent
* @param TokenInterface $token
*
* @return mixed
*/
public function persistThrowEventTokenPassed(ThrowEventInterface $endEvent, TokenInterface $token);
/**
* Persists instance and token data when a token arrives in a gateway
*
* @param GatewayInterface $exclusiveGateway
* @param TokenInterface $token
*
* @return mixed
*/
public function persistGatewayTokenArrives(GatewayInterface $exclusiveGateway, TokenInterface $token);
/**
* Persists instance and token data when a token is consumed in a gateway
*
* @param GatewayInterface $exclusiveGateway
* @param TokenInterface $token
*
* @return mixed
*/
public function persistGatewayTokenConsumed(GatewayInterface $exclusiveGateway, TokenInterface $token);
/**
* Persists instance and token data when a token is passed in a gateway
*
* @param GatewayInterface $exclusiveGateway
* @param TokenInterface $token
*
* @return mixed
*/
public function persistGatewayTokenPassed(GatewayInterface $exclusiveGateway, TokenInterface $token);
/**
* Persists instance and token data when a token arrives in a catch event
*
* @param CatchEventInterface $intermediateCatchEvent
* @param TokenInterface $token
*
* @return mixed
*/
public function persistCatchEventTokenArrives(CatchEventInterface $intermediateCatchEvent, TokenInterface $token);
/**
* Persists instance and token data when a token is consumed in a catch event
*
* @param CatchEventInterface $intermediateCatchEvent
* @param TokenInterface $token
*
* @return mixed
*/
public function persistCatchEventTokenConsumed(CatchEventInterface $intermediateCatchEvent, TokenInterface $token);
/**
* Persists instance and token data when a token is passed in a catch event
*
* @param CatchEventInterface $intermediateCatchEvent
* @param Collection $consumedTokens
*
* @return mixed
*/
public function persistCatchEventTokenPassed(CatchEventInterface $intermediateCatchEvent, Collection $consumedTokens);
/**
* Persists instance and token data when a message arrives to a catch event
*
* @param CatchEventInterface $intermediateCatchEvent
* @param TokenInterface $token
*/
public function persistCatchEventMessageArrives(CatchEventInterface $intermediateCatchEvent, TokenInterface $token);
/**
* Persists instance and token data when a message is consumed in a catch event
*
* @param CatchEventInterface $intermediateCatchEvent
* @param TokenInterface $token
*/
public function persistCatchEventMessageConsumed(CatchEventInterface $intermediateCatchEvent, TokenInterface $token);
/**
* Persists tokens that triggered a Start Event
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\StartEventInterface $startEvent
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface $tokens
*
* @return mixed
*/
public function persistStartEventTriggered(StartEventInterface $startEvent, CollectionInterface $tokens);
/**
* Persists instance and token data when a token is consumed in a event based gateway
*
* @param EventBasedGatewayInterface $eventBasedGateway
* @param TokenInterface $passedToken
* @param CollectionInterface $consumedTokens
*
* @return mixed
*/
public function persistEventBasedGatewayActivated(EventBasedGatewayInterface $eventBasedGateway, TokenInterface $passedToken, CollectionInterface $consumedTokens);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Repositories/ExecutionInstanceRepositoryInterface.php | src/ProcessMaker/Nayra/Contracts/Repositories/ExecutionInstanceRepositoryInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Repositories;
use ProcessMaker\Nayra\Contracts\Bpmn\ParticipantInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Repository for ExecutionInstanceInterface
*/
interface ExecutionInstanceRepositoryInterface
{
/**
* Load an execution instance from a persistent storage.
*
* @param string $uid
* @param StorageInterface $storage
*
* @return \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface
*/
public function loadExecutionInstanceByUid($uid, StorageInterface $storage);
/**
* Creates an execution instance.
*
* @return \ProcessMaker\Test\Models\ExecutionInstance
*/
public function createExecutionInstance();
/**
* Persists instance's data related to the event Process Instance Created
*
* @param ExecutionInstanceInterface $instance
*
* @return mixed
*/
public function persistInstanceCreated(ExecutionInstanceInterface $instance);
/**
* Persists instance's data related to the event Process Instance Completed
*
* @param ExecutionInstanceInterface $instance
*
* @return mixed
*/
public function persistInstanceCompleted(ExecutionInstanceInterface $instance);
/**
* Persists collaboration between two instances.
*
* @param ExecutionInstanceInterface $target Target instance
* @param ParticipantInterface $targetParticipant Participant related to the target instance
* @param ExecutionInstanceInterface $source Source instance
* @param ParticipantInterface $sourceParticipant
*/
public function persistInstanceCollaboration(ExecutionInstanceInterface $target, ParticipantInterface $targetParticipant, ExecutionInstanceInterface $source, ParticipantInterface $sourceParticipant);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Repositories/StorageInterface.php | src/ProcessMaker/Nayra/Contracts/Repositories/StorageInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Repositories;
use ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface;
use ProcessMaker\Nayra\Contracts\Engine\EngineInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* RepositoryFactory
*/
interface StorageInterface
{
/**
* Set the factory used to create BPMN elements.
*
* @param RepositoryInterface $factory
*/
public function setFactory(RepositoryInterface $factory);
/**
* Get the factory used to create BPMN elements.
*
* @return \ProcessMaker\Nayra\Contracts\FactoryInterface
*/
public function getFactory();
/**
* Get the document engine.
*
* @return \ProcessMaker\Nayra\Contracts\Engine\EngineInterface
*/
public function getEngine();
/**
* Set the document engine.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\EngineInterface|null $engine
*
* @return $this
*/
public function setEngine(EngineInterface $engine = null);
/**
* Get the BPMN elements mapping.
*
* @return array
*/
public function getBpmnElementsMapping();
/**
* Set a BPMN element mapping.
*
* @param string $namespace
* @param string $tagName
* @param mixed $mapping
*
* @return $this
*/
public function setBpmnElementMapping($namespace, $tagName, $mapping);
/**
* Find a element by id.
*
* @param string $id
*
* @return BpmnElement
*/
public function findElementById($id);
/**
* Index a BPMN element by id.
*
* @param string $id
* @param EntityInterface $bpmn
*/
public function indexBpmnElement($id, EntityInterface $bpmn);
/**
* Verify if the BPMN element identified by id was previously loaded.
*
* @param string $id
*
* @return bool
*/
public function hasBpmnInstance($id);
/**
* Get a BPMN element by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface
*/
public function getElementInstanceById($id);
/**
* Get Activity instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface
*/
public function getActivity($id);
/**
* Get CallActivity instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\CallActivityInterface
*/
public function getCallActivity($id);
/**
* Get CallableElement instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\CallableElementInterface
*/
public function getCallableElement($id);
/**
* Get CatchEvent instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\CatchEventInterface
*/
public function getCatchEvent($id);
/**
* Get Collaboration instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\CollaborationInterface
*/
public function getCollaboration($id);
/**
* Get DataInput instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\DataInputInterface
*/
public function getDataInput($id);
/**
* Get DataOutput instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\DataOutputInterface
*/
public function getDataOutput($id);
/**
* Get DataStore instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\DataStoreInterface
*/
public function getDataStore($id);
/**
* Get EndEvent instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\EndEventInterface
*/
public function getEndEvent($id);
/**
* Get ErrorEventDefinition instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ErrorEventDefinitionInterface
*/
public function getErrorEventDefinition($id);
/**
* Get Error instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ErrorInterface
*/
public function getError($id);
/**
* Get EventDefinition instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\EventDefinitionInterface
*/
public function getEventDefinition($id);
/**
* Get EventBasedGateway instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\EventBasedGatewayInterface
*/
public function getEventBasedGateway($id);
/**
* Get Event instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\EventInterface
*/
public function getEvent($id);
/**
* Get ExclusiveGateway instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ExclusiveGatewayInterface
*/
public function getExclusiveGateway($id);
/**
* Get FlowElement instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FlowElementInterface
*/
public function getFlowElement($id);
/**
* Get Flow instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface
*/
public function getFlow($id);
/**
* Get FlowNode instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface
*/
public function getFlowNode($id);
/**
* Get FormalExpression instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface
*/
public function getFormalExpression($id);
/**
* Get Gateway instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface
*/
public function getGateway($id);
/**
* Get InclusiveGateway instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\InclusiveGatewayInterface
*/
public function getInclusiveGateway($id);
/**
* Get InputSet instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\InputSetInterface
*/
public function getInputSet($id);
/**
* Get IntermediateCatchEvent instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\IntermediateCatchEventInterface
*/
public function getIntermediateCatchEvent($id);
/**
* Get IntermediateThrowEvent instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\IntermediateThrowEventInterface
*/
public function getIntermediateThrowEvent($id);
/**
* Get Lane instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\LaneInterface
*/
public function getLane($id);
/**
* Get LaneSet instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\LaneSetInterface
*/
public function getLaneSet($id);
/**
* Get MessageEventDefinition instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\MessageEventDefinitionInterface
*/
public function getMessageEventDefinition($id);
/**
* Get MessageFlow instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\MessageFlowInterface
*/
public function getMessageFlow($id);
/**
* Get Operation instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\OperationInterface
*/
public function getOperation($id);
/**
* Get OutputSet instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\OutputSetInterface
*/
public function getOutputSet($id);
/**
* Get ParallelGateway instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ParallelGatewayInterface
*/
public function getParallelGateway($id);
/**
* Get Participant instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ParticipantInterface
*/
public function getParticipant($id);
/**
* Get Process instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface
*/
public function getProcess($id);
/**
* Get ScriptTask instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ScriptTaskInterface
*/
public function getScriptTask($id);
/**
* Get ServiceTask instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ServiceTaskInterface
*/
public function getServiceTask($id);
/**
* Get SignalEventDefinition instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\SignalEventDefinitionInterface
*/
public function getSignalEventDefinition($id);
/**
* Get StartEvent instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\StartEventInterface
*/
public function getStartEvent($id);
/**
* Get TerminateEventDefinition instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\TerminateEventDefinitionInterface
*/
public function getTerminateEventDefinition($id);
/**
* Get ThrowEvent instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ThrowEventInterface
*/
public function getThrowEvent($id);
/**
* Get TimerEventDefinition instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\TimerEventDefinitionInterface
*/
public function getTimerEventDefinition($id);
/**
* Get ConditionalEventDefinition instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ConditionalEventDefinitionInterface
*/
public function getConditionalEventDefinition($id);
/**
* Get BoundaryEvent instance by id.
*
* @param string $id
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface
*/
public function getBoundaryEvent($id);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Engine/ExecutionInstanceInterface.php | src/ProcessMaker/Nayra/Contracts/Engine/ExecutionInstanceInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Engine;
use ProcessMaker\Nayra\Contracts\Bpmn\DataStoreInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
/**
* Execution instance for the engine.
*/
interface ExecutionInstanceInterface extends EntityInterface
{
/**
* Get the process executed.
*
* @return ProcessInterface
*/
public function getProcess();
/**
* Get the data context.
*
* @return DataStoreInterface
*/
public function getDataStore();
/**
* Get transitions.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface[]
*/
public function getTransitions();
/**
* Close the execution instance.
*
* @return bool
*/
public function close();
/**
* Add a token to the current instance.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token
*
* @return $this
*/
public function addToken(TokenInterface $token);
/**
* Remove a token to the current instance.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token
*
* @return $this
*/
public function removeToken(TokenInterface $token);
/**
* Get all tokens from the current instance.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface
*/
public function getTokens();
/**
* Link the instance to a engine, process and data store.
*
* @param EngineInterface $engine
* @param ProcessInterface $process
* @param DataStoreInterface $data
*/
public function linkTo(EngineInterface $engine, ProcessInterface $process, DataStoreInterface $data);
/**
* Set the process executed.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface $process
*
* @return $this
*/
public function setProcess(ProcessInterface $process);
/**
* Set the data context.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\DataStoreInterface $dataStore
*
* @return $this
*/
public function setDataStore(DataStoreInterface $dataStore);
/**
* Link the instance to an engine.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\EngineInterface $engine
*
* @return $this
*/
public function linkToEngine(EngineInterface $engine);
/**
* Get the engine.
*
* @return EngineInterface
*/
public function getEngine();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Engine/JobManagerInterface.php | src/ProcessMaker/Nayra/Contracts/Engine/JobManagerInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Engine;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowElementInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TimerEventDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
/**
* Job manager required for scheduling timer events.
*
* This interface also defines the different types of schedules that a timer
* event could use.
*/
interface JobManagerInterface
{
const EVENT_SCHEDULE_DATE = 'ScheduleDate';
const EVENT_SCHEDULE_CYCLE = 'ScheduleCycle';
const EVENT_SCHEDULE_DURATION = 'ScheduleDuration';
/**
* Schedule a job for a specific date and time for the given BPMN element,
* event definition and an optional Token object
*
* @param string $datetime in ISO-8601 format
* @param TimerEventDefinitionInterface $eventDefinition
* @param FlowElementInterface $element
* @param TokenInterface|null $token
*
* @return $this
*/
public function scheduleDate(
$datetime,
TimerEventDefinitionInterface $eventDefinition,
FlowElementInterface $element,
TokenInterface $token = null
);
/**
* Schedule a job for a specific cycle for the given BPMN element, event definition
* and an optional Token object
*
* @param string $cycle in ISO-8601 format
* @param TimerEventDefinitionInterface $eventDefinition
* @param FlowElementInterface $element
* @param TokenInterface|null $token
*/
public function scheduleCycle(
$cycle,
TimerEventDefinitionInterface $eventDefinition,
FlowElementInterface $element,
TokenInterface $token = null
);
/**
* Schedule a job execution after a time duration for the given BPMN element,
* event definition and an optional Token object
*
* @param string $duration in ISO-8601 format
* @param TimerEventDefinitionInterface $eventDefinition
* @param FlowElementInterface $element
* @param TokenInterface|null $token
*/
public function scheduleDuration(
$duration,
TimerEventDefinitionInterface $eventDefinition,
FlowElementInterface $element,
TokenInterface $token = null
);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Engine/DemoModeInterface.php | src/ProcessMaker/Nayra/Contracts/Engine/DemoModeInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Engine;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
/**
* Demo Mode interface.
*/
interface DemoModeInterface
{
/**
* Returns true if the engine is in demo mode.
*
* @return bool
*/
public function isDemoMode();
/**
* Set if the engine is in demo mode.
*
* @param bool $value
*/
public function setDemoMode(bool $value);
/**
* Retrieves the selected flow by the user in demo mode.
*
* @param GatewayInterface $gateway
*
* @return SequenceFlowInterface|null
*/
public function getSelectedDemoFlow(GatewayInterface $gateway);
/**
* Set the selected flow by the user in demo mode.
*
* @param GatewayInterface $gateway
* @param bool $value
*/
public function setSelectedDemoFlow(
GatewayInterface $gateway,
FlowInterface $selectedFlow = null
);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Engine/EngineInterface.php | src/ProcessMaker/Nayra/Contracts/Engine/EngineInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Engine;
use ProcessMaker\Nayra\Contracts\Bpmn\CollaborationInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\DataStoreInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface;
use ProcessMaker\Nayra\Contracts\EventBusInterface;
use ProcessMaker\Nayra\Contracts\Repositories\StorageInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
use ProcessMaker\Nayra\Contracts\Storage\BpmnDocumentInterface;
/**
* Engine interface.
*/
interface EngineInterface extends DemoModeInterface
{
/**
* Factory used to create the concrete bpmn classes for the engine.
*
* @param RepositoryInterface $factory
*
* @return $this
*/
public function setRepository(RepositoryInterface $factory);
/**
* @return RepositoryInterface
*/
public function getRepository();
/**
* Dispatcher of events used by the engine.
*
* @param EventBusInterface $dispatcher
*
* @return $this
*/
public function setDispatcher(EventBusInterface $dispatcher);
/**
* @return EventBusInterface
*/
public function getDispatcher();
/**
* Run to the next state.
*
* @param int $maxIterations
*
* @return bool
*/
public function runToNextState($maxIterations = 0);
/**
* Execute all the active transitions.
*
* @return bool
*/
public function step();
/**
* Load a process into the engine
*
* @param ProcessInterface $process
*
* @return $this
*/
public function loadProcess(ProcessInterface $process);
/**
* Create an execution instance of a process.
*
* @param ProcessInterface $process
* @param DataStoreInterface $data
* @param \ProcessMaker\Nayra\Contracts\Bpmn\EventInterface|null $event
*
* @return ExecutionInstanceInterface
*/
public function createExecutionInstance(ProcessInterface $process, DataStoreInterface $data, EventInterface $event = null);
/**
* Load an execution instance from the storage.
*
* @param string $id
* @param StorageInterface $storage
*
* @return ExecutionInstanceInterface
*/
public function loadExecutionInstance($id, StorageInterface $storage);
/**
* Close all the execution instances.
*
* @return bool
*/
public function closeExecutionInstances();
/**
* Get the engine data store used for global evaluations.
*
* @return DataStoreInterface
*/
public function getDataStore();
/**
* Set the engine data store used for global evaluations.
*
* @param DataStoreInterface $dataStore
*
* @return $this
*/
public function setDataStore(DataStoreInterface $dataStore);
/**
* Get the engine job manager for timer tasks and events.
*
* @return JobManagerInterface
*/
public function getJobManager();
/**
* Set the engine job manager for timer tasks and events.
*
* @param JobManagerInterface|null $jobManager
*
* @return $this
*/
public function setJobManager(JobManagerInterface $jobManager = null);
/**
* Get the event definitions bus of the engine
*
* @return EventDefinitionBusInterface
*/
public function getEventDefinitionBus();
/**
* Set a event definitions bus for the engine
*
* @param \ProcessMaker\Nayra\Contracts\Engine\EventDefinitionBusInterface $eventDefinitionBus
*
* @return EngineInterface
*/
public function setEventDefinitionBus(EventDefinitionBusInterface $eventDefinitionBus);
/**
* Load definitions into BPMN Engine
*
* @param BpmnDocumentInterface $document
*
* @return EngineInterface
*/
public function loadBpmnDocument(BpmnDocumentInterface $document);
/**
* Load a collaboration
*
* @param CollaborationInterface $collaboration
*
* @return EngineInterface
*/
public function loadCollaboration(CollaborationInterface $collaboration);
/**
* Defer the callback to be executed after the next state cycle.
*
* @param callable $callable
*
* @return EngineInterface
*/
public function nextState(callable $callable);
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Contracts/Engine/EventDefinitionBusInterface.php | src/ProcessMaker/Nayra/Contracts/Engine/EventDefinitionBusInterface.php | <?php
namespace ProcessMaker\Nayra\Contracts\Engine;
use ProcessMaker\Nayra\Contracts\Bpmn\CatchEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CollaborationInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ObservableInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
/**
* An event definition bus interface for the bpmn elements
*/
interface EventDefinitionBusInterface extends ObservableInterface
{
/**
* Dispatch an event definition
*
* @param mixed $source
* @param EventDefinitionInterface $eventDefinition
* @param TokenInterface|null $token
*
* @return void
*/
public function dispatchEventDefinition($source, EventDefinitionInterface $eventDefinition, TokenInterface $token = null);
/**
* Register a catch event
*
* @param CatchEventInterface $catchEvent
* @param EventDefinitionInterface $eventDefinition
* @param callable $callable
*
* @return void
*/
public function registerCatchEvent(CatchEventInterface $catchEvent, EventDefinitionInterface $eventDefinition, callable $callable);
/**
* Set collaboration
*
* @param CollaborationInterface $collaboration
*
* @return EventDefinitionBusInterface
*/
public function setCollaboration(CollaborationInterface $collaboration);
/**
* Get collaboration
*
* @return CollaborationInterface
*/
public function getCollaboration();
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php | src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use Exception;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ErrorEventDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\LoopCharacteristicsInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* Activity behavior's implementation.
*/
trait ActivityTrait
{
use FlowNodeTrait;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
private $activeState;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
private $interruptingEventState;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
private $interruptedState;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface
*/
private $completedTransition;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
private $failingState;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface
*/
private $exceptionTransition;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface
*/
private $closeExceptionTransition;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface
*/
private $transition;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
private $completedState;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface
*/
private $skippedTransition;
/**
* @var LoopCharacteristicsTransition
*/
private $loopTransition;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
private $caughtInterruptionState;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
private $waitInterruptState;
/**
* @var ActivityInterruptedTransition
*/
private $activityInterruptedTransition;
/**
* Build the transitions that define the element.
*
* @param RepositoryInterface $factory
*/
public function buildTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$this->activeState = new State($this, ActivityInterface::TOKEN_STATE_ACTIVE);
$this->failingState = new State($this, ActivityInterface::TOKEN_STATE_FAILING);
$this->completedState = new State($this, ActivityInterface::TOKEN_STATE_COMPLETED);
$this->interruptedState = new State($this, ActivityInterface::TOKEN_STATE_INTERRUPTED);
$this->caughtInterruptionState = new State($this, ActivityInterface::TOKEN_STATE_CAUGHT_INTERRUPTION);
$this->interruptingEventState = new State($this, ActivityInterface::TOKEN_STATE_EVENT_INTERRUPTING_EVENT);
$this->waitInterruptState = new State($this, ActivityInterface::TOKEN_STATE_WAIT_INTERRUPT);
$this->activityInterruptedTransition = new ActivityInterruptedTransition($this, true);
$this->activityInterruptedTransition->attachEvent(
TransitionInterface::EVENT_BEFORE_TRANSIT,
function ($transition, $consumedTokens) {
foreach ($consumedTokens as $token) {
$previousState = $token->getOwner()->getName();
if ($previousState !== ActivityInterface::TOKEN_STATE_EVENT_INTERRUPTING_EVENT) {
$token->setStatus(ActivityInterface::TOKEN_STATE_CLOSED);
$this->getRepository()
->getTokenRepository()
->persistActivityClosed($this, $token);
}
}
}
);
$this->activityExceptionTransition = new ActivityExceptionTransition($this, true);
$this->boundaryCaughtTransition = new BoundaryCaughtTransition($this, true);
$this->closeCanceledActivity = new UncaughtCancelTransition($this, true);
$this->boundaryExceptionTransition = new BoundaryExceptionTransition($this, true);
$this->boundaryCancelActivityTransition = new Transition($this, true);
$this->completedTransition = new ActivityCompletedTransition($this, true);
$this->cancelActiveTransition = new CancelActivityTransition($this, true);
$this->exceptionTransition = new ExceptionTransition($this, true);
$this->closeExceptionTransition = new CloseExceptionTransition($this, true);
$this->completeExceptionTransition = new CompleteExceptionTransition($this, true);
$this->transition = new DataOutputTransition($this, false);
$this->loopTransition = new LoopCharacteristicsTransition($this, false);
$this->completedState->connectTo($this->loopTransition);
$this->loopTransition->connectTo($this->activeState);
$this->skippedTransition = new SkipActivityTransition($this, false);
$this->interruptedState->connectTo($this->activityExceptionTransition);
$this->interruptedState->connectTo($this->boundaryCaughtTransition);
$this->interruptedState->connectTo($this->closeCanceledActivity);
$this->boundaryCaughtTransition->connectTo($this->caughtInterruptionState);
$this->caughtInterruptionState->connectTo($this->boundaryCancelActivityTransition);
$this->waitInterruptState->connectTo($this->boundaryCancelActivityTransition);
$this->activeState->connectTo($this->activityInterruptedTransition);
$this->completedState->connectTo($this->activityInterruptedTransition);
$this->interruptingEventState->connectTo($this->activityInterruptedTransition);
$this->activityInterruptedTransition->connectTo($this->interruptedState);
$this->activeState->connectTo($this->exceptionTransition);
$this->activeState->connectTo($this->completedTransition);
$this->activeState->connectTo($this->cancelActiveTransition);
$this->activityExceptionTransition->connectTo($this->failingState);
$this->failingState->connectTo($this->completeExceptionTransition);
$this->failingState->connectTo($this->closeExceptionTransition);
$this->failingState->connectTo($this->boundaryExceptionTransition);
$this->cancelActiveTransition->connectTo($this->interruptedState);
$this->exceptionTransition->connectTo($this->interruptedState);
$this->completedTransition->connectTo($this->completedState);
$this->completedState->connectTo($this->transition);
$this->completeExceptionTransition->connectTo($this->completedState);
$this->activeState->attachEvent(
StateInterface::EVENT_TOKEN_ARRIVED,
function (TokenInterface $token, TransitionInterface $source) {
try {
$this->getRepository()
->getTokenRepository()
->persistActivityActivated($this, $token);
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_ACTIVATED, $this, $token);
} catch (Exception $exception) {
$token->setStatus(ActivityInterface::TOKEN_STATE_FAILING);
$token->logError($exception, $this);
}
}
);
$this->failingState->attachEvent(
StateInterface::EVENT_TOKEN_ARRIVED,
function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistActivityException($this, $token);
$error = $token->getProperty(ActivityInterface::BPMN_PROPERTY_ERROR, null);
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_EXCEPTION, $this, $token, $error);
}
);
$this->completedState->attachEvent(
StateInterface::EVENT_TOKEN_ARRIVED,
function (TokenInterface $token) {
$loop = $this->getLoopCharacteristics();
if ($loop && $loop->isExecutable()) {
$loop->onTokenCompleted($token);
}
$this->getRepository()
->getTokenRepository()
->persistActivityCompleted($this, $token);
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_COMPLETED, $this, $token);
}
);
$this->closeExceptionTransition->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function ($transition, $tokens) {
$loop = $this->getLoopCharacteristics();
foreach ($tokens as $token) {
if ($loop && $loop->isExecutable() && $loop->isDataInputValid($token->getInstance(), $token)) {
$loop->onTokenTerminated($token);
}
$this->getRepository()
->getTokenRepository()
->persistActivityCompleted($this, $token);
}
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_CANCELLED, $this, $transition, $tokens);
}
);
$this->boundaryExceptionTransition->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function ($transition, $tokens) {
foreach ($tokens as $token) {
$token->setStatus(ActivityInterface::TOKEN_STATE_CLOSED);
$this->getRepository()
->getTokenRepository()
->persistActivityCompleted($this, $token);
}
}
);
$this->boundaryCancelActivityTransition->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function ($transition, $tokens) {
$boundaryEvents = $this->getBoundaryEvents();
foreach ($tokens as $token) {
foreach ($boundaryEvents as $boundaryEvent) {
$caughtEventDefinition = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_DEFINITION_CAUGHT);
$caughtEventId = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_ID);
foreach ($boundaryEvent->getEventDefinitions() as $eventDefinition) {
$payload = $eventDefinition->getPayload();
$eventDefinitionId = $payload ? $payload->getId() : null;
$hasPayloadId = !empty($caughtEventId) && !empty($eventDefinitionId);
$matchPayload = $hasPayloadId && ($caughtEventId === $eventDefinitionId);
$matchEventDefinition = !$hasPayloadId && ($caughtEventDefinition === $eventDefinition->getId());
if ($matchEventDefinition || $matchPayload) {
$boundaryEvent->notifyInternalEvent($token);
break 3;
}
}
}
}
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_CANCELLED, $this, $transition, $tokens);
}
);
$this->boundaryExceptionTransition->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function ($transition, $tokens) {
$boundaryEvents = $this->getBoundaryEvents();
foreach ($tokens as $token) {
foreach ($boundaryEvents as $boundaryEvent) {
foreach ($boundaryEvent->getEventDefinitions() as $eventDefinition) {
if ($eventDefinition instanceof ErrorEventDefinitionInterface) {
$boundaryEvent->notifyInternalEvent($token);
break 3;
}
}
}
}
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_CANCELLED, $this, $transition, $tokens);
}
);
$this->closeCanceledActivity->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function ($transition, $tokens) {
$loop = $this->getLoopCharacteristics();
foreach ($tokens as $token) {
if ($loop && $loop->isExecutable()) {
$loop->onTokenTerminated($token);
}
$token->setStatus(ActivityInterface::TOKEN_STATE_CLOSED);
$this->getRepository()
->getTokenRepository()
->persistActivityCompleted($this, $token);
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_CANCELLED, $this, $transition, $tokens);
}
}
);
$this->loopTransition->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function (TransitionInterface $transition, Collection $consumedTokens) {
if (!$this->loopTransition->shouldCloseTokens()) {
return;
}
foreach ($consumedTokens as $token) {
$token->setStatus(ActivityInterface::TOKEN_STATE_CLOSED);
$this->getRepository()
->getTokenRepository()
->persistActivityClosed($this, $token);
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_CLOSED, $this, $token);
}
}
);
}
/**
* Get an input to the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface|null $targetFlow
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface
*/
public function getInputPlace(FlowInterface $targetFlow = null)
{
$ready = new State($this, ActivityInterface::TOKEN_STATE_READY);
$ready->connectTo($this->activityInterruptedTransition);
$transition = new DataInputTransition($this, false);
$invalidDataInput = new InvalidDataInputTransition($this, false);
$ready->connectTo($transition);
$ready->connectTo($invalidDataInput);
$ready->connectTo($this->skippedTransition);
$transition->connectTo($this->activeState);
$invalidDataInput->connectTo($this->failingState);
$this->addInput($ready);
return $ready;
}
/**
* Create a connection to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface $targetFlow
*
* @return $this
*/
protected function buildConnectionTo(FlowInterface $targetFlow)
{
$target = $targetFlow->getTarget();
$place = $target->getInputPlace($targetFlow);
$this->transition->connectTo($place);
$this->transition->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function (TransitionInterface $transition, Collection $consumedTokens) {
foreach ($consumedTokens as $token) {
$token->setStatus(ActivityInterface::TOKEN_STATE_CLOSED);
$this->getRepository()
->getTokenRepository()
->persistActivityClosed($this, $token);
$this->notifyEvent(ActivityInterface::EVENT_ACTIVITY_CLOSED, $this, $token);
}
}
);
$this->skippedTransition->connectTo($place);
return $this;
}
/**
* Complete the activity instance.
*
* @param TokenInterface $token
*
* @return $this;
*/
public function complete(TokenInterface $token)
{
$token->setStatus(ActivityInterface::TOKEN_STATE_COMPLETED);
return $this;
}
/**
* Get the active state of the element
*
* @return StateInterface
*/
public function getActiveState()
{
return $this->activeState;
}
/**
* @return LoopCharacteristicsInterface
*/
public function getLoopCharacteristics()
{
return $this->getProperty(ActivityInterface::BPMN_PROPERTY_LOOP_CHARACTERISTICS);
}
/**
* @param LoopCharacteristicsInterface $loopCharacteristics
*
* @return static
*/
public function setLoopCharacteristics(LoopCharacteristicsInterface $loopCharacteristics)
{
return $this->setProperty(ActivityInterface::BPMN_PROPERTY_LOOP_CHARACTERISTICS, $loopCharacteristics);
}
/**
* Get the boundary events attached to the activity
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface[]|\ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface
*/
public function getBoundaryEvents()
{
$boundaryElements = [];
$process = $this->getProcess();
if ($process) {
$events = $process->getEvents();
foreach ($events as $event) {
if ($event instanceof BoundaryEventInterface && $event->getAttachedTo() === $this) {
$boundaryElements[] = $event;
}
}
}
return new Collection($boundaryElements);
}
/**
* Notify an event to the element.
*
* @param TokenInterface $token
*/
public function notifyInterruptingEvent(TokenInterface $token)
{
$instance = $token->getInstance();
$properties = $token->getProperties();
unset($properties[TokenInterface::BPMN_PROPERTY_ID]);
$this->interruptingEventState->addNewToken($instance, $properties);
$this->waitInterruptState->addNewToken($instance, $properties);
return $this;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/Assignment.php | src/ProcessMaker/Nayra/Bpmn/Assignment.php | <?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);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/EndTransition.php | src/ProcessMaker/Nayra/Bpmn/EndTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition rule to consume tokens in an End Event.
*/
class EndTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Condition required at end event.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
return true;
}
/**
* Check if transition has all the required tokens to be activated
*
* @param ExecutionInstanceInterface $instance
*
* @return bool
*/
protected function hasAllRequiredTokens(ExecutionInstanceInterface $instance)
{
return $this->incoming()->count() > 0
&& $this->incoming()
->find(function ($flow) use ($instance) {
return $flow->origin()->getTokens($instance)->count() === 0;
})
->count() === 0;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/StandardLoopCharacteristicsTrait.php | src/ProcessMaker/Nayra/Bpmn/StandardLoopCharacteristicsTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StandardLoopCharacteristicsInterface;
/**
* Base implementation for LoopCharacteristicsInterface
*
* @implements ProcessMaker\Nayra\Contracts\Bpmn\StandardLoopCharacteristicsInterface
*/
trait StandardLoopCharacteristicsTrait
{
use LoopCharacteristicsTrait;
/**
* @return bool
*/
public function getTestBefore()
{
return $this->getProperty(StandardLoopCharacteristicsInterface::BPMN_PROPERTY_TEST_BEFORE);
}
/**
* @param bool $testBefore
*
*
* @return static
*/
public function setTestBefore(bool $testBefore)
{
return $this->setProperty(StandardLoopCharacteristicsInterface::BPMN_PROPERTY_TEST_BEFORE, $testBefore);
}
/**
* @return string
*/
public function getLoopMaximum()
{
return $this->getProperty(StandardLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_MAXIMUM);
}
/**
* @param string $loopMaximum
*
* @return static
*/
public function setLoopMaximum(string $loopMaximum)
{
return $this->setProperty(StandardLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_MAXIMUM, $loopMaximum);
}
/**
* @return FormalExpressionInterface
*/
public function getLoopCondition()
{
return $this->getProperty(StandardLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_CONDITION);
}
/**
* @param FormalExpressionInterface $loopCondition
*
* @return static
*/
public function setLoopCondition(FormalExpressionInterface $loopCondition)
{
return $this->setProperty(StandardLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_CONDITION, $loopCondition);
}
/**
* Should close tokens after each loop?
*
* @return bool
*/
public function shouldCloseTokensEachLoop()
{
return true;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/Collection.php | src/ProcessMaker/Nayra/Bpmn/Collection.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
/**
* Collection of elements
*/
class Collection implements CollectionInterface
{
/**
* Items of the collection.
*
* @var array
*/
private $items = [];
/**
* Index of the iterator.
*
* @var int
*/
private $index = 0;
/**
* Collection constructor.
*
* @param array $items
*/
public function __construct($items = [])
{
$this->items = $items;
}
/**
* Count the elements of the collection.
*
* @return int
*/
public function count()
{
return count($this->items);
}
/**
* Find elements of the collection that match the $condition.
*
* @param callable $condition
*
* @return CollectionInterface Filtered collection
*/
public function find($condition)
{
return new self(array_values(array_filter($this->items, $condition)));
}
/**
* Find first element of the collection that match the $condition.
*
* @param callable $condition
*
* @return mixed
*/
public function findFirst(callable $condition)
{
return current(array_filter($this->items, $condition));
}
/**
* Add an element to the collection.
*
* @param mixed $item
*/
public function push($item)
{
$this->items[] = $item;
}
/**
* Pop an element from the collection.
*
* @return mixed
*/
public function pop()
{
return array_pop($this->items);
}
/**
* Unshift element.
*
* @param mixed $item
*
* @return mixed Unshift element
*/
public function unshift($item)
{
return array_unshift($this->items, $item);
}
/**
* Get the index of the element in the collection.
*
* @param mixed $item
*
* @return int
*/
public function indexOf($item)
{
return array_search($item, $this->items, true);
}
/**
* Sum the $callback result for each element.
*
* @param callable $callback
*
* @return float
*/
public function sum(callable $callback)
{
return array_reduce(
$this->items,
function ($carry, $item) use ($callback) {
return $carry + $callback($item);
}
);
}
/**
* Get a item by index
*
* @param int $index
*
* @return mixed
*/
public function item($index)
{
return $this->items[$index];
}
/**
* Remove a portion of the collection and replace it with something else.
*
* @param int $offset
* @param mixed $length
* @param mixed $replacement
* @return array
*/
public function splice($offset, $length = null, $replacement = null)
{
return array_splice($this->items, $offset, $length, $replacement);
}
/**
* Return the current element
*
* @return mixed Can return any type.
*/
public function current()
{
return $this->item($this->index);
}
/**
* Move forward to next element
*
* @return void Any returned value is ignored.
*/
public function next()
{
$this->index++;
}
/**
* Return the key of the current element
*
* @return mixed scalar on success, or null on failure.
*/
public function key()
{
return $this->index;
}
/**
* Checks if current position is valid
*
* @return bool The return value will be casted to boolean and then evaluated.
* Returns true on success or false on failure.
*/
public function valid()
{
return isset($this->items[$this->index]);
}
/**
* Rewind the Iterator to the first element
*
* @return void Any returned value is ignored.
*/
public function rewind()
{
$this->index = 0;
}
/**
* Seeks to a position
*
* @param int $index The position to seek to.
*
* @return void
*/
public function seek($index)
{
$this->index = $index;
}
/**
* Converts the collection to an array
*
* @return array
*/
public function toArray()
{
return $this->items;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ConditionedGatewayTrait.php | src/ProcessMaker/Nayra/Bpmn/ConditionedGatewayTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ConditionedTransitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* Base behavior for gateway elements.
*/
trait ConditionedGatewayTrait
{
use FlowNodeTrait;
/**
* Transitions that verify the conditions of the gateway.
*
* @var Collection
*/
private $conditionedTransitions;
/**
* Default transition associated to the gateway.
*
* @var TransitionInterface
*/
private $defaultTransition;
/**
* Concrete gateway class should implement the logic of the
* connection to other nodes.
*
* @param FlowInterface $target
* @param callable $condition
* @param bool $default
*
* @return $this
*/
abstract protected function buildConditionedConnectionTo(
FlowInterface $target,
callable $condition,
$default = false
);
/**
* Initialize the ConditionedGatewayTrait.
*/
protected function initConditionedGatewayTrait()
{
$this->conditionedTransitions = new Collection;
}
/**
* Add and output conditioned transition.
*
* @param ConditionedTransitionInterface $transition
* @param callable $condition
*
* @return ConditionedTransitionInterface
*/
protected function conditionedTransition(
ConditionedTransitionInterface $transition,
callable $condition
) {
$transition->setCondition($condition);
$this->conditionedTransitions->push($transition);
return $transition;
}
/**
* Add the default output transition.
*
* @param TransitionInterface $transition
*
* @return TransitionInterface
*/
protected function setDefaultTransition(TransitionInterface $transition)
{
$this->defaultTransition = $transition;
return $transition;
}
/**
* Overrides the build of flow transitions, to accept gateway
* conditioned transitions.
*
* @param RepositoryInterface $factory
*/
public function buildFlowTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$flows = $this->getFlows();
$defaultFlow = $this->getProperty(GatewayInterface::BPMN_PROPERTY_DEFAULT);
foreach ($flows as $flow) {
$isDefault = $defaultFlow === $flow;
if ($isDefault || $flow->hasCondition()) {
$this->buildConditionedConnectionTo($flow, $flow->getCondition(), $isDefault);
} else {
$this->buildConnectionTo($flow);
}
}
}
/**
* Returns the list of conditioned transitions of the gateway
*
* @return Collection
*/
public function getConditionedTransitions()
{
return $this->conditionedTransitions;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/EndEventTrait.php | src/ProcessMaker/Nayra/Bpmn/EndEventTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ErrorEventDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TerminateEventDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ThrowEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
use ProcessMaker\Nayra\Exceptions\InvalidSequenceFlowException;
/**
* End event behavior's implementation.
*/
trait EndEventTrait
{
use ThrowEventTrait;
/**
* Receive tokens.
*
* @var StateInterface
*/
private $endState;
/**
* Close the tokens.
*
* @var EndTransition|TerminateTransition
*/
private $transition;
/**
* Build the transitions that define the element.
*
* @param RepositoryInterface $factory
*/
public function buildTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$this->endState = new State($this, EventInterface::TOKEN_STATE_ACTIVE);
$terminate = $this->findTerminateEventDefinition();
if ($terminate) {
$this->transition = new TerminateTransition($this);
$this->transition->setEventDefinition($terminate);
} else {
$this->transition = new EndTransition($this);
}
$this->endState->connectTo($this->transition);
$this->transition->attachEvent(
TransitionInterface::EVENT_AFTER_TRANSIT,
function (TransitionInterface $transition, CollectionInterface $consumeTokens) {
$this->notifyEvent(EventInterface::EVENT_EVENT_TRIGGERED, $this, $transition, $consumeTokens);
}
);
}
/**
* Get an input to the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface|null $targetFlow
*
* @return StateInterface
*/
public function getInputPlace(FlowInterface $targetFlow = null)
{
//Create an input state
$input = new State($this);
$transition = new Transition($this, false);
$input->connectTo($transition);
$transition->connectTo($this->endState);
$this->addInput($input);
//if the element has event definition and those event definition have a payload we notify them
//of the triggered event
$this->endState->attachEvent(State::EVENT_TOKEN_ARRIVED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistThrowEventTokenArrives($this, $token);
$this->notifyEvent(ThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, $this, $token);
foreach ($this->getEventDefinitions() as $eventDefinition) {
$eventDefinitionClass = get_class($eventDefinition);
$payload = method_exists($eventDefinition, 'getPayload') ? $eventDefinition->getPayload() : null;
$this->notifyEvent($eventDefinitionClass::EVENT_THROW_EVENT_DEFINITION, $this, $token, $payload);
$this->getProcess()->getEngine()->getEventDefinitionBus()->dispatchEventDefinition($this, $eventDefinition, $token);
}
});
$this->endState->attachEvent(State::EVENT_TOKEN_CONSUMED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistThrowEventTokenConsumed($this, $token);
$this->notifyEvent(ThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, $this, $token);
});
return $input;
}
/**
* Create a connection to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface $targetFlow
*
* @return $this
*/
protected function buildConnectionTo(FlowInterface $targetFlow)
{
throw new InvalidSequenceFlowException('An end event cannot have outgoing flows.');
}
/**
* Find a TerminateEventDefinition whit in the event definitions
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\EventDefinitionInterface|null
*/
private function findTerminateEventDefinition()
{
foreach ($this->getEventDefinitions() as $eventDefinition) {
if ($eventDefinition instanceof TerminateEventDefinitionInterface
|| $eventDefinition instanceof ErrorEventDefinitionInterface) {
return $eventDefinition;
}
}
return null;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/Connection.php | src/ProcessMaker/Nayra/Bpmn/Connection.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ConnectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ConnectionNodeInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
/**
* Class that connect States and Transitions.
*/
class Connection implements ConnectionInterface
{
/**
* Origin node of the connection.
*
* @var \ProcessMaker\Nayra\Contracts\Bpmn\ConnectionNodeInterface
*/
protected $origin;
/**
* Target node of the connection.
*
* @var \ProcessMaker\Nayra\Contracts\Bpmn\ConnectionNodeInterface
*/
protected $target;
/**
* Connection constructor.
*
* @param ConnectionNodeInterface $origin
* @param ConnectionNodeInterface $target
*/
public function __construct(ConnectionNodeInterface $origin, ConnectionNodeInterface $target)
{
$this->origin = $origin;
$this->target = $target;
}
/**
* Get the origin node (state or transition) of the connection.
*
* @return ConnectionNodeInterface Origin element
*/
public function origin()
{
return $this->origin;
}
/**
* Get the target node (state or transition) of the connection.
*
* @return ConnectionNodeInterface Target element
*/
public function target()
{
return $this->target;
}
/**
* Get the origin node of the connection as a state.
*
* @return StateInterface Origin element
*/
public function originState()
{
return $this->origin;
}
/**
* Get the target node of the connection as a state.
*
* @return StateInterface Target element
*/
public function targetState()
{
return $this->target;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ParallelGatewayTrait.php | src/ProcessMaker/Nayra/Bpmn/ParallelGatewayTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* Base implementation for a parallel gateway.
*/
trait ParallelGatewayTrait
{
use FlowNodeTrait;
/**
* @var TransitionInterface
*/
private $transition;
/**
* Build the transitions that define the element.
*
* @param RepositoryInterface $factory
*/
public function buildTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$this->transition = new ParallelGatewayTransition($this);
$this->transition->attachEvent(TransitionInterface::EVENT_BEFORE_TRANSIT, function () {
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_ACTIVATED, $this);
});
}
/**
* Get an input to the element.
*
* @param FlowInterface|null $targetFlow
*
* @return StateInterface
*/
public function getInputPlace(FlowInterface $targetFlow = null)
{
$incomingPlace = new State($this, GatewayInterface::TOKEN_STATE_INCOMING);
$incomingPlace->connectTo($this->transition);
$incomingPlace->attachEvent(State::EVENT_TOKEN_ARRIVED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistGatewayTokenArrives($this, $token);
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, $this, $token);
});
$incomingPlace->attachEvent(State::EVENT_TOKEN_CONSUMED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistGatewayTokenConsumed($this, $token);
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, $this, $token);
});
return $incomingPlace;
}
/**
* Create a connection to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface $targetFlow
*
* @return $this
*/
protected function buildConnectionTo(FlowInterface $targetFlow)
{
$outgoingPlace = new State($this, GatewayInterface::TOKEN_STATE_OUTGOING);
$outgoingTransition = new ParallelOutputTransition($this);
$outgoingTransition->attachEvent(
TransitionInterface::EVENT_AFTER_CONSUME,
function (TransitionInterface $transition, Collection $consumedTokens) {
foreach ($consumedTokens as $token) {
$this->getRepository()
->getTokenRepository()
->persistGatewayTokenPassed($this, $token);
}
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, $this, $transition, $consumedTokens);
}
);
$this->transition->connectTo($outgoingPlace);
$outgoingPlace->connectTo($outgoingTransition);
$outgoingTransition->connectTo($targetFlow->getTarget()->getInputPlace($targetFlow));
return $this;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ActivityInterruptedTransition.php | src/ProcessMaker/Nayra/Bpmn/ActivityInterruptedTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition rule when an activity is interrupted.
*/
class ActivityInterruptedTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Initialize transition.
*/
protected function initActivityTransition()
{
$this->setPreserveToken(true);
$this->setTokensConsumedPerIncoming(-1);
}
/**
* Condition required to transit the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
return true;
}
/**
* Merge tokens into one token.
*
* @param CollectionInterface|TokenInterface[] $consumeTokens
*
* @return TokenInterface|null
*/
protected function mergeTokens(CollectionInterface $consumeTokens)
{
$properties = [];
$chosenToken = null;
$cancelableStates = [
ActivityInterface::TOKEN_STATE_READY,
ActivityInterface::TOKEN_STATE_ACTIVE,
ActivityInterface::TOKEN_STATE_COMPLETED,
];
foreach ($consumeTokens as $token) {
$ownerName = $token->getOwner()->getName();
if (in_array($ownerName, $cancelableStates)) {
$chosenToken = $token;
}
$properties = array_merge($properties, $token->getProperties());
}
if ($chosenToken) {
$chosenToken->setProperties($properties);
}
return $chosenToken;
}
/**
* Evaluate true if an event requires to interrupt an activity (in ready, active or completed).
*
* @param ExecutionInstanceInterface $instance
*
* @return bool
*/
protected function hasAllRequiredTokens(ExecutionInstanceInterface $instance)
{
$hasInterruption = false;
$hasToken = false;
foreach ($this->incoming() as $flow) {
$origin = $flow->origin();
if ($origin->getName() === ActivityInterface::TOKEN_STATE_EVENT_INTERRUPTING_EVENT) {
$hasInterruption = $origin->getTokens($instance)->count() >= 1;
} else {
$hasToken = $hasToken || $origin->getTokens($instance)->count() >= 1;
}
}
return $hasInterruption && $hasToken;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/DefaultTransition.php | src/ProcessMaker/Nayra/Bpmn/DefaultTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Verify the condition to transit and if not accomplished the tokens are consumed.
*/
class DefaultTransition implements TransitionInterface
{
use TransitionTrait;
use ForceGatewayTransitionTrait;
/**
* Returns true if the condition of the transition is met with the DataStore of the passed execution instance
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
// If debug mode is enabled, the transition is triggered only if it is selected
if ($this->shouldDebugTriggerThisTransition($executionInstance)) {
return true;
}
// If debug mode is enabled, the transition is not triggered if it is not selected
if ($this->shouldDebugSkipThisTransition($executionInstance)) {
return false;
}
$executeDefaultTransition = true;
foreach ($this->owner->getConditionedTransitions() as $transition) {
if ($transition->assertCondition($token, $executionInstance)) {
$executeDefaultTransition = false;
break;
}
}
return $executeDefaultTransition;
}
/**
* If the condition is not met.
*
* @param ExecutionInstanceInterface $executionInstance
*
* @return bool
*/
protected function conditionIsFalse(ExecutionInstanceInterface $executionInstance)
{
$this->collect($executionInstance);
return true;
}
/**
* Consume the input tokens.
*
* @param ExecutionInstanceInterface $executionInstance
*
* @return int
*/
private function collect(ExecutionInstanceInterface $executionInstance)
{
return $this->incoming()->sum(function (Connection $flow) use ($executionInstance) {
return $flow->origin()->getTokens($executionInstance)->sum(function (TokenInterface $token) {
return $token->getOwner()->consumeToken($token) ? 1 : 0;
});
});
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/EventBasedTransition.php | src/ProcessMaker/Nayra/Bpmn/EventBasedTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CatchEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventBasedGatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowElementInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\IntermediateCatchEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Verify the condition to transit following the exclusive transition rules.
* If not accomplished the tokens are consumed.
*/
class EventBasedTransition implements TransitionInterface
{
use TransitionTrait;
/**
* @var callable
*/
private $condition;
/**
* Initialize the transition
*
* @param EventBasedGatewayInterface $owner
* @param CatchEventInterface $event
*
* @return void
*/
protected function initEventBasedTransition(EventBasedGatewayInterface $owner, CatchEventInterface $event)
{
$event->getActivationTransition()->attachEvent(TransitionInterface::EVENT_AFTER_TRANSIT, function (IntermediateCatchEventTransition $transition, CollectionInterface $passedTokens) {
$passedToken = $passedTokens->item(0);
$consumedTokens = $this->removeTokenFromConnectedEvents($transition->getOwner(), $passedToken);
$this->getOwner()->getRepository()
->getTokenRepository()
->persistEventBasedGatewayActivated($this->getOwner(), $passedToken, $consumedTokens);
$this->notifyEvent(EventBasedGatewayInterface::EVENT_CATCH_EVENT_TRIGGERED, $this, $passedToken, $consumedTokens);
});
}
/**
* Removes a token from the next events to the EventBasedGateway
*
* @return $this
*/
/**
* Removes a token from the next events to the EventBasedGateway
*
* @param FlowElementInterface $activatedEvent
* @param TokenInterface $token
*
* @return void
*/
private function removeTokenFromConnectedEvents(FlowElementInterface $activatedEvent, TokenInterface $token)
{
$consumedTokens = [];
foreach ($this->owner->getNextEventElements() as $event) {
if ($event->getId() === $activatedEvent->getId()) {
// Skip already activated event
continue;
}
$state = $event->getActiveState();
$tokens = $state->getTokens($token->getInstance())->toArray();
$token = array_shift($tokens);
if ($token) {
$token->setStatus(IntermediateCatchEventInterface::TOKEN_STATE_CLOSED);
$state->consumeToken($token);
$consumedTokens[] = $token;
}
}
return new Collection($consumedTokens);
}
/**
* Condition required to transit the element.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return mixed
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
return true;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/Transition.php | src/ProcessMaker/Nayra/Bpmn/Transition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Bpmn\TransitionTrait;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition rule that always pass the token.
*/
class Transition implements TransitionInterface
{
use TransitionTrait;
/**
* Initialize transition.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface $owner
* @param bool $preserveToken
*/
protected function initActivityTransition(FlowNodeInterface $owner, $preserveToken = true)
{
$this->setPreserveToken($preserveToken);
}
/**
* Condition required to transit the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
return true;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ParallelOutputTransition.php | src/ProcessMaker/Nayra/Bpmn/ParallelOutputTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition rule that always pass the token.
*/
class ParallelOutputTransition extends Transition implements TransitionInterface
{
use ForceGatewayTransitionTrait;
/**
* Condition required to transit the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
// If debug mode is enabled, the transition is triggered only if it is selected
if ($executionInstance && $this->shouldDebugTriggerThisTransition($executionInstance)) {
return true;
}
// If debug mode is enabled, the transition is not triggered if it is not selected
if ($executionInstance && $this->shouldDebugSkipThisTransition($executionInstance)) {
return false;
}
// By default the transition is triggered
return true;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/StateTrait.php | src/ProcessMaker/Nayra/Bpmn/StateTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Trait to implement state of a node in which tokens can be received.
*/
trait StateTrait
{
use BaseTrait,
TraversableTrait,
ObservableTrait;
/**
* Collection of tokens.
*
* @var Collection
*/
private $tokens;
/**
* State name.
*
* @var string
*/
private $name;
/**
* State index.
*
* @var int
*/
private $index;
/**
* @var FlowNodeInterface
*/
private $owner;
/**
* Initialize the state object.
*
* @param FlowNodeInterface $owner
* @param string $name
*/
protected function initState(FlowNodeInterface $owner, $name = '')
{
$this->tokens = new Collection();
$this->setRepository($owner->getRepository());
$this->setName($name);
$owner->addState($this);
$this->setOwner($owner);
}
/**
* Consume a token in the current state.
*
* @param TokenInterface $token
*
* @return bool
*/
public function consumeToken(TokenInterface $token)
{
$tokenIndex = $this->tokens->indexOf($token);
$valid = $tokenIndex !== false;
if ($valid) {
$this->tokens->splice($tokenIndex, 1);
$this->notifyEvent(StateInterface::EVENT_TOKEN_CONSUMED, $token);
$token->getInstance()->removeToken($token);
}
return $valid;
}
/**
* Add a new token instance to the state.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $instance
* @param array $properties
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface|null $source
*
* @return TokenInterface
*/
public function addNewToken(ExecutionInstanceInterface $instance = null, array $properties = [], TransitionInterface $source = null)
{
$token = $this->getRepository()->getTokenRepository()->createTokenInstance();
$token->setOwner($this);
$token->setProperties($properties);
$token->setOwner($this);
$token->setInstance($instance);
$this->getName() ? $token->setStatus($this->getName()) : '';
$token->setIndex($this->getIndex());
!$instance ?: $instance->addToken($token);
$this->tokens->push($token);
$this->notifyEvent(StateInterface::EVENT_TOKEN_ARRIVED, $token, $source);
return $token;
}
/**
* Create token for the current state.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $instance
* @param array $properties
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface|null $source
*
* @return TokenInterface
*/
public function createToken(ExecutionInstanceInterface $instance = null, array $properties = [])
{
$token = $this->getRepository()->getTokenRepository()->createTokenInstance();
$token->setOwner($this);
$token->setProperties($properties);
$token->setOwner($this);
$token->setInstance($instance);
$this->getName() ? $token->setStatus($this->getName()) : '';
$token->setIndex($this->getIndex());
return $token;
}
/**
* Add a new token instance to the state.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $instance
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token
* @param bool $skipEvents
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface|null $source
*
* @return TokenInterface
*/
public function addToken(ExecutionInstanceInterface $instance, TokenInterface $token, $skipEvents = false, TransitionInterface $source = null)
{
$token->setOwner($this);
$token->setInstance($instance);
$this->getName() ? $token->setStatus($this->getName()) : '';
$token->setIndex($this->getIndex());
$instance->addToken($token);
$this->tokens->push($token);
$skipEvents ?: $this->notifyEvent(StateInterface::EVENT_TOKEN_ARRIVED, $token, $source);
return $token;
}
/**
* Collection of tokens.
*
* @param ExecutionInstanceInterface|null $instance
*
* @return CollectionInterface
*/
public function getTokens(ExecutionInstanceInterface $instance = null)
{
return $this->tokens->find(function (TokenInterface $token) use ($instance) {
return $token->getInstance() === $instance;
});
}
/**
* Get state name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set state name.
*
* @param string $name
*
* @return $this
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get state index
*
* @return int
*/
public function getIndex()
{
return $this->index;
}
/**
* Set state name.
*
* @param int $index
*
* @return $this
*/
public function setIndex($index)
{
$this->index = $index;
return $this;
}
/**
* Set the owner node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface $owner
*
* @return $this
*/
public function setOwner(FlowNodeInterface $owner)
{
$this->owner = $owner;
return $this;
}
/**
* Get the owner node.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface
*/
public function getOwner()
{
return $this->owner;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/State.php | src/ProcessMaker/Nayra/Bpmn/State.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Bpmn\StateTrait;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
/**
* State of a node in which tokens can be received.
*/
class State implements StateInterface
{
use StateTrait;
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/IntermediateCatchEventTrait.php | src/ProcessMaker/Nayra/Bpmn/IntermediateCatchEventTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\IntermediateCatchEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* End event behavior's implementation.
*/
trait IntermediateCatchEventTrait
{
use CatchEventTrait;
/**
* Receive tokens.
*
* @var StateInterface
*/
private $endState;
/**
* Close the tokens.
*
* @var EndTransition
*/
private $transition;
private $activeState;
/**
* Build the transitions that define the element.
*
* @param RepositoryInterface $factory
*/
public function buildTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$this->activeState = new State($this, IntermediateCatchEventInterface::TOKEN_STATE_ACTIVE);
$this->transition = new IntermediateCatchEventTransition($this);
$this->activeState->connectTo($this->transition);
$this->activeState->attachEvent(State::EVENT_TOKEN_ARRIVED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistCatchEventTokenArrives($this, $token);
$this->notifyEvent(IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_ARRIVES, $this, $token);
// If there are timer event definitions, register them to send the corresponding timer events
$this->activateCatchEvent($token);
});
$this->activeState->attachEvent(State::EVENT_TOKEN_CONSUMED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistCatchEventTokenConsumed($this, $token);
$this->notifyEvent(IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_CONSUMED, $this, $token);
});
$this->transition->attachEvent(TransitionInterface::EVENT_AFTER_CONSUME, function (TransitionInterface $transition, Collection $consumedTokens) {
$this->getRepository()
->getTokenRepository()
->persistCatchEventTokenPassed($this, $consumedTokens);
$this->notifyEvent(IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_PASSED, $this);
});
$this->transition->attachEvent(
TransitionInterface::EVENT_AFTER_TRANSIT,
function (TransitionInterface $transition, CollectionInterface $consumeTokens) {
$this->notifyEvent(EventInterface::EVENT_EVENT_TRIGGERED, $this, $transition, $consumeTokens);
}
);
$this->buildEventDefinitionsTransitions(
IntermediateCatchEventInterface::EVENT_CATCH_MESSAGE_CATCH,
IntermediateCatchEventInterface::EVENT_CATCH_MESSAGE_CONSUMED
);
}
/**
* Get an input to the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface|null $targetFlow
*
* @return StateInterface
*/
public function getInputPlace(FlowInterface $targetFlow = null)
{
$incomingPlace = new State($this);
$transition = new Transition($this, false);
$incomingPlace->connectTo($transition);
$transition->connectTo($this->activeState);
return $incomingPlace;
}
/**
* Create a connection to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface $targetFlow
*
* @return $this
*/
protected function buildConnectionTo(FlowInterface $targetFlow)
{
$this->transition->connectTo($targetFlow->getTarget()->getInputPlace($targetFlow));
return $this;
}
/**
* Get the activation transition of the element
*
* @return TransitionInterface
*/
public function getActivationTransition()
{
return $this->transition;
}
/**
* Get the active state of the element
*
* @return StateInterface
*/
public function getActiveState()
{
return $this->activeState;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/IntermediateThrowEventTransition.php | src/ProcessMaker/Nayra/Bpmn/IntermediateThrowEventTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition rule to consume tokens in an End Event.
*/
class IntermediateThrowEventTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Condition required at end event.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
return true;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/IntermediateThrowEventTrait.php | src/ProcessMaker/Nayra/Bpmn/IntermediateThrowEventTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\IntermediateThrowEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* End event behavior's implementation.
*/
trait IntermediateThrowEventTrait
{
use FlowNodeTrait;
/**
* Receive tokens.
*
* @var StateInterface
*/
private $endState;
/**
* Close the tokens.
*
* @var EndTransition
*/
private $transition;
/**
* Build the transitions that define the element.
*
* @param RepositoryInterface $factory
*/
public function buildTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$this->transition = new IntermediateThrowEventTransition($this);
$this->transition->attachEvent(TransitionInterface::EVENT_AFTER_CONSUME, function (TransitionInterface $interface, Collection $consumedTokens) {
foreach ($consumedTokens as $token) {
$this->getRepository()
->getTokenRepository()
->persistThrowEventTokenPassed($this, $token);
}
$this->notifyEvent(IntermediateThrowEventInterface::EVENT_THROW_TOKEN_PASSED, $this);
});
}
/**
* Get an input to the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface|null $targetFlow
*
* @return StateInterface
*/
public function getInputPlace(FlowInterface $targetFlow = null)
{
$incomingPlace = new State($this, GatewayInterface::TOKEN_STATE_INCOMING);
$incomingPlace->connectTo($this->transition);
$incomingPlace->attachEvent(State::EVENT_TOKEN_ARRIVED, function (TokenInterface $token) {
$this->getProcess()->getEngine()->getEventDefinitionBus()->dispatchEventDefinition($this, $this->getEventDefinitions()->item(0), $token);
$this->getRepository()
->getTokenRepository()
->persistThrowEventTokenArrives($this, $token);
$this->notifyEvent(IntermediateThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, $this, $token);
});
$incomingPlace->attachEvent(State::EVENT_TOKEN_CONSUMED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistThrowEventTokenConsumed($this, $token);
$this->notifyEvent(IntermediateThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, $this, $token);
});
return $incomingPlace;
}
/**
* Create a connection to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface $targetFlow
*
* @return $this
*/
protected function buildConnectionTo(FlowInterface $targetFlow)
{
$this->transition->connectTo($targetFlow->getTarget()->getInputPlace($targetFlow));
return $this;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/CancelActivityTransition.php | src/ProcessMaker/Nayra/Bpmn/CancelActivityTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CancelInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition rule to cancel an activity.
*/
class CancelActivityTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Initialize transition.
*/
protected function initActivityTransition()
{
$this->setPreserveToken(true);
}
/**
* Condition required to transit the element.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
return $token->getStatus() === ActivityInterface::TOKEN_STATE_CLOSED;
}
/**
* Mark token as cancel event.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token
*/
protected function onTokenTransit(TokenInterface $token)
{
$token->setProperty(TokenInterface::BPMN_PROPERTY_EVENT_TYPE, CancelInterface::class);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/BaseTrait.php | src/ProcessMaker/Nayra/Bpmn/BaseTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Repositories\StorageInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
use ProcessMaker\Nayra\Contracts\Storage\BpmnDocumentInterface;
use ProcessMaker\Nayra\Contracts\Storage\BpmnElementInterface;
use ReflectionClass;
/**
* BaseTrait
*/
trait BaseTrait
{
private $properties = [];
/**
* Factory used to build this element.
*
* @var RepositoryInterface
*/
private $repository;
/**
* BPMN document of this object.
*
* @var StorageInterface
*/
private $ownerDocument;
/**
* Bpmn Element of this object.
*
* @var BpmnElementInterface
*/
private $bpmnElement;
/**
* BaseTrait constructor.
*
* @param array ...$args
*/
public function __construct(...$args)
{
$this->bootElement($args);
}
/**
* Call the initFunctions defined in traits.
*
* @param array $args
*/
protected function bootElement(array $args)
{
$reflection = new ReflectionClass($this);
foreach ($reflection->getMethods() as $method) {
$name = $method->getName();
if (substr($name, 0, 4) === 'init') {
call_user_func_array([$this, $name], $args);
}
}
}
/**
* Get the factory used to build this element.
*
* @return \ProcessMaker\Nayra\Contracts\RepositoryInterface
*/
public function getRepository()
{
return $this->repository;
}
/**
* Set the factory used to build this element.
*
* @param \ProcessMaker\Nayra\Contracts\RepositoryInterface $repository
*
* @return $this
*/
public function setRepository(RepositoryInterface $repository)
{
$this->repository = $repository;
return $this;
}
/**
* Get the owner BPMN document of this object.
*
* @return \ProcessMaker\Nayra\Contracts\StorageInterface|BpmnDocumentInterface
*/
public function getOwnerDocument()
{
return $this->ownerDocument;
}
/**
* Set the owner BPMN document of this object.
*
* @param \ProcessMaker\Nayra\Contracts\Repositories\StorageInterface $ownerDocument
*
* @return $this
*/
public function setOwnerDocument(StorageInterface $ownerDocument)
{
$this->ownerDocument = $ownerDocument;
return $this;
}
/**
* Get DOM element of this object.
*
* @return \ProcessMaker\Nayra\Contracts\Storage\BpmnElementInterface
*/
public function getBpmnElement()
{
return $this->bpmnElement;
}
/**
* Set DOM element of this object.
*
* @param \ProcessMaker\Nayra\Contracts\Storage\BpmnElementInterface $bpmnElement
*
* @return $this
*/
public function setBpmnElement(BpmnElementInterface $bpmnElement)
{
$this->bpmnElement = $bpmnElement;
return $this;
}
/**
* Get properties.
*
* @return array
*/
public function getProperties()
{
return $this->properties;
}
/**
* Set properties.
*
* @param array $properties
* @return $this
*/
public function setProperties(array $properties)
{
foreach ($properties as $name => $value) {
$setter = 'set' . $name;
if (method_exists($this, $setter)) {
$this->$setter($value);
} else {
$this->setProperty($name, $value);
}
}
return $this;
}
/**
* Set a property.
*
* @param string $name
* @param mixed $value
*
* @return $this
*/
public function setProperty($name, $value)
{
$this->properties[$name] = $value;
return $this;
}
/**
* Get a property.
*
* @param string $name
* @param mixed $default
*
* @return mixed
*/
public function getProperty($name, $default = null)
{
return isset($this->properties[$name]) ? $this->properties[$name] : $default;
}
/**
* Add value to collection property.
*
* @param string $name
* @param mixed $value
*
* @return $this
*/
public function addProperty($name, $value)
{
$this->properties[$name] = isset($this->properties[$name]) ? $this->properties[$name] : new Collection;
$this->properties[$name]->push($value);
return $this;
}
/**
* Get Id of the element.
*
* @return mixed
*/
public function getId()
{
return $this->getProperty(static::BPMN_PROPERTY_ID);
}
/**
* Set Id of the element.
*
* @param mixed $id
*
* @return $this
*/
public function setId($id)
{
$this->setProperty(static::BPMN_PROPERTY_ID, $id);
return $this;
}
/**
* Get the name of the element.
*
* @return mixed
*/
public function getName()
{
return $this->getProperty(static::BPMN_PROPERTY_NAME);
}
/**
* Set the name of the element
*
* @param string $name
*
* @return $this
*/
public function setName($name)
{
return $this->setProperty(static::BPMN_PROPERTY_NAME, $name);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/BoundaryCaughtTransition.php | src/ProcessMaker/Nayra/Bpmn/BoundaryCaughtTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Boundary Caught Transition.
*/
class BoundaryCaughtTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Condition required to transit the element.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
$activity = $this->getOwner();
$eventType = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_TYPE);
$eventDefinitionId = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_DEFINITION_CAUGHT);
return $this->existsBoundaryFor($activity, $eventType, $eventDefinitionId);
}
/**
* Check if activity has a boundary event for the given event definition.
*
* @param ActivityInterface $activity
* @param string $eventType
* @param string $eventDefinitionId
*
* @return bool
*/
protected function existsBoundaryFor(ActivityInterface $activity, $eventType, $eventDefinitionId)
{
$catchException = $activity->getBoundaryEvents()->findFirst(function (BoundaryEventInterface $catch) use ($eventDefinitionId) {
foreach ($catch->getEventDefinitions() as $eventDefinition) {
if ($eventDefinition->getId() === $eventDefinitionId) {
return true;
}
}
});
return !empty($catchException);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/DataInputAssociation.php | src/ProcessMaker/Nayra/Bpmn/DataInputAssociation.php | <?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);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ConditionedTransition.php | src/ProcessMaker/Nayra/Bpmn/ConditionedTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ConditionedTransitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Verify the condition to transit and if not accomplished the tokens are consumed.
*/
class ConditionedTransition implements TransitionInterface, ConditionedTransitionInterface
{
use TransitionTrait;
use ForceGatewayTransitionTrait;
/**
* @var callable
*/
private $condition;
/**
* Condition required to transit the element.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return mixed
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
// If debug mode is enabled, the transition is triggered only if it is selected
if ($executionInstance && $this->shouldDebugTriggerThisTransition($executionInstance)) {
return true;
}
// If debug mode is enabled, the transition is not triggered if it is not selected
if ($executionInstance && $this->shouldDebugSkipThisTransition($executionInstance)) {
return false;
}
$condition = $this->condition;
$dataStore = $executionInstance ? $executionInstance->getDataStore()
: $this->getOwnerProcess()->getEngine()->getDataStore();
return $condition($dataStore->getData());
}
/**
* Set the transit condition.
*
* @param callable $condition
*
* @return $this
*/
public function setCondition(callable $condition)
{
$this->condition = $condition;
return $this;
}
/**
* If the condition is not met.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $executionInstance
*
* @return bool
*/
protected function conditionIsFalse(ExecutionInstanceInterface $executionInstance)
{
$this->collect($executionInstance);
return true;
}
/**
* Consume the input tokens.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $executionInstance
*/
private function collect(ExecutionInstanceInterface $executionInstance)
{
return $this->incoming()->sum(function (Connection $flow) use ($executionInstance) {
return $flow->origin()->getTokens($executionInstance)->sum(function (TokenInterface $token) {
return $token->getOwner()->consumeToken($token) ? 1 : 0;
});
});
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/UncaughtCancelTransition.php | src/ProcessMaker/Nayra/Bpmn/UncaughtCancelTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CancelInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Uncaught Cancel Transition.
*/
class UncaughtCancelTransition extends BoundaryCaughtTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Condition required to transit the element.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
$activity = $this->getOwner();
$eventType = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_TYPE);
$eventDefinitionId = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_DEFINITION_CAUGHT);
$matchType = $eventType === CancelInterface::class || is_a($eventType, CancelInterface::class);
return $matchType && !$this->existsBoundaryFor($activity, $eventType, $eventDefinitionId);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/Lane.php | src/ProcessMaker/Nayra/Bpmn/Lane.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Bpmn\Collection;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\LaneInterface;
/**
* Lane class
*/
class Lane implements LaneInterface
{
use BaseTrait;
/**
* Initialize the lane set.
*/
protected function initLane()
{
$this->setFlowNodes(new Collection);
$this->setChildLaneSets(new Collection);
}
/**
* Get the name of the lane.
*
* @return string
*/
public function getName()
{
return $this->getProperty(self::BPMN_PROPERTY_NAME);
}
/**
* Get the flow nodes of the lane.
*
* @return CollectionInterface
*/
public function getFlowNodes()
{
return $this->getProperty(self::BPMN_PROPERTY_FLOW_NODE);
}
/**
* Get the child lanes of the lane.
*
* @return CollectionInterface
*/
public function getChildLaneSets()
{
return $this->getProperty(self::BPMN_PROPERTY_CHILD_LANE_SET);
}
/**
* Set the name of the lane set.
*
* @param string $name
*
* @return $this
*/
public function setName($name)
{
return $this->setProperty(self::BPMN_PROPERTY_NAME, $name);
}
/**
* Set the flow nodes of the lane.
*
* @param CollectionInterface $nodes
*
* @return $this
*/
public function setFlowNodes(CollectionInterface $nodes)
{
return $this->setProperty(self::BPMN_PROPERTY_FLOW_NODE, $nodes);
}
/**
* Set the child lanes of the lane.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface $lanes
*
* @return $this
*/
public function setChildLaneSets(CollectionInterface $lanes)
{
return $this->setProperty(self::BPMN_PROPERTY_CHILD_LANE_SET, $lanes);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/DataOutputTransition.php | src/ProcessMaker/Nayra/Bpmn/DataOutputTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ConnectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition rule that always pass the token.
*/
class DataOutputTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Initialize the transition.
*
* @param FlowNodeInterface $owner
* @param bool $preserveToken
*/
protected function initDataOutputTransition()
{
$this->setTokensConsumedPerIncoming(-1);
}
/**
* Condition required to transit the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
$loop = $this->getOwner()->getLoopCharacteristics();
return !$loop || !$loop->isExecutable() || $loop->isLoopCompleted($executionInstance, $token);
}
/**
* Get transition owner element
*
* @return ActivityInterface
*/
public function getOwner()
{
return $this->owner;
}
/**
* Activate the next state.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\ConnectionInterface $flow
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $instance
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface $consumeTokens
* @param array $properties
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface|null $source
*
* @return TokenInterface
*/
protected function activateNextState(ConnectionInterface $flow, ExecutionInstanceInterface $instance, CollectionInterface $consumeTokens, array $properties = [], TransitionInterface $source = null)
{
$loop = $this->getOwner()->getLoopCharacteristics();
if ($loop && $loop->isExecutable()) {
$loop->mergeOutputData($consumeTokens, $instance);
}
$nextState = $flow->targetState();
$nextState->addNewToken($instance, $properties, $source);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/DataInputTransition.php | src/ProcessMaker/Nayra/Bpmn/DataInputTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ConnectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Transition to check if the activity is a loop not yet completed or a single instance
*/
class DataInputTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Condition required to transit the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
$loop = $this->getOwner()->getLoopCharacteristics();
if ($loop && $loop->isExecutable()) {
return $loop->isDataInputValid($executionInstance, $token) && !$loop->isLoopCompleted($executionInstance, $token);
}
return true;
}
/**
* Get transition owner element
*
* @return ActivityInterface
*/
public function getOwner()
{
return $this->owner;
}
/**
* Activate the next state.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\ConnectionInterface $flow
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $instance
* @param \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface $consumeTokens
* @param array $properties
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface|null $source
*
* @return TokenInterface
*/
protected function activateNextState(ConnectionInterface $flow, ExecutionInstanceInterface $instance, CollectionInterface $consumeTokens, array $properties = [], TransitionInterface $source = null)
{
$nextState = $flow->targetState();
$loop = $this->getOwner()->getLoopCharacteristics();
if ($loop && $loop->isExecutable()) {
$loop->iterateNextState($nextState, $instance, $consumeTokens, $properties, $source);
} else {
$nextState->addNewToken($instance, $properties, $source);
}
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ActivityExceptionTransition.php | src/ProcessMaker/Nayra/Bpmn/ActivityExceptionTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ErrorInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Uncaught Exception Transition.
*/
class ActivityExceptionTransition extends BoundaryCaughtTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Condition required to transit the element.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
$eventType = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_TYPE);
$matchType = $eventType === ErrorInterface::class || is_a($eventType, ErrorInterface::class);
return $matchType;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/DataOutputAssociation.php | src/ProcessMaker/Nayra/Bpmn/DataOutputAssociation.php | <?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);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/Path.php | src/ProcessMaker/Nayra/Bpmn/Path.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
/**
* Path of flows and elements.
*/
class Path
{
protected $elements;
/**
* Path constructor.
*
* @param array $elements
*/
public function __construct(array $elements)
{
$this->elements = $elements;
}
/**
* Get the elements of the path.
*
* @return array
*/
public function getElements()
{
return $this->elements;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/EventDefinitionTrait.php | src/ProcessMaker/Nayra/Bpmn/EventDefinitionTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CatchEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Engine\EngineInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Base implementation for a exclusive gateway.
*/
trait EventDefinitionTrait
{
use BaseTrait;
/**
* Register event with a catch event
*
* @param EngineInterface $engine
* @param CatchEventInterface $element
*/
public function registerWithCatchEvent(EngineInterface $engine, CatchEventInterface $element)
{
$engine->getEventDefinitionBus()->registerCatchEvent($element, $this, function (EventDefinitionInterface $eventDefinition, ExecutionInstanceInterface $instance = null, TokenInterface $token = null) use ($element) {
$element->execute($eventDefinition, $instance, $token);
});
}
/**
* Occurs when the catch event was activated
*
* @param EngineInterface $engine
* @param CatchEventInterface $element
* @param TokenInterface|null $token
*
* @return void
*/
public function catchEventActivated(EngineInterface $engine, CatchEventInterface $element, TokenInterface $token = null)
{
}
/**
* Check if the event definition should be catch
*
* @param EventDefinitionInterface $sourceEvent
*
* @return bool
*/
public function shouldCatchEventDefinition(EventDefinitionInterface $sourceEvent)
{
return true;
}
/**
* Get data contained in the event payload
*
* @param TokenInterface|null $token
* @param CatchEventInterface|null $target
*
* @return mixed
*/
public function getPayloadData(TokenInterface $token = null, CatchEventInterface $target = null)
{
return $token ? $token->getInstance()->getDataStore()->getData() : [];
}
/**
* Set do not trigger start events
*
* @param bool $value
*
* @return $this
*/
public function setDoNotTriggerStartEvents($value)
{
$this->setProperty('doNotTriggerStartEvents', $value);
return $this;
}
/**
* Get do not trigger start events value
*
* @return bool
*/
public function getDoNotTriggerStartEvents()
{
return $this->getProperty('doNotTriggerStartEvents', false);
}
/**
* Returns the event of the event definition (message, signal, etc.)
*
* @return SignalInterface|MessageInterface|ErrorInterface|mixed
*/
public function getPayload()
{
return null;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/DataStoreTrait.php | src/ProcessMaker/Nayra/Bpmn/DataStoreTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ItemDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface;
/**
* Implementation of the behavior for a data store.
*/
trait DataStoreTrait
{
use FlowElementTrait;
private $data = [];
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface
*/
private $process;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\ItemDefinitionInterface
*/
private $itemSubject;
/**
* Get owner process.
*
* @return ProcessInterface
*/
public function getOwnerProcess()
{
return $this->process;
}
/**
* Get Process of the application.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface $process
*
* @return ProcessInterface
*/
public function setOwnerProcess(ProcessInterface $process)
{
$this->process = $process;
$this->getId();
return $this;
}
/**
* Get data from store.
*
* @param string $name
* @param mixed $default
*
* @return mixed
*/
public function getData($name = null, $default = null)
{
return $name === null ? $this->data : (isset($this->data[$name]) ? $this->data[$name] : $default);
}
/**
* Set data of the store.
*
* @param array $data
*
* @return $this
*/
public function setData($data)
{
$this->data = $data;
return $this;
}
/**
* Put data to store.
*
* @param string $name
* @param mixed $data
*
* @return $this
*/
public function putData($name, $data)
{
$this->data[$name] = $data;
return $this;
}
/**
* Get the items that are stored or conveyed by the ItemAwareElement.
*
* @return ItemDefinitionInterface
*/
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;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/InclusiveGatewayTransition.php | src/ProcessMaker/Nayra/Bpmn/InclusiveGatewayTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
use ProcessMaker\Nayra\Engine\DemoModeTrait;
/**
* Transition rule for a inclusive gateway.
*/
class InclusiveGatewayTransition implements TransitionInterface
{
use TransitionTrait;
use PauseOnGatewayTransitionTrait;
/**
* Initialize the tokens consumed property, the Inclusive Gateway consumes
* a token from each incoming Sequence Flow that has a token.
*/
protected function initExclusiveGatewayTransition()
{
$this->setTokensConsumedPerTransition(-1);
$this->setTokensConsumedPerIncoming(1);
}
/**
* Always true because the conditions are not defined in the gateway, but for each
* outgoing flow transition.
*
* @param TokenInterface|null $token
* @param ExecutionInstanceInterface|null $executionInstance
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
// Execution is paused if Engine is in demo mode and the gateway choose is not selected
return !$this->shouldPauseGatewayTransition($executionInstance);
}
/**
* The Inclusive Gateway has all the required tokens if
* • At least one incoming Sequence Flow has at least one token and
* • For every directed path formed by sequence flow that
* - starts with a Sequence Flow f of the diagram that has a token,
* - ends with an incoming Sequence Flow of the inclusive gateway that has no token, and
* - does not visit the Inclusive Gateway.
* • There is also a directed path formed by Sequence Flow that - starts with f,
* - ends with an incoming Sequence Flow of the inclusive gateway that has a token, and
* - does not visit the Inclusive Gateway.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $executionInstance
*
* @return bool
*/
protected function hasAllRequiredTokens(ExecutionInstanceInterface $executionInstance)
{
if ($this->doesDemoHasAllRequiredTokens($executionInstance)) {
return true;
}
$withToken = $this->incoming()->find(function (Connection $flow) use ($executionInstance) {
return $flow->originState()->getTokens($executionInstance)->count() > 0;
});
$withoutToken = $this->incoming()->find(function (Connection $flow) use ($executionInstance) {
return $flow->originState()->getTokens($executionInstance)->count() === 0;
});
$rule1 = $withToken->count() > 0;
$rule2 = $withoutToken->find(function ($inFlow) use ($executionInstance) {
$paths = $inFlow->origin()->paths(function (Connection $flow) use ($inFlow, $executionInstance) {
return $flow !== $inFlow
&& $flow->origin() instanceof StateInterface
&& $flow->originState()->getTokens($executionInstance)->count() > 0;
}, function (Connection $flow) {
return $flow->origin() !== $this; //does not visit
});
return $paths->count() !== 0;
})->count() === 0;
$rule3 = $withToken->find(function ($inFlow) use ($executionInstance) {
return $inFlow->origin()->paths(function (Connection $flow) use ($inFlow, $executionInstance) {
return $flow !== $inFlow
&& $flow->origin() instanceof StateInterface
&& $flow->originState()->getTokens($executionInstance)->count() > 0;
}, function (Connection $flow) {
return $flow->origin() !== $this; //does not visit
})->count() !== 0;
})->count() === 0;
return $rule1 && $rule2 && $rule3;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/FlowTrait.php | src/ProcessMaker/Nayra/Bpmn/FlowTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
/**
* Flow connects to flow node elements.
*/
trait FlowTrait
{
use BaseTrait;
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/CatchEventTrait.php | src/ProcessMaker/Nayra/Bpmn/CatchEventTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\CatchEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EventDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Engine\EngineInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Implementation of the behavior for a catch event.
*
* @see CatchEventInterface
*/
trait CatchEventTrait
{
use FlowNodeTrait;
/**
* @var \ProcessMaker\Nayra\Contracts\Bpmn\StateInterface[]
*/
private $triggerPlace = [];
/**
* Initialize catch event.
*/
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);
}
/**
* Get the event definitions.
*
* @return \ProcessMaker\Nayra\Contracts\Bpmn\CollectionInterface|EventDefinitionInterface[]
*/
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.
*
* @param EngineInterface $engine
*
* @return $this
*/
public function registerCatchEvents(EngineInterface $engine)
{
foreach ($this->getEventDefinitions() as $eventDefinition) {
$eventDefinition->registerWithCatchEvent($engine, $this);
}
return $this;
}
/**
* Register catch events.
*
* @param TokenInterface|null $token
*
* @return $this
*/
private function activateCatchEvent(TokenInterface $token = null)
{
foreach ($this->getEventDefinitions() as $eventDefinition) {
$eventDefinition->catchEventActivated($this->getOwnerProcess()->getEngine(), $this, $token);
}
return $this;
}
/**
* Register the BPMN elements with the engine.
*
* @param EngineInterface $engine
*
* @return FlowElementInterface
*/
public function registerWithEngine(EngineInterface $engine)
{
$this->registerCatchEvents($engine);
return $this;
}
/**
* To implement the MessageListener interface
*
* @param EventDefinitionInterface $eventDef
* @param ExecutionInstanceInterface|null $instance
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
*
* @return $this
*/
public function execute(EventDefinitionInterface $eventDef, ExecutionInstanceInterface $instance = null, TokenInterface $token = null)
{
if ($instance !== null && $this->getActiveState()->getTokens($instance)->count() > 0) {
foreach ($this->getEventDefinitions() as $index => $eventDefinition) {
if ($eventDefinition->assertsRule($eventDef, $this, $instance, $token)) {
$event = $eventDefinition->getPayload();
$properties = [
TokenInterface::BPMN_PROPERTY_EVENT_ID => $event ? $event->getId() : null,
TokenInterface::BPMN_PROPERTY_EVENT_DEFINITION_CAUGHT => $eventDefinition->getId(),
TokenInterface::BPMN_PROPERTY_EVENT_TYPE => get_class($eventDef),
];
$this->triggerPlace[$index]->addNewToken($instance, $properties);
$eventDefinition->execute($eventDef, $this, $instance, $token);
}
}
}
return $this;
}
/**
* Get the active state of the element
*
* @return StateInterface
*/
public function getActiveState()
{
return null;
}
/**
* Build events definitions transitions
*
* @param string $catchedEventName
* @param string $consumedEventName
*
* @return void
*/
private function buildEventDefinitionsTransitions($catchedEventName, $consumedEventName)
{
$eventDefinitions = $this->getEventDefinitions();
foreach ($eventDefinitions as $index => $eventDefinition) {
$triggerPlace = new State($this, CatchEventInterface::TOKEN_STATE_EVENT_CATCH);
$triggerPlace->connectTo($this->transition);
$triggerPlace->attachEvent(State::EVENT_TOKEN_ARRIVED, function (TokenInterface $token) use ($catchedEventName) {
$this->getRepository()
->getTokenRepository()
->persistCatchEventMessageArrives($this, $token);
$this->notifyEvent($catchedEventName, $this, $token);
});
$triggerPlace->attachEvent(State::EVENT_TOKEN_CONSUMED, function (TokenInterface $token) use ($consumedEventName) {
$this->getRepository()
->getTokenRepository()
->persistCatchEventMessageConsumed($this, $token);
$this->notifyEvent($consumedEventName, $this, $token);
});
$this->triggerPlace[$index] = $triggerPlace;
}
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/ExclusiveGatewayTrait.php | src/ProcessMaker/Nayra/Bpmn/ExclusiveGatewayTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* Base implementation for a exclusive gateway.
*/
trait ExclusiveGatewayTrait
{
use ConditionedGatewayTrait;
/**
* @var TransitionInterface
*/
private $transition;
/**
* Build the transitions that define the element.
*
* @param RepositoryInterface $factory
*/
public function buildTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$this->transition = new ExclusiveGatewayTransition($this);
$this->transition->attachEvent(TransitionInterface::EVENT_BEFORE_TRANSIT, function () {
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_ACTIVATED, $this);
});
}
/**
* Get an input to the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface|null $targetFlow
*
* @return StateInterface
*/
public function getInputPlace(FlowInterface $targetFlow = null)
{
$incomingPlace = new State($this, GatewayInterface::TOKEN_STATE_INCOMING);
$incomingPlace->connectTo($this->transition);
$incomingPlace->attachEvent(State::EVENT_TOKEN_ARRIVED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistGatewayTokenArrives($this, $token);
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, $this, $token);
});
$incomingPlace->attachEvent(State::EVENT_TOKEN_CONSUMED, function (TokenInterface $token) {
$this->getRepository()
->getTokenRepository()
->persistGatewayTokenConsumed($this, $token);
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, $this, $token);
});
return $incomingPlace;
}
/**
* Create a connection to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface $targetFlow
*
* @return $this
*/
protected function buildConnectionTo(FlowInterface $targetFlow)
{
return $this->buildConditionedConnectionTo($targetFlow, function () {
return true;
}, false);
}
/**
* Add a conditioned transition for the exclusive gateway.
*
* @param FlowInterface $targetFlow
* @param callable $condition
* @param bool $default
*
* @return $this
*/
protected function buildConditionedConnectionTo(FlowInterface $targetFlow, callable $condition, $default = false)
{
$outgoingPlace = new State($this, GatewayInterface::TOKEN_STATE_OUTGOING);
if ($default) {
$outgoingTransition = $this->setDefaultTransition(new DefaultTransition($this));
} else {
$outgoingTransition = $this->conditionedTransition(
new ConditionedExclusiveTransition($this),
$condition
);
}
$outgoingTransition->attachEvent(TransitionInterface::EVENT_AFTER_CONSUME, function (TransitionInterface $transition, Collection $consumedTokens) {
foreach ($consumedTokens as $token) {
$this->getRepository()
->getTokenRepository()
->persistGatewayTokenPassed($this, $token);
}
$this->notifyEvent(GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, $this, $transition, $consumedTokens);
});
$this->transition->connectTo($outgoingPlace);
$outgoingPlace->connectTo($outgoingTransition);
$outgoingTransition->connectTo($targetFlow->getTarget()->getInputPlace($targetFlow));
return $this;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/FlowNodeTrait.php | src/ProcessMaker/Nayra/Bpmn/FlowNodeTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\GatewayInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StateInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
use ProcessMaker\Nayra\Contracts\RepositoryInterface;
/**
* Flow node define the behavior of a element that can be used as
* a source or target element in a flow.
*/
trait FlowNodeTrait
{
use FlowElementTrait, BpmnEventsTrait;
/**
* States used as input for a target node.
*
* @var StateInterface[]
*/
private $inputs = [];
/**
* Transitions that define the behavior of the node.
*
* @var TransitionInterface[]
*/
private $transitions = [];
/**
* States that define the behavior of the node.
*
* @var StateInterface[]
*/
private $states = [];
/**
* States classified by name
*
* @var array
*/
private $statesByName = [];
/**
* @var Process
*/
private $process;
/**
* Initialize flow node.
*/
protected function initFlowNode()
{
$this->setProperty(FlowNodeInterface::BPMN_PROPERTY_OUTGOING, new Collection);
$this->setProperty(FlowNodeInterface::BPMN_PROPERTY_INCOMING, new Collection);
}
/**
* Get tokens in the element.
*
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface $instance
*
* @return \ProcessMaker\Nayra\Bpmn\Collection
*/
public function getTokens(ExecutionInstanceInterface $instance)
{
$tokens = [];
foreach ($this->getStates() as $state) {
$tokens = array_merge($tokens, $state->getTokens($instance)->toArray());
}
return new Collection($tokens);
}
/**
* Add input point to the node.
*
* @param StateInterface $input
*
* @return $this
*/
protected function addInput(StateInterface $input)
{
$this->inputs[] = $input;
return $this;
}
/**
* Register a transition for the element.
*
* @param TransitionInterface $transition
*
* @return $this
*/
public function addTransition(TransitionInterface $transition)
{
$this->transitions[] = $transition;
return $this;
}
/**
* Concrete classes like Activities, Gateways, should implement a method
* that build the connections to other nodes.
*
* @param FlowInterface $targetFlow
*
* @return $this
*/
abstract protected function buildConnectionTo(FlowInterface $targetFlow);
/**
* Get the transition objects of the node.
*
* @return TransitionInterface[]
*/
public function getTransitions()
{
return $this->transitions;
}
/**
* Used by EngineInterface implementation to build the transitions
* related to connect nodes.
*
* @param \ProcessMaker\Nayra\Contracts\RepositoryInterface $factory
*/
public function buildFlowTransitions(RepositoryInterface $factory)
{
$this->setRepository($factory);
$flows = $this->getFlows();
foreach ($flows as $flow) {
$this->buildConnectionTo($flow);
}
}
/**
* Add a state for the node element.
*
* @param StateInterface $state
*
* @return $this
*/
public function addState(StateInterface $state)
{
$this->states[] = $state;
$this->statesByName[$state->getName()][] = $state;
$state->setIndex(count($this->statesByName[$state->getName()]) - 1);
return $this;
}
/**
* Get the states of the node element.
*
* @return StateInterface[]
*/
public function getStates()
{
return $this->states;
}
/**
* Get state by name and index.
*
* @param string $state
* @param string $index
*
* @return StateInterface
*/
private function getStateByName($state, $index)
{
return isset($this->statesByName[$state]) && is_array($this->statesByName[$state])
? $this->statesByName[$state][(int) $index] : null;
}
/**
* Load tokens from array.
*
* @param ExecutionInstanceInterface $instance
* @param TokenInterface $token
*
* @return $this
*/
public function addToken(ExecutionInstanceInterface $instance, TokenInterface $token)
{
$state = $this->getStateByName($token->getStatus(), $token->getIndex());
$state ? $state->addToken($instance, $token, true) : null;
return $this;
}
/**
* Create a flow to a target node.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\FlowNodeInterface $target
* @param RepositoryInterface $factory
* @param array $properties
* @return $this
* @internal param FlowRepositoryInterface $flowRepository
*/
public function createFlowTo(FlowNodeInterface $target, RepositoryInterface $factory, $properties = [])
{
$flow = $factory->createFlow();
$flow->setSource($this);
$flow->setTarget($target);
$flow->setProperties($properties);
$this->addProperty(FlowNodeInterface::BPMN_PROPERTY_OUTGOING, $flow);
$target->addProperty(FlowNodeInterface::BPMN_PROPERTY_INCOMING, $flow);
if (!empty($properties[FlowInterface::BPMN_PROPERTY_IS_DEFAULT])) {
$this->setProperty(GatewayInterface::BPMN_PROPERTY_DEFAULT, $flow);
}
return $this;
}
/**
* Get the incoming flows.
*
* @return FlowCollectionInterface
* @codeCoverageIgnore
*/
public function getIncomingFlows()
{
return $this->getProperty(FlowNodeInterface::BPMN_PROPERTY_INCOMING);
}
/**
* Get the outgoing flows.
*
* @return FlowCollectionInterface
*/
public function getOutgoingFlows()
{
return $this->getProperty(FlowNodeInterface::BPMN_PROPERTY_OUTGOING);
}
/**
* Get Process of the node.
*
* @return ProcessInterface
* @codeCoverageIgnore
*/
public function getProcess()
{
return $this->process;
}
/**
* Get Process of the node.
*
* @param ProcessInterface $process
*
* @return ProcessInterface
* @codeCoverageIgnore
*/
public function setProcess(ProcessInterface $process)
{
$this->process = $process;
return $this;
}
/**
* Get the outgoing flows.
*
* @return FlowCollectionInterface
*/
public function getFlows()
{
return $this->getProperty(FlowNodeInterface::BPMN_PROPERTY_OUTGOING);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/TraversableTrait.php | src/ProcessMaker/Nayra/Bpmn/TraversableTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ConnectionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ConnectionNodeInterface;
/**
* Implements the search of paths through elements.
*/
trait TraversableTrait
{
/**
* Collection of incoming flows.
*
* @var Collection
*/
private $incoming;
private $outgoing;
/**
* Initialize incoming/outgoing flows
*/
protected function initFlowElementBehavior()
{
$this->outgoing = new Collection;
$this->incoming = new Collection;
}
/**
* This attribute identifies the outgoing Sequence Flow of the FlowNode.
*
* @return Collection
*/
public function outgoing()
{
return $this->outgoing;
}
/**
* This attribute identifies the incoming Sequence Flow of the FlowNode.
*
* @return Collection
*/
public function incoming()
{
return $this->incoming;
}
/**
* @param ConnectionNodeInterface $target
*
* @return ConnectionInterface
*/
public function connectTo(ConnectionNodeInterface $target)
{
$flow = new Connection($this, $target);
$this->outgoing()->push($flow);
$target->incoming()->push($flow);
return $flow;
}
/**
* Find all the paths that complies with the $condition and $while.
*
* @param callable $condition
* @param callable $while
* @param array $path
* @param array $passedthru
* @param array $paths
*
* @return Collection
*/
public function paths(callable $condition, callable $while, $path = [], &$passedthru = [], &$paths = [])
{
$this->incoming()->find(function ($flow) use ($condition, $while, $path, &$passedthru, &$paths) {
if (array_search($flow, $passedthru, true) !== false) {
return;
}
$passedthru[] = $flow;
if ($condition($flow)) {
$path[] = $flow;
$paths[] = new Path($path);
} elseif ($while($flow)) {
$path[] = $flow;
$flow->origin()->paths($condition, $while, $path, $passedthru, $paths);
}
});
return new Collection($paths);
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/MultiInstanceLoopCharacteristicsTrait.php | src/ProcessMaker/Nayra/Bpmn/MultiInstanceLoopCharacteristicsTrait.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\ComplexBehaviorDefinitionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\DataInputInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\DataOutputInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FormalExpressionInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\MultiInstanceLoopCharacteristicsInterface;
/**
* Base implementation for LoopCharacteristicsInterface
*
* @implements ProcessMaker\Nayra\Contracts\Bpmn\MultiInstanceLoopCharacteristicsInterface
*/
trait MultiInstanceLoopCharacteristicsTrait
{
use LoopCharacteristicsTrait;
/**
* @return bool
*/
public function getIsSequential()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_IS_SEQUENTIAL);
}
/**
* @param bool $isSequential
*
* @return static
*/
public function setIsSequential(bool $isSequential)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_IS_SEQUENTIAL, $isSequential);
}
/**
* @return string
*/
public function getBehavior()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_BEHAVIOR);
}
/**
* @param string $behavior
*
* @return static
*/
public function setBehavior($behavior)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_BEHAVIOR, $behavior);
}
/**
* @return string
*/
public function getOneBehaviorEventRef()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_ONE_BEHAVIOR_EVENT_REF);
}
/**
* @param string $oneBehaviorEventRef
*
* @return static
*/
public function setOneBehaviorEventRef($oneBehaviorEventRef)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_ONE_BEHAVIOR_EVENT_REF, $oneBehaviorEventRef);
}
/**
* @return string
*/
public function getNoneBehaviorEventRef()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_NONE_BEHAVIOR_EVENT_REF);
}
/**
* @param string $noneBehaviorEventRef
*
* @return static
*/
public function setNoneBehaviorEventRef($noneBehaviorEventRef)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_NONE_BEHAVIOR_EVENT_REF, $noneBehaviorEventRef);
}
/**
* @return FormalExpressionInterface
*/
public function getLoopCardinality()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_CARDINALITY);
}
/**
* @param FormalExpressionInterface $loopCardinality
*
* @return static
*/
public function setLoopCardinality(FormalExpressionInterface $loopCardinality)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_CARDINALITY, $loopCardinality);
}
/**
* @return string
*/
public function getLoopDataInputRef()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_INPUT_REF);
}
/**
* @param string $loopDataInputRef
*
* @return static
*/
public function setLoopDataInputRef($loopDataInputRef)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_INPUT_REF, $loopDataInputRef);
}
/**
* @return DataInputInterface
*/
public function getLoopDataInput()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_INPUT);
}
/**
* @param DataInputInterface $loopDataInput
*
* @return static
*/
public function setLoopDataInput(DataInputInterface $loopDataInput)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_INPUT, $loopDataInput);
}
/**
* @return string
*/
public function getLoopDataOutputRef()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_OUTPUT_REF);
}
/**
* @param string $loopDataOutputRef
* @return void
*/
public function setLoopDataOutputRef($loopDataOutputRef)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_OUTPUT_REF, $loopDataOutputRef);
}
/**
* @return DataOutputInterface
*/
public function getLoopDataOutput()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_OUTPUT);
}
/**
* @param DataOutputInterface $loopDataOutput
*
* @return static
*/
public function setLoopDataOutput(DataOutputInterface $loopDataOutput)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_LOOP_DATA_OUTPUT, $loopDataOutput);
}
/**
* @return DataInputInterface
*/
public function getInputDataItem()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_INPUT_DATA_ITEM);
}
/**
* @param DataInputInterface $inputDataItem
*
* @return static
*/
public function setInputDataItem(DataInputInterface $inputDataItem)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_INPUT_DATA_ITEM, $inputDataItem);
}
/**
* @return DataOutputInterface
*/
public function getOutputDataItem()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_OUTPUT_DATA_ITEM);
}
/**
* @param DataOutputInterface $outputDataItem
*
* @return static
*/
public function setOutputDataItem(DataOutputInterface $outputDataItem)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_OUTPUT_DATA_ITEM, $outputDataItem);
}
/**
* @return \ProcessMaker\Nayra\Contracts\Bpmn\ComplexBehaviorDefinitionInterface $complexBehaviorDefinition
*/
public function getComplexBehaviorDefinition()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_COMPLEX_BEHAVIOR_DEFINITION);
}
/**
* @param \ProcessMaker\Nayra\Contracts\Bpmn\ComplexBehaviorDefinitionInterface $complexBehaviorDefinition
*
* @return static
*/
public function setComplexBehaviorDefinition(ComplexBehaviorDefinitionInterface $complexBehaviorDefinition)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_COMPLEX_BEHAVIOR_DEFINITION, $complexBehaviorDefinition);
}
/**
* @return FormalExpressionInterface
*/
public function getCompletionCondition()
{
return $this->getProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_COMPLETION_CONDITION);
}
/**
* @param FormalExpressionInterface $completionCondition
*
* @return static
*/
public function setCompletionCondition(FormalExpressionInterface $completionCondition)
{
return $this->setProperty(MultiInstanceLoopCharacteristicsInterface::BPMN_PROPERTY_COMPLETION_CONDITION, $completionCondition);
}
/**
* Should close tokens after each loop?
*
* @return bool
*/
public function shouldCloseTokensEachLoop()
{
return false;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
ProcessMaker/nayra | https://github.com/ProcessMaker/nayra/blob/19d721d6bd27f80d33288125488b244e83b6e191/src/ProcessMaker/Nayra/Bpmn/BoundaryNoInterruptActivityTransition.php | src/ProcessMaker/Nayra/Bpmn/BoundaryNoInterruptActivityTransition.php | <?php
namespace ProcessMaker\Nayra\Bpmn;
use ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
/**
* Check if Boundary does not cancel the Activity.
*/
class BoundaryNoInterruptActivityTransition implements TransitionInterface
{
use TransitionTrait;
/**
* Condition required to transit the element.
*
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance
*
* @return bool
*/
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)
{
$boundary = $this->getOwner();
$nonInterrupt = false;
if ($boundary instanceof BoundaryEventInterface) {
$nonInterrupt = !$boundary->getCancelActivity();
}
return $nonInterrupt;
}
}
| php | Apache-2.0 | 19d721d6bd27f80d33288125488b244e83b6e191 | 2026-01-05T05:04:52.897638Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.