Code Monkey home page Code Monkey logo

bpe's Introduction

BPE: Business Process Engine

Actions Status Hex pm

Overview

BPE is a Business Process Engine that brings BPMN to Erlang and Erlang to Enterprises. It provides infrastructure for Workflow Definitions, Process Orchestration, Rule Based Production Systems and Distributed Storage.


 iex(1)> {_,p} = :bpe.start :bpe_xml.def, []
 {:ok, '76900759556000'}
 iex(2)> :bpe.next p
 {:complete, 'either'}
 iex(3)> :bpe.next p
 {:complete, 'left'}
 iex(4)> :bpe.next p
 {:complete, 'right'}
 iex(5)> :bpe.next p
 {:complete, 'join'}
 iex(6)> :bpe.next p
 {:complete, 'join'}
 iex(7)> :bpe.next p
 {:complete, 'epilog'}
 iex(8)> :bpe.next p
 {:complete, 'finish'}
 iex(9)> :bpe.next p
 :Final
> :kvs.all '/bpe/flow/77012724426000'
 [
   {:sched, {:step, 0, '77012724426000'}, 1, ['x1']},
   {:sched, {:step, 1, '77012724426000'}, 1, ['x2', 'x3']},
   {:sched, {:step, 2, '77012724426000'}, 2, ['x4', 'x3']},
   {:sched, {:step, 3, '77012724426000'}, 1, ['x4', 'x5']},
   {:sched, {:step, 4, '77012724426000'}, 1, ['x5']},
   {:sched, {:step, 5, '77012724426000'}, 1, ['x6']},
   {:sched, {:step, 6, '77012724426000'}, 1, ['x7']},
   {:sched, {:step, 7, '77012724426000'}, 1, []}
 ]

Processes

Processes are main entities of BPE, they map one-to-one to Erlang processes. Basically, BPE process is an algorithm or function, that is executed entirely in the context of Erlang process. The arguments for such algorithms are: values from infinite streams (KVS chains); values from Erlang messages being sent to BPE process.

-record(step,  { id = 0 :: integer(), proc = "" :: list() }).

-record(role,  { id = [] :: list(), name :: binary(), tasks = [] :: term() }).

-record(sched, { id = [] :: [] | #step{},
                 prev=[] :: [] | integer(),
                 next=[] :: [] | integer(),
                 pointer = -1 :: integer(),
                 state = [] :: list(list()) }).
                 
