Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wertmenschen/laravel-camunda
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Schöps committed Nov 25, 2019
2 parents 87ba27b + 7681670 commit d0409eb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
}
],
"require": {
"illuminate/support": "~5.5",
"guzzlehttp/guzzle": "^6.3",
"php" : "~7.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Models/DecisionDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class DecisionDefinition extends CamundaModel
{
public function evaluate($variables)
{
return $this->post('evaluate', ['json' => compact('variables')], true);
return $this->post('evaluate', ['json' => compact('variables')]);
}

public function getDefinition()
Expand Down
9 changes: 7 additions & 2 deletions src/Models/ProcessDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ public static function byKey($key)
return $processDefinition;
}

public function startInstance()
public function startInstance($data = [])
{
$processDefinition = $this->post('start');
// At least one value must be set...
if(count($data) == 0) {
$data['a'] = 'b';
}

$processDefinition = $this->post('start', $data, true);
return new ProcessInstance($processDefinition->id);
}

Expand Down
10 changes: 10 additions & 0 deletions src/Models/ProcessInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,14 @@ public function ended()
{
return $this->get('history/process-instance/?processInstanceId=' . $this->id)[0]->state == 'COMPLETED';
}

public function getEndEventId()
{
return optional(Arr::first($this->get('history/activity-instance/?processInstanceId=' . $this->id . '&activityType=noneEndEvent')))->activityId;
}

public function modify($data)
{
return $this->post('modification', $data,true);
}
}

0 comments on commit d0409eb

Please sign in to comment.