Skip to content

Commit

Permalink
Update ProcessDefinition.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wertmenschen authored Sep 12, 2018
1 parent 975ae92 commit 2826bd8
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/Models/ProcessDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

namespace Wertmenschen\CamundaApi\Models;


class ProcessDefinition extends CamundaModel
{
protected $key;

public function startInstance()
{
$tenant = strlen(config('camunda.api.tenant-id')) ? '/tenant-id/' . config('camunda.api.tenant-id') : '';
$processDefinition = $this->post('process-definition/key/' . $this->key . $tenant . '/start');
return new ProcessInstance($processDefinition->id);
}

public static function byKey($key)
{
$processDefinition = new self;
$processDefinition->key = $key;
return $processDefinition;
}

public function startInstance()
{
$processDefinition = $this->post('start');
return new ProcessInstance($processDefinition->id);
}

public function xml()
{
return $this->get('xml')->bpmn20Xml;
}
}

0 comments on commit 2826bd8

Please sign in to comment.