-record(hist,         { id = [] :: [] | #step{},
                        prev=[] :: [] | integer(),
                        next=[] :: [] | integer(),
                        name=[] :: [] | binary() | list(),
                        task=[] :: [] | atom() | list() | #sequenceFlow{} | condition(),
                        docs=[] :: list(tuple()),
                        time=[] :: [] | #ts{} }).

-record(process,      { id = [] :: procId(),
                        prev=[] :: [] | integer(),
                        next=[] :: [] | integer(),
                        name=[] :: [] | binary() | string() | atom(),
                        feeds=[] :: list(),
                        roles      = [] :: term(),
                        tasks      = [] :: list(tasks()),
                        events     = [] :: list(events()),
                        flows      = [] :: list(#sequenceFlow{}),
                        docs       = [] :: list(tuple()),
                        options    = [] :: term(),
                        module     = ?DEFAULT_MODULE :: [] | atom(),
                        xml        = [] :: list(),
                        timer      = [] :: [] | reference(),
                        notifications=[] :: [] | term(),
                        result     = [] :: [] | binary(),
                        started    = [] :: [] | #ts{},
                        beginEvent = [] :: list() | atom(),
                        endEvent   = [] :: list() | atom() }).

During execution of the process, all steps are being written to the persistent storage, by which execution logic is restorable and reproducible. The process definition is actually diagram or graph where points represented by task and edges by sequenceFlow.

Tasks and Flows

The step itself is represented as task (point). The transition between steps is represented as sequenceFlow (edge).

-define(TASK,           id=[] :: list(),
                        name=[] :: list() | binary(),
                        in=[] :: list(list()),
                        out=[] :: list(list()),
                        prompt=[] :: list(tuple()),
                        roles=[] :: list(atom()),
                        etc=[] :: list({term(),term()}) ).

-record(beginEvent ,  { ?TASK }).
-record(endEvent,     { ?TASK }).
-record(task,         { ?TASK }).
-record(userTask,     { ?TASK }).
-record(serviceTask,  { ?TASK }).
-record(receiveTask,  { ?TASK, reader=[] :: #reader{} }).
-record(sendTask,     { ?TASK, writer=[] :: #writer{} }).

The history record of process execution is represented as hist and captures the sequenceFlow information.

-type condition() :: {compare,BpeDocParam :: 
                         { atom(),
                           term()},
                           Field :: integer(),
                           ConstCheckAgainst :: term()
                         }
                   | {service,atom()}.

-record(sequenceFlow, { id=[] :: list(),
                        name=[] :: list() | binary(),
                        condition=[] :: [] | condition() | binary(),
                        source=[] :: list(),
                        target=[] :: list(integer()) | list(list()) }).

Events

While Tasks are deterministic, where you're getting a new task from previous one, the Events are non-deterministic, where you could get a new task by external event from the system to the process.

-define(EVENT,          id=[] :: list() | atom(),
                        name=[] :: list() | binary(),
                        prompt=[] :: list(tuple()),
                        etc=[] :: list({term(),term()}),
                        payload=[] :: [] | binary(),
                        timeout=[] :: [] | #timeout{} ).

-define(CYCLIC,         timeDate=[] :: [] | binary(),
                        timeDuration=[] :: [] | binary(),
                        timeCycle=[] :: [] | binary() ).

-record(messageEvent, { ?EVENT }).
-record(messageBeginEvent, { ?EVENT }).
-record(boundaryEvent,{ ?EVENT, ?CYCLIC }).
-record(timeoutEvent, { ?EVENT, ?CYCLIC }).

Gateways

Gateways represent multiplexors and demultiplexors which cause non-linear trace and multiple current states as leaves of execution graph.

-type gate()   :: exclusive | parallel | inclusive | complex | event.

-record(gateway,      { ?TASK, type= parallel :: gate() }).

Full set of BPMN 2.0 fields could be obtained at http://www.omg.org/spec/BPMN/2.0, page 3-7.

Sample Session

(bpe@127.0.0.1)1> rr(bpe).
[beginEvent,container,endEvent,history,id_seq,iterator,
 messageEvent,process,sequenceFlow,serviceTask,task,userTask]
(bpe@127.0.0.1)2> bpe:start(spawnproc:def(),[]).
bpe_proc:Process 39 spawned <0.12399.0>
{ok,<0.12399.0>}
(bpe@127.0.0.1)3> bpe:complete(39).
(bpe@127.0.0.1)4> bpe:complete(39).
(bpe@127.0.0.1)5> bpe:complete(39).
(bpe@127.0.0.1)5> bpe:hist(39).
[#history{id = 28,version = undefined,container = feed,
          feed_id = {history,39},
          prev = 27,next = undefined,feeds = [],guard = true,
          etc = undefined,name = "Order11",
          task = {task,"end"}},
 #history{id = 27,version = undefined,container = feed,
          feed_id = {history,39},
          prev = 26,next = 28,feeds = [],guard = true,etc = undefined,
          name = "Order11",
          task = {task,"end2"}},
 #history{id = 26,version = undefined,container = feed,
          feed_id = {history,39},
          prev = undefined,next = 27,feeds = [],guard = true,
          etc = undefined,name = "Order11",
          task = {task,"begin"}}]

Process Instances

Instantiation of process means creating persistent context of document flow.

load(ProcName)
start(Proc,Docs)
amend(Proc,Docs)
complete(Proc)
history(ProcId)
task(Name,Proc)
doc(Name,Proc)
events(Proc)
tasks(Proc)

Using 'tasks' API you can fetch current documents attached to the given process at particular stage. Using 'amend' API you can upload or change document at current stage. 'push' API moves current stage documents further by workflow.

Let us see how we could create initial 'Wire Transfer' transaction:

> rr(bpe).
[ beginEvent,boundaryEvent,container,endEvent,history,id_seq,
  interval,iterator,kvs,log,messageEvent,operation,process,
  receiveTask,sequenceFlow,serviceTask,task,timeoutEvent,userTask ]

> rr(kvs).
[column,config,container,id_seq,interval,iterator,kvs,log,
 operation,query,schema,table,user,user2]

> Proc = bpe:load(39).

> bpe:tasks(Proc).
  [#userTask{name = 'Init',roles = [], module = spawnproc},
   #userTask{name = 'Signatory',roles = [], module = spawnproc},
   #serviceTask{name = 'Payment',roles = [], module = spawnproc},
   #serviceTask{name = 'Process',roles = [], module = spawnproc},
   #endEvent{name = 'Final',module = []}]

> bpe:docs(Proc).
  []

> bpe:amend(39,[{'WireTransfer',#user{id=1},#user{id=2}}]).

> bpe:docs(bpe:load(39)).

Credits

  • Maxim Sokhatsky
  • Oleksandr Naumov
  • Ivan Kulyk

OM A HUM

bpe's People

Contributors

221v avatar 5ht avatar diasbruno avatar doxtop avatar g-grand avatar gitter-badger avatar gspasov avatar kianmeng avatar kotedo65 avatar loxs avatar pal-alex avatar qomputer avatar rilian avatar sunrisegg avatar umka1332 avatar zatolokinpavel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bpe's Issues

Porting bpe idea to haskell

This looks really interesting. Would you mind if I port some ideas to haskell? I want to give proper attribution.

fs dependency is wrong or not published

===> Fetching fs ({git,"git://github.com/synrc/fs",{tag,"4.11"}})
===> Failed to fetch and copy dep: {git,"git://github.com/synrc/fs",{tag,"4.11"}}
otp.mk:28: recipe for target 'compile' failed
make: *** [compile] Error 1

New BPE restart strategy

There are some new inputs from BPE team to discuss.

The first is #boundaryEvent and PINGs. Now we track processes in a way they should stop reacting on pings and about to die only when now > timestamp of process start + timestamp in boundary event . This is not very practical. The more useful default behavior is to react on the timestamp of the last process modification or the timestamp of last event of the trace bpe.head.

Typo

controlling processes with parallel gateways, hierarhical

Typo for the word hierarchical

Getting Started

Hey there,

I am currently looking at BPE. We would like to use it in our Elixir Applications.

While most of the docs look very nice, I am having difficulties getting started.

Is there some document that can give me hints on how to continue?

What I tried:

1. Adding BPE to my Mix Project

I run into

13:52:15.799 [notice] Application bpe exited: exited in: :bpe_otp.start(:normal, [])
    ** (EXIT) {:aborted, {:no_exists, [:writer, '/bpe/proc']}}

But I don't know what this tells me. Is a file missing? Does it need the folder /bpe/proc to exist?
Or does it expect the source files to be located in a /bpe folder relative to the projects source folder?

2. Using mad

The Website mentions the following:

 $ mad get bpe
 $ cd deps/bpe
 $ mix deps.get
 $ iex -S mix

which allows me download and bpe and compile rocksb.

However, when I start iex I get a lot of record xxx undefined, see the following logs:
startup_errors.log

Plus, I am running just the dependency then, not my own project ๐Ÿค” Is BPE meant to be used standalone?

Event sending

We are trying to implement this package with event sending for BPMN2.0 and xml loading.

What we do is that we add events to tasks in bpe_xml as follows:

reduce([{'intermediateCatchEvent',_Body,Attrs}|T],#process{events=Events,tasks=Tasks} = Process) ->
    Id = proplists:get_value(id,Attrs),
    Name = unicode:characters_to_binary(proplists:get_value(name,Attrs,[])),
    reduce(T,Process#process{tasks=[#task{id=Id,name=Name}|Tasks], `events=[#messageEvent{id=Id,name=Name}|Events]});`
  • we do that because otherwise edges and flows from and to the event are not found

and then with correct event handler in our module we are able to process the event but the following problems arise:

  1. Events can be sent at any step and then they return complete for the next step after the event (although we didnt reach there yet)
  2. That causes the process to repeat some steps after certain gateways twice
  3. We still have no clue on how to link Timer events to tasks for simple timeout

Appreciating any help as we believe this package has really good potential for pools of concurrent processes running some internal workflow.

trying to run on console

I started with erl -pa ebin, after rebar compile, and
also configured the .src file as below, but when kvs:config(dba), but I receive: [] , empty, so kvs:join(). returns me a bad argument in line 28 on kvs.erl file.

{application, kvs,
[{description, "KVS Abstract Term Database"},
{vsn, "1"},
{registered, []},
{applications, [kernel,stdlib,mnesia]},
{mod, { kvs_app, []}},
{dba, store_mnesia},
{env, []} ]}.

Proc terminating after start

I have experiments.
I'm change sys.config

[{bpe,[{nostand,false}]},
 {kvs,[{dba,kvs_mnesia},
       {dba_st,kvs_stream},
       {schema,[kvs,kvs_stream,bpe_metainfo]}]}].

And next run

bpe:start(bpe_account:def(), []).

After a short pause i have

(main@MBP-Abdul)1> bpe:start(bpe_account:def(), []).
=NOTICE REPORT==== 26-Nov-2023::22:11:13.094119 ===
BPE: 901585028729083 spawned as <0.438.0>
{ok,<<"901585028729083">>}
=NOTICE REPORT==== 26-Nov-2023::22:11:19.707837 ===
BPE: 901585028729083 terminate Reason: {aborted,
                                        {bad_type,
                                         <<"/bpe/messages/queue/901585028729083/">>}} <0.438.0>
=ERROR REPORT==== 26-Nov-2023::22:11:19.724243 ===
** Generic server <0.438.0> terminating
** Last message in was {timer,ping}
** When Server state == {process,<<"901585028729083">>,[],[],"IBAN Account",
                            [],[],[],bpe_account,[],
                            [{beginEvent,"Created",[],[],["->Init"],[],[],[]},
                             {userTask,"Init",[],
                                 ["->Init"],
                                 ["->Upload"],
                                 [],[],[]},
                             {userTask,"Upload",[],
                                 ["->Upload"],
                                 ["->Payment"],
                                 [],[],[]},
                             {userTask,"Signatory",[],
                                 ["Payment->Signatory"],
                                 ["Signatory->Final","Signatory->Process"],
                                 [],[],[]},
                             {serviceTask,"Payment",[],
                                 ["->Payment"],
                                 ["Payment->Process","Payment->Signatory"],
                                 [],[],[]},
                             {serviceTask,"Process",[],
                                 ["Signatory->Process","Process-loop",
                                  "Payment->Process"],
                                 ["Process->Final","Process-loop"],
                                 [],[],[]},
                             {endEvent,"Final",[],[],[],[],[],[]}],
                            [{messageEvent,"PaymentReceived",[],[],[],[],[]},
                             {boundaryEvent,'*',[],[],[],[],
                                 {timeout,{0,{10,0,10}}},
                                 [],[],[]}],
                            [{sequenceFlow,"->Init",[],[],"Created","Init",
                                 [],[]},
                             {sequenceFlow,"->Upload",[],[],"Init","Upload",
                                 [],[]},
                             {sequenceFlow,"->Payment",[],[],"Upload",
                                 "Payment",[],[]},
                             {sequenceFlow,"Payment->Signatory",[],[],
                                 "Payment","Signatory",[],[]},
                             {sequenceFlow,"Payment->Process",[],[],
                                 "Payment","Process",[],[]},
                             {sequenceFlow,"Process-loop",[],[],"Process",
                                 "Process",[],[]},
                             {sequenceFlow,"Process->Final",[],[],"Process",
                                 "Final",[],[]},
                             {sequenceFlow,"Signatory->Process",[],[],
                                 "Signatory","Process",[],[]},
                             {sequenceFlow,"Signatory->Final",[],[],
                                 "Signatory","Final",[],[]}],
                            [],[],[],[],#Ref<0.3541214849.2395996164.152693>,
                            undefined,[],
                            {ts,{{2023,11,26},{22,11,13}}},
                            {ts,{{2023,11,26},{22,11,13}}},
                            [],[],[],[],[],"Created","Final",[],"Created",[],
                            [],[],[],[],[],[],[],[]}
** Reason for termination ==
** {{aborted,{bad_type,<<"/bpe/messages/queue/901585028729083/">>}},
    [{mnesia_tm,non_transaction,5,[{file,"mnesia_tm.erl"},{line,800}]},
     {kvs_mnesia,many,1,
                 [{file,"/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl"},
                  {line,51}]},
     {kvs_mnesia,all,1,
                 [{file,"/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl"},
                  {line,44}]},
     {bpe_proc,terminate,2,
               [{file,"/Users/abdul/Temp/bpe/src/bpe_proc.erl"},{line,390}]},
     {gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,1125}]},
     {gen_server,terminate,10,[{file,"gen_server.erl"},{line,1321}]},
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,241}]}]}

=CRASH REPORT==== 26-Nov-2023::22:11:19.724632 ===
  crasher:
    initial call: bpe_proc:init/1
    pid: <0.438.0>
    registered_name: []
    exception exit: {aborted,
                        {bad_type,<<"/bpe/messages/queue/901585028729083/">>}}
      in function  mnesia_tm:non_transaction/5 (mnesia_tm.erl, line 800)
      in call from kvs_mnesia:many/1 (/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl, line 51)
      in call from kvs_mnesia:all/1 (/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl, line 44)
      in call from bpe_proc:terminate/2 (/Users/abdul/Temp/bpe/src/bpe_proc.erl, line 390)
      in call from gen_server:try_terminate/3 (gen_server.erl, line 1125)
      in call from gen_server:terminate/10 (gen_server.erl, line 1321)
    ancestors: [bpe_otp,<0.256.0>]
    message_queue_len: 0
    messages: []
    links: [<0.436.0>]
    dictionary: [{rand_seed,{#{type => exsss,next => #Fun<rand.0.65977474>,
                                bits => 58,uniform => #Fun<rand.1.65977474>,
                                uniform_n => #Fun<rand.2.65977474>,
                                jump => #Fun<rand.3.65977474>},
                              [217084770795779370|41697537146426448]}},
                  {{pool,{messageEvent,messageEvent,<<"901585028729083">>}},
                   {messageEvent,messageEvent,<<"901585028729083">>}},
                  {{pool,{messageEvent,boundaryEvent,<<"901585028729083">>}},
                   {messageEvent,boundaryEvent,<<"901585028729083">>}}]
    trap_exit: true
    status: running
    heap_size: 10958
    stack_size: 28
    reductions: 28895
  neighbours:

=SUPERVISOR REPORT==== 26-Nov-2023::22:11:19.730289 ===
    supervisor: {local,bpe_otp}
    errorContext: child_terminated
    reason: {aborted,{bad_type,<<"/bpe/messages/queue/901585028729083/">>}}
    offender: [{pid,<0.438.0>},
               {id,<<"901585028729083">>},
               {mfargs,
                   {bpe_proc,start_link,
                       [{process,<<"901585028729083">>,[],[],"IBAN Account",
                            [],[],[],bpe_account,[],
                            [{beginEvent,"Created",[],[],["->Init"],[],[],[]},
                             {userTask,"Init",[],
                                 ["->Init"],
                                 ["->Upload"],
                                 [],[],[]},
                             {userTask,"Upload",[],
                                 ["->Upload"],
                                 ["->Payment"],
                                 [],[],[]},
                             {userTask,"Signatory",[],
                                 ["Payment->Signatory"],
                                 ["Signatory->Final","Signatory->Process"],
                                 [],[],[]},
                             {serviceTask,"Payment",[],
                                 ["->Payment"],
                                 ["Payment->Process","Payment->Signatory"],
                                 [],[],[]},
                             {serviceTask,"Process",[],
                                 ["Signatory->Process","Process-loop",
                                  "Payment->Process"],
                                 ["Process->Final","Process-loop"],
                                 [],[],[]},
                             {endEvent,"Final",[],[],[],[],[],[]}],
                            [{messageEvent,"PaymentReceived",[],[],[],[],[]},
                             {boundaryEvent,'*',[],[],[],[],
                                 {timeout,{0,{10,0,10}}},
                                 [],[],[]}],
                            [{sequenceFlow,"->Init",[],[],"Created","Init",
                                 [],[]},
                             {sequenceFlow,"->Upload",[],[],"Init","Upload",
                                 [],[]},
                             {sequenceFlow,"->Payment",[],[],"Upload",
                                 "Payment",[],[]},
                             {sequenceFlow,"Payment->Signatory",[],[],
                                 "Payment","Signatory",[],[]},
                             {sequenceFlow,"Payment->Process",[],[],
                                 "Payment","Process",[],[]},
                             {sequenceFlow,"Process-loop",[],[],"Process",
                                 "Process",[],[]},
                             {sequenceFlow,"Process->Final",[],[],"Process",
                                 "Final",[],[]},
                             {sequenceFlow,"Signatory->Process",[],[],
                                 "Signatory","Process",[],[]},
                             {sequenceFlow,"Signatory->Final",[],[],
                                 "Signatory","Final",[],[]}],
                            [],[],[],[],[],undefined,[],
                            {ts,{{2023,11,26},{22,11,13}}},
                            {ts,{{2023,11,26},{22,11,13}}},
                            [],[],[],[],[],"Created","Final",[],"Created",[],
                            [],[],[],[],[],[],[],[]}]}},
               {restart_type,transient},
               {significant,false},
               {shutdown,5000},
               {child_type,worker}]

=NOTICE REPORT==== 26-Nov-2023::22:11:19.730750 ===
BPE: 901585028729083 spawned as <0.446.0>
=NOTICE REPORT==== 26-Nov-2023::22:11:22.015820 ===
BPE: 901585028729083 terminate Reason: {aborted,
                                        {bad_type,
                                         <<"/bpe/messages/queue/901585028729083/">>}} <0.446.0>
=ERROR REPORT==== 26-Nov-2023::22:11:22.016313 ===
** Generic server <0.446.0> terminating
** Last message in was {timer,ping}
** When Server state == {process,<<"901585028729083">>,[],[],"IBAN Account",
                            [],[],[],bpe_account,[],
                            [{beginEvent,"Created",[],[],["->Init"],[],[],[]},
                             {userTask,"Init",[],
                                 ["->Init"],
                                 ["->Upload"],
                                 [],[],[]},
                             {userTask,"Upload",[],
                                 ["->Upload"],
                                 ["->Payment"],
                                 [],[],[]},
                             {userTask,"Signatory",[],
                                 ["Payment->Signatory"],
                                 ["Signatory->Final","Signatory->Process"],
                                 [],[],[]},
                             {serviceTask,"Payment",[],
                                 ["->Payment"],
                                 ["Payment->Process","Payment->Signatory"],
                                 [],[],[]},
                             {serviceTask,"Process",[],
                                 ["Signatory->Process","Process-loop",
                                  "Payment->Process"],
                                 ["Process->Final","Process-loop"],
                                 [],[],[]},
                             {endEvent,"Final",[],[],[],[],[],[]}],
                            [{messageEvent,"PaymentReceived",[],[],[],[],[]},
                             {boundaryEvent,'*',[],[],[],[],
                                 {timeout,{0,{10,0,10}}},
                                 [],[],[]}],
                            [{sequenceFlow,"->Init",[],[],"Created","Init",
                                 [],[]},
                             {sequenceFlow,"->Upload",[],[],"Init","Upload",
                                 [],[]},
                             {sequenceFlow,"->Payment",[],[],"Upload",
                                 "Payment",[],[]},
                             {sequenceFlow,"Payment->Signatory",[],[],
                                 "Payment","Signatory",[],[]},
                             {sequenceFlow,"Payment->Process",[],[],
                                 "Payment","Process",[],[]},
                             {sequenceFlow,"Process-loop",[],[],"Process",
                                 "Process",[],[]},
                             {sequenceFlow,"Process->Final",[],[],"Process",
                                 "Final",[],[]},
                             {sequenceFlow,"Signatory->Process",[],[],
                                 "Signatory","Process",[],[]},
                             {sequenceFlow,"Signatory->Final",[],[],
                                 "Signatory","Final",[],[]}],
                            [],[],[],[],#Ref<0.3541214849.2395996163.153229>,
                            undefined,[],
                            {ts,{{2023,11,26},{22,11,13}}},
                            {ts,{{2023,11,26},{22,11,13}}},
                            [],[],[],[],[],"Created","Final",[],"Created",[],
                            [],[],[],[],[],[],[],[]}
** Reason for termination ==
** {{aborted,{bad_type,<<"/bpe/messages/queue/901585028729083/">>}},
    [{mnesia_tm,non_transaction,5,[{file,"mnesia_tm.erl"},{line,800}]},
     {kvs_mnesia,many,1,
                 [{file,"/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl"},
                  {line,51}]},
     {kvs_mnesia,all,1,
                 [{file,"/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl"},
                  {line,44}]},
     {bpe_proc,terminate,2,
               [{file,"/Users/abdul/Temp/bpe/src/bpe_proc.erl"},{line,390}]},
     {gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,1125}]},
     {gen_server,terminate,10,[{file,"gen_server.erl"},{line,1321}]},
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,241}]}]}

=CRASH REPORT==== 26-Nov-2023::22:11:22.017547 ===
  crasher:
    initial call: bpe_proc:init/1
    pid: <0.446.0>
    registered_name: []
    exception exit: {aborted,
                        {bad_type,<<"/bpe/messages/queue/901585028729083/">>}}
      in function  mnesia_tm:non_transaction/5 (mnesia_tm.erl, line 800)
      in call from kvs_mnesia:many/1 (/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl, line 51)
      in call from kvs_mnesia:all/1 (/Users/abdul/Temp/bpe/_build/default/deps/kvs/src/stores/kvs_mnesia.erl, line 44)
      in call from bpe_proc:terminate/2 (/Users/abdul/Temp/bpe/src/bpe_proc.erl, line 390)
      in call from gen_server:try_terminate/3 (gen_server.erl, line 1125)
      in call from gen_server:terminate/10 (gen_server.erl, line 1321)
    ancestors: [bpe_otp,<0.256.0>]
    message_queue_len: 0
    messages: []
    links: [<0.436.0>]
    dictionary: [{rand_seed,{#{type => exsss,next => #Fun<rand.0.65977474>,
                                bits => 58,uniform => #Fun<rand.1.65977474>,
                                uniform_n => #Fun<rand.2.65977474>,
                                jump => #Fun<rand.3.65977474>},
                              [160003460953348246|74141439845640411]}},
                  {{pool,{messageEvent,messageEvent,<<"901585028729083">>}},
                   {messageEvent,messageEvent,<<"901585028729083">>}},
                  {{pool,{messageEvent,boundaryEvent,<<"901585028729083">>}},
                   {messageEvent,boundaryEvent,<<"901585028729083">>}}]
    trap_exit: true
    status: running
    heap_size: 28690
    stack_size: 28
    reductions: 29817
  neighbours:

=SUPERVISOR REPORT==== 26-Nov-2023::22:11:22.019476 ===
    supervisor: {local,bpe_otp}
    errorContext: child_terminated
    reason: {aborted,{bad_type,<<"/bpe/messages/queue/901585028729083/">>}}
    offender: [{pid,<0.446.0>},
               {id,<<"901585028729083">>},
               {mfargs,
                   {bpe_proc,start_link,
                       [{process,<<"901585028729083">>,[],[],"IBAN Account",
                            [],[],[],bpe_account,[],
                            [{beginEvent,"Created",[],[],["->Init"],[],[],[]},
                             {userTask,"Init",[],
                                 ["->Init"],
                                 ["->Upload"],
                                 [],[],[]},
                             {userTask,"Upload",[],
                                 ["->Upload"],
                                 ["->Payment"],
                                 [],[],[]},
                             {userTask,"Signatory",[],
                                 ["Payment->Signatory"],
                                 ["Signatory->Final","Signatory->Process"],
                                 [],[],[]},
                             {serviceTask,"Payment",[],
                                 ["->Payment"],
                                 ["Payment->Process","Payment->Signatory"],
                                 [],[],[]},
                             {serviceTask,"Process",[],
                                 ["Signatory->Process","Process-loop",
                                  "Payment->Process"],
                                 ["Process->Final","Process-loop"],
                                 [],[],[]},
                             {endEvent,"Final",[],[],[],[],[],[]}],
                            [{messageEvent,"PaymentReceived",[],[],[],[],[]},
                             {boundaryEvent,'*',[],[],[],[],
                                 {timeout,{0,{10,0,10}}},
                                 [],[],[]}],
                            [{sequenceFlow,"->Init",[],[],"Created","Init",
                                 [],[]},
                             {sequenceFlow,"->Upload",[],[],"Init","Upload",
                                 [],[]},
                             {sequenceFlow,"->Payment",[],[],"Upload",
                                 "Payment",[],[]},
                             {sequenceFlow,"Payment->Signatory",[],[],
                                 "Payment","Signatory",[],[]},
                             {sequenceFlow,"Payment->Process",[],[],
                                 "Payment","Process",[],[]},
                             {sequenceFlow,"Process-loop",[],[],"Process",
                                 "Process",[],[]},
                             {sequenceFlow,"Process->Final",[],[],"Process",
                                 "Final",[],[]},
                             {sequenceFlow,"Signatory->Process",[],[],
                                 "Signatory","Process",[],[]},
                             {sequenceFlow,"Signatory->Final",[],[],
                                 "Signatory","Final",[],[]}],
                            [],[],[],[],[],undefined,[],
                            {ts,{{2023,11,26},{22,11,13}}},
                            {ts,{{2023,11,26},{22,11,13}}},
                            [],[],[],[],[],"Created","Final",[],"Created",[],
                            [],[],[],[],[],[],[],[]}]}},
               {restart_type,transient},
               {significant,false},
               {shutdown,5000},
               {child_type,worker}]

=NOTICE REPORT==== 26-Nov-2023::22:11:22.020417 ===
BPE: 901585028729083 spawned as <0.453.0>

What's my mistake?

Trying bpe

How I should try and test bpe?
I am using Erlang 22 and rebar3.
I tried bpe by running:

rebar3 shell --apps bpe

and got some errors:

ubuntu@dev:~/bpe$ rebar3 shell --apps bpe
===> Verifying dependencies...
===> Fetching kvs (from {git,"git://github.com/synrc/kvs",{tag,"master"}})
===> Fetching syn (from {git,"git://github.com/ostinelli/syn",{tag,"2.1.0"}})
===> Compiling kvs
_build/default/deps/kvs/src/stores/kvs_st.erl:58: Warning: variable 'I' is unused

_build/default/deps/kvs/src/layers/kvs_stream.erl:57: Warning: variable 'B' is unused
_build/default/deps/kvs/src/layers/kvs_stream.erl:96: Warning: variable 'Rec' is unused

_build/default/deps/kvs/src/kvs.erl:15: Warning: export_all flag enabled - all functions will be exported
_build/default/deps/kvs/src/kvs.erl:141: Warning: variable 'KVS' is unused
_build/default/deps/kvs/src/kvs.erl:143: Warning: variable 'KVS' is unused

_build/default/deps/kvs/src/stores/kvs_rocks.erl:61: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:61: Warning: variable 'X' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:63: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:63: Warning: variable 'X' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:68: Warning: variable 'A' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:68: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:69: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:69: Warning: variable 'X' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:71: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:73: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:78: Warning: variable 'A' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:78: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:79: Warning: variable 'Key' is unused
_build/default/deps/kvs/src/stores/kvs_rocks.erl:94: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.

_build/default/deps/kvs/src/stores/kvs_mnesia.erl:44: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.

===> Compiling syn
===> Compiling bpe
src/bpe_task.erl:7: Warning: variable 'List' is unused
src/bpe_task.erl:14: Warning: variable 'Proc' is unused
src/bpe_task.erl:14: Warning: variable 'Source' is unused
src/bpe_task.erl:14: Warning: variable 'Target' is unused

src/ext/bpe_ping.erl:8: Warning: variable 'Events' is unused
src/ext/bpe_ping.erl:8: Warning: variable 'Pid' is unused

src/ext/bpe_xml.erl:37: Warning: variable 'X' is unused
src/ext/bpe_xml.erl:105: Warning: variable 'Attrs' is unused
src/ext/bpe_xml.erl:140: Warning: variable 'Name' is unused

src/bpe_proc.erl:69: Warning: variable 'Proc' is unused
src/bpe_proc.erl:114: Warning: variable 'Events' is unused
src/bpe_proc.erl:114: Warning: variable 'Id' is unused
src/bpe_proc.erl:114: Warning: variable 'Pid' is unused
src/bpe_proc.erl:114: Warning: variable 'Timer' is unused

src/ext/bpe_account.erl:46: Warning: variable 'X' is unused
src/ext/bpe_account.erl:55: Warning: variable 'X' is unused

src/bpe_env.erl:12: Warning: variable 'Docs' is unused
src/bpe_env.erl:12: Warning: variable 'Proc' is unused
src/bpe_env.erl:38: Warning: variable 'Y' is unused
src/bpe_env.erl:42: Warning: variable 'X' is unused

Erlang/OTP 22 [erts-10.7.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

Eshell V10.7.2  (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/docs/releases)
2021-04-06T12:24:20.518560-04:00 notice: Syn(nonode@nohost): Initiating full cluster groups sync for nodes: []
2021-04-06T12:24:20.527899-04:00 notice: Syn(nonode@nohost): Initiating full cluster registry sync for nodes: []

===>>>    2021-04-06T12:24:21.238842-04:00 ===>>> error: crasher: 			<<<====

initial call: application_master:init/4, pid: <0.722.0>, registered_name: [], 
exit: {{bad_return,{{bpe_otp,start,[normal,[]]},{'EXIT',{aborted,{no_exists,[writer,"/bpe/proc"]}}}}},
[{application_master,init,4,[{file,"application_master.erl"},{line,138}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}, 
ancestors: [<0.721.0>], message_queue_len: 1, messages: [{'EXIT',<0.723.0>,normal}], 
links: [<0.721.0>,<0.44.0>], dictionary: [], trap_exit: true, status: running, heap_size: 610, stack_size: 27, reductions: 235; neighbours:
2021-04-06T12:24:21.239431-04:00 notice: application: bpe, exited: {bad_return,{{bpe_otp,start,[normal,[]]},{'EXIT',{aborted,{no_exists,[writer,"/bpe/proc"]}}}}}, type: temporary
2021-04-06T12:24:21.240262-04:00 notice: application: syn, exited: stopped, type: temporary
===>>> Failed to boot bpe for reason {bad_return,
                                               {{bpe_otp,start,[normal,[]]},
                                                {'EXIT',
                                                 {aborted,
                                                  {no_exists,
                                                   [writer,"/bpe/proc"]}}}}}
2021-04-06T12:24:21.240784-04:00 notice: application: kvs, exited: stopped, type: temporary  
1> application:which_applications().
[{mnesia,"MNESIA  CXC 138 12","4.16.3"},
 {inets,"INETS  CXC 138 49","7.1.3"},
 {ssl,"Erlang/OTP SSL application","9.6.2"},
 {public_key,"Public key infrastructure","1.7.2"},
 {asn1,"The Erlang ASN1 compiler version 5.0.12","5.0.12"},
 {crypto,"CRYPTO","4.6.5"},
 {stdlib,"ERTS  CXC 138 10","3.12.1"},
 {kernel,"ERTS  CXC 138 10","6.5.2"}]
2>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.