Skip to content

Commit 2826bd8

Browse files
authored
Update ProcessDefinition.php
1 parent 975ae92 commit 2826bd8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Models/ProcessDefinition.php

+11-10
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22

33
namespace Wertmenschen\CamundaApi\Models;
44

5-
65
class ProcessDefinition extends CamundaModel
76
{
8-
protected $key;
9-
10-
public function startInstance()
11-
{
12-
$tenant = strlen(config('camunda.api.tenant-id')) ? '/tenant-id/' . config('camunda.api.tenant-id') : '';
13-
$processDefinition = $this->post('process-definition/key/' . $this->key . $tenant . '/start');
14-
return new ProcessInstance($processDefinition->id);
15-
}
16-
177
public static function byKey($key)
188
{
199
$processDefinition = new self;
2010
$processDefinition->key = $key;
2111
return $processDefinition;
2212
}
13+
14+
public function startInstance()
15+
{
16+
$processDefinition = $this->post('start');
17+
return new ProcessInstance($processDefinition->id);
18+
}
19+
20+
public function xml()
21+
{
22+
return $this->get('xml')->bpmn20Xml;
23+
}
2324
}

0 commit comments

Comments
 (0)