Skip to content

Commit

Permalink
Fix get reference to start event in call activity
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli committed Feb 4, 2020
1 parent d3695f3 commit 66dec20
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ProcessMaker/Models/CallActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
use ProcessMaker\Nayra\Bpmn\Events\ActivityCompletedEvent;
use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CallActivityInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ErrorInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\FlowInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\ErrorInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\CallableElementInterface;

/**
* Call Activity model
Expand Down Expand Up @@ -76,7 +75,7 @@ protected function callSubprocess(TokenInterface $token, FlowInterface $sequence
}
}

$startEvent = $startId ? $callable->ownerDocument->getElementInstanceById($startId) : null;
$startEvent = $startId ? $callable->getOwnerDocument()->getElementInstanceById($startId) : null;

$dataStore->setData($data);
$instance = $callable->call($dataStore, $startEvent);
Expand Down Expand Up @@ -145,7 +144,7 @@ public function getCalledElement()
$calledElementRef = $this->getProperty(CallActivityInterface::BPMN_PROPERTY_CALLED_ELEMENT);
$refs = explode('-', $calledElementRef);
if (count($refs) === 1) {
return $this->ownerDocument->getElementInstanceById($calledElementRef);
return $this->getOwnerDocument()->getElementInstanceById($calledElementRef);
} elseif (count($refs) === 2) {
// Capability to reuse other processes inside a process
$process = Process::findOrFail($refs[1]);
Expand Down

0 comments on commit 66dec20

Please sign in to comment.