Skip to content

Commit

Permalink
6.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Apr 7, 2021
1 parent 5eaac01 commit f8467f4
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule BPE.Mixfile do
def project do
[
app: :bpe,
version: "6.3.0",
version: "6.4.0",
description: "BPE Business Process Engine",
package: package(),
deps: deps()
Expand Down
2 changes: 1 addition & 1 deletion src/bpe.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, bpe,
[
{description, "BPE Business Process Engine"},
{vsn, "6.3.0"},
{vsn, "6.4.0"},
{registered, []},
{applications, [kernel,stdlib,kvs,syn]},
{mod, { bpe_otp, []}},
Expand Down
6 changes: 3 additions & 3 deletions src/bpe_env.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ append(kvs,Feed,Rec) ->
append(env,P,[]) -> P;
append(env,P,[Rec|Tail]) -> append(env,append(env,P,Rec),Tail);

append(env,#process{id=Proc, docs = Docs} = P,Rec) when is_tuple(Rec) ->
append(env,#process{id=_Proc, docs = _Docs} = P,Rec) when is_tuple(Rec) ->
Feed = "/bpe/proc",
S = case find(env,P,Rec) of
{[],Rest} -> P#process{docs = [Rec|Rest]};
Expand All @@ -35,11 +35,11 @@ remove(env,P,[]) -> P;
remove(env,P,[Rec|Tail]) -> remove(env,remove(env,P,Rec),Tail);

remove(kvs,Feed,Rec) when is_tuple(Rec) ->
{X,Y} = find(kvs,Feed,Rec),
{X,_Y} = find(kvs,Feed,Rec),
lists:map(fun(I) -> kvs:delete(Feed,element(2,I)) end, X);

remove(env,Proc,Rec) when is_tuple(Rec) ->
{X,Y} = find(env,Proc,Rec),
{_X,Y} = find(env,Proc,Rec),
S=Proc#process{docs=Y, modified = #ts{ time = calendar:local_time()}},
kvs:append(S,"/bpe/proc"),
kvs:put(S),
Expand Down
4 changes: 2 additions & 2 deletions src/bpe_proc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ handle_call({ensure_mon},_,Proc) ->
{reply, Mon, ProcNew};
handle_call({get}, _,Proc) -> { reply, Proc, Proc };
handle_call({set,State}, _,Proc) -> { reply, Proc, State };
handle_call({persist,State}, _,Proc) -> kvs:append(State, "/bpe/proc"), { reply, State, State };
handle_call({persist,State}, _,_Proc) -> kvs:append(State, "/bpe/proc"), { reply, State, State };
handle_call({next}, _,Proc) ->
try bpe:processFlow(Proc)
catch _X:_Y:Z -> {reply,{error,'next/1',Z},Proc} end;
Expand Down Expand Up @@ -111,7 +111,7 @@ handle_cast(Msg, State) ->
logger:notice("BPE: Unknown API async: ~p.", [Msg]),
{stop, {error, {unknown_cast, Msg}}, State}.

handle_info({timer,ping}, State=#process{timer=Timer,id=Id,events=Events,notifications=Pid}) ->
handle_info({timer,ping}, State=#process{timer=_Timer,id=_Id,events=_Events,notifications=_Pid}) ->
(application:get_env(bpe,ping_discipline,bpe_ping)):ping(State);

handle_info({'DOWN', _MonitorRef, _Type, _Object, _Info} = Msg, State = #process{id=Id}) ->
Expand Down
4 changes: 2 additions & 2 deletions src/bpe_task.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
-include("bpe.hrl").

find_flow(noflow) -> [];
find_flow([H|_]=List) when is_list(H) -> H;
find_flow([H|_]=_List) when is_list(H) -> H;
find_flow([H|_]=List) when is_integer(H) -> List.
find_flow([],List) -> find_flow(List);
find_flow(Stage,List) -> case lists:member(Stage,List) of
true -> Stage;
_ -> find_flow(List) end.

move_doclink({Source,Target},Proc) -> [].
move_doclink({_Source,_Target},_Proc) -> [].

targets(Name,Proc) ->
lists:flatten([ Target || #sequenceFlow{source=Source,target=Target}
Expand Down
4 changes: 2 additions & 2 deletions src/ext/bpe_account.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ action({request,"Created",_}, Proc) ->
action({request,"Init",_}, Proc) ->
{reply,Proc};

action({request,"Payment",X}, Proc) ->
action({request,"Payment",_X}, Proc) ->
Payment = bpe:doc({payment_notification},Proc),
case Payment of
[] -> {reply,"Process",Proc#process{docs=[#tx{}]}};
Expand All @@ -52,7 +52,7 @@ action({request,"Payment",X}, Proc) ->
action({request,"Signatory",_}, Proc) ->
{reply,"Process",Proc};

action({request,"Process",X}, Proc) ->
action({request,"Process",_X}, Proc) ->
case bpe:doc(#close_account{},Proc) of
[#close_account{}] -> {reply,"Final",Proc};
_ -> {reply,"Process",Proc} end;
Expand Down
2 changes: 1 addition & 1 deletion src/ext/bpe_ping.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
timer_restart(Diff) -> {X,Y,Z} = Diff, erlang:send_after(500*(Z+60*Y+60*60*X),self(),{timer,ping}).
ping() -> application:get_env(bpe,ping,{0,0,30}).
termination() -> application:get_env(bpe,boundary,{7,{0,0,0}}).
ping(State=#process{timer=Timer,id=Id,modified = #ts{time=Time2}, events=Events,notifications=Pid}) ->
ping(State=#process{timer=Timer,id=Id,modified = #ts{time=Time2}, events=_Events,notifications=_Pid}) ->
case Timer of [] -> skip; _ -> erlang:cancel_timer(Timer) end,
case bpe:head(Id) of
#hist{time=#ts{time=Time1}} ->
Expand Down
6 changes: 3 additions & 3 deletions src/ext/bpe_xml.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ load(File) -> load(File, ?MODULE).
load(File,Module) ->
case xmerl_scan:file(File, [{hook_fun, fun ns/2}]) of
{error, R} -> {error, R};
{#xmlElement{name=N,content=C}=X,_} ->
{#xmlElement{name=N,content=C},_} ->
_E = {'bpmn:definitions',[{'bpmn:process',Elements,Attrs}],_} = {N,find(C,'bpmn:process'),attr(C)},
Id = proplists:get_value(id,Attrs),
Name = unicode:characters_to_binary(proplists:get_value(name,Attrs,[])),
Expand Down Expand Up @@ -102,7 +102,7 @@ reduce([{'bpmn:gateway',_Body,Attrs}|T],#process{tasks=Tasks} = Process) ->
Name = unicode:characters_to_binary(proplists:get_value(name,Attrs,[])),
reduce(T,Process#process{tasks=[#gateway{id=Id,name=Name}|Tasks]});

reduce([{'bpmn:laneSet',Lanes,Attrs}|T], Process) ->
reduce([{'bpmn:laneSet',Lanes,_Attrs}|T], Process) ->
Roles = [ #role{ id = proplists:get_value(id,Att,[]),
tasks = [ Name || {_, [], {value, Name}} <- Tasks ],
name = unicode:characters_to_binary(proplists:get_value(name,Att,[]),utf16)
Expand Down Expand Up @@ -137,7 +137,7 @@ key_push_value(Value, ValueKey, ElemId, ElemIdKey, List) ->
setelement(ValueKey, Elem, [Value|element(ValueKey,Elem)])) end.

fixRoles(Tasks, []) -> Tasks;
fixRoles(Tasks, [#role{id=Id,name=Name,tasks=XmlTasks}|Lanes]) -> fixRoles(update_roles(XmlTasks, Tasks, Id), Lanes).
fixRoles(Tasks, [#role{id=Id,name=_Name,tasks=XmlTasks}|Lanes]) -> fixRoles(update_roles(XmlTasks, Tasks, Id), Lanes).

update_roles([], AllTasks, _Role) -> AllTasks;
update_roles([TaskId|Rest], AllTasks, Role) ->
Expand Down
4 changes: 2 additions & 2 deletions sys.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[{bpe,[{nostand,false}]},
{kvs,[{dba,kvs_rocks},
{dba_st,kvs_st},
{kvs,[{dba,kvs_mnesia},
{dba_st,kvs_stream},
{schema,[kvs,kvs_stream,bpe_metainfo]}]}].

0 comments on commit f8467f4

Please sign in to comment.