-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathCallProcess.php
More file actions
44 lines (35 loc) · 981 Bytes
/
CallProcess.php
File metadata and controls
44 lines (35 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace ProcessMaker\Jobs;
use ProcessMaker\Models\Process as Definitions;
use ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface;
class CallProcess extends BpmnAction
{
public $definitionsId;
public $processId;
public $data;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct(Definitions $definitions, ProcessInterface $process, array $data)
{
$this->definitionsId = $definitions->id;
$this->processId = $process->getId();
$this->data = $data;
}
/**
* Execute the job.
*
* @return void
*/
public function action(ProcessInterface $process)
{
//Create an initial data store for the process instance
$dataStorage = $process->getRepository()->createDataStore();
$dataStorage->setData($this->data);
//Call the process
$instance = $process->call($dataStorage);
return $instance;
}
}