This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zenaton\Interfaces\WorkflowInterface; | |
use Zenaton\Traits\Zenatonable; | |
use Zenaton\Tasks\Wait; | |
class NotifyEtaWorkflow implements WorkflowInterface | |
{ | |
use Zenatonable; | |
// inform user # seconds before ETA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zenaton\Interfaces\WorkflowInterface; | |
use Zenaton\Traits\Zenatonable; | |
use Zenaton\Tasks\Wait; | |
class NotifyEtaWorkflow implements WorkflowInterface | |
{ | |
use Zenatonable; | |
// inform user # seconds before ETA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zenaton\Interfaces\WorkflowInterface; | |
use Zenaton\Tasks\Wait; | |
use Zenaton\Traits\Zenatonable; | |
class RequestManagementWorkflow implements WorkflowInterface | |
{ | |
use Zenatonable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function handle() | |
{ | |
... | |
// select a set of providers for this request | |
$providers = (new SelectProvidersForRequest($this->request))->execute(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function handle() | |
{ | |
... | |
// wait for at most 3 providers quotation, 3 days maximum | |
$event = (new Wait(ProvidersQuotationGatheredEvent::class))->days(3)->execute(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function handle() | |
{ | |
... | |
// if no response received in 3 days | |
if (0 == count($this->quotations)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zenaton\Interfaces\WorkflowInterface; | |
use Zenaton\Tasks\Wait; | |
use Zenaton\Traits\Zenatonable; | |
class RequestManagementWorkflow implements WorkflowInterface | |
{ | |
use Zenatonable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Workflow, Task, Wait } = require("zenaton"); | |
// start child workflow | |
let StartChildWorkflow = Task("StartChildWorkflow", { | |
init(users, id) { | |
this.users = users; | |
this.id = id; | |
}, | |
handle: async function() { | |
await new ChildWorkflow(this.user, this.id).dispatch() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hello(name) { | |
console.log('Hello world ' + name) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hello(name) { | |
console.log('Hello world ' + name) | |
} |