Skip to content

Commit

Permalink
finish migration
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Nov 5, 2022
1 parent d4235e9 commit b3faa28
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 99 deletions.
17 changes: 8 additions & 9 deletions include/act.hrl
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
-include_lib("bank/include/bpe.hrl").
-include_lib("bank/include/phone.hrl").
-include_lib("bank/include/requests.hrl").
-include_lib("bank/include/otp.hrl").
-include_lib("bank/include/sid.hrl").
-include_lib("bank/include/customer.hrl").
-include_lib("bank/include/payment.hrl").
-include_lib("bank/include/account.hrl").
-include_lib("bank/include/card.hrl").
-include("bank/phone.hrl").
-include("bank/otp.hrl").
-include("bank/sid.hrl").
-include("bank/account.hrl").
-include("bank/card.hrl").

-record(act, {code='Spawnproc',process_type="Normal"}).

1 change: 0 additions & 1 deletion include/ent.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
-include("api.hrl").

-endif.

4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule FIN.Mixfile do
def project() do
[
app: :fin,
version: "0.7.1",
version: "1.11.1",
description: "FIN Financial Management",
package: package(),
elixir: "~> 1.11",
Expand Down Expand Up @@ -32,7 +32,7 @@ defmodule FIN.Mixfile do
{:cowboy, "~> 2.9.0"},
{:rocksdb, "~> 1.6.0"},
{:syn, "2.1.0"},
{:bpe, "~> 7.10.4"},
{:bpe, "~> 7.11.0"},
{:nitro, "~> 7.8.0"},
{:form, "~> 7.8.0"},
{:n2o, "~> 8.12.1"}
Expand Down
2 changes: 1 addition & 1 deletion src/fin.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, fin,
[
{description, "FIN Account Management"},
{vsn, "0.7.1"},
{vsn, "1.11.1"},
{registered, []},
{applications, [public_key,asn1,kernel,stdlib,rocksdb,mnesia,ranch,cowboy,
nitro,syntax_tools,compiler,xmerl,kvs,syn,n2o,bpe,form]},
Expand Down
6 changes: 3 additions & 3 deletions src/forms/bpe_row.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ id() -> #process{}.
current(Proc) -> {_,T} = bpe:current_task(Proc), T.
new(Name,Proc) ->
Pid = nitro:to_list(Proc#process.id),
Docs = Proc#process.docs,
#panel { id=form:atom([tr,Name]),
class=td,
body=[
#panel{class=column6, body = #link{href="act.htm?p="++Pid, body=Pid } },
#panel{class=column6, body = nitro:to_list(Proc#process.name) },
#panel{class=column6, body = nitro:to_list(current(Proc))},
#panel{class=column20, body = nitro:to_list(current(Proc))},
#panel{class=column20, body = ""}, %string:join(lists:map(fun(X)-> nitro:to_list([element(1,X)]) end,
%element(#task.prompt,current(Proc))),", ")},
#panel{class=column10, body = case current(Proc) of 'Final' -> [];
#panel{class=column20, body = string:join(lists:map(fun(X)-> nitro:to_list([element(1,X)]) end,Docs),", ") },
#panel{class=column10, body = case current(Proc) of "Final" -> [];
_ -> [ #link{postback={complete,Proc#process.id}, class=[button,sgreen],
body= "Go", source=[], validate=[]} ] end }
]}.
16 changes: 8 additions & 8 deletions src/forms/bpe_trace.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

doc() -> "This is the actor trace row (step) representation. "
"Used to draw trace of the processes".
id() -> #hist{task={task,'Init'}}.
id() -> #hist{task=#sequenceFlow{source='Init'}}.
new(Name,Hist) ->
Task = case element(#hist.task,Hist) of [] -> (id())#hist.task; X -> X end,
Docs = element(#hist.docs,Hist),
io:format("Docs: ~p",[Docs]),
#panel { id=form:atom([tr,nitro:to_list(Name)]),
class=td,
body=[
#panel{class=column6, body = Task },
Task = case Hist#hist.task of [] -> (id())#hist.task; X -> X end,
Docs = Hist#hist.docs,
#panel { id=form:atom([tr,nitro:to_list(Name)]), class=td, body=[
#panel{class=column6, body = name(Task) },
#panel{class=column20, body = string:join(lists:map(fun(X)-> nitro:to_list([element(1,X)]) end,Docs),", ")}
]}.

name(#sequenceFlow{source=Task}) -> Task;
name(_) -> [].
19 changes: 11 additions & 8 deletions src/pages/bpe_act.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
-include_lib("nitro/include/nitro.hrl").
-include_lib("form/include/meta.hrl").
-include_lib("bpe/include/bpe.hrl").
-include("act.hrl").
-compile(export_all).
-record(pi, {code='Spawnproc'}).

event(init) ->
nitro:clear(tableHead),
Expand All @@ -21,9 +21,11 @@ event(init) ->
nitro:update(n, Bin),
nitro:update(num, Bin),
History = bpe:hist(Id),
[ begin nitro:insert_bottom(tableRow,
io:format("I: ~p",[I]),
bpe_trace:new(form:atom([trace,nitro:to_list(I#hist.id)]),I))
[ begin
{step,No,Step} = I#hist.id,
Name = nitro:to_list(No)++"-"++nitro:to_list(Step),
Trace = bpe_trace:new(form:atom([trace,Name]),I),
nitro:insert_bottom(tableRow, Trace)
end
|| I <- History ]
end;
Expand All @@ -38,8 +40,9 @@ header() ->
#panel{class=column6,body="Documents"}]}.

doc() -> "Dialog for creation of BPE processes.".
id() -> #pi{}.
new(Name,{pi,_Code}, _) ->
id() -> #act{}.
new(Name,#act{}, _) ->
put(process_type_pi_none, "bpe_account"),
#document { name = form:atom([pi,Name]), sections = [
#sec { name=[<<"New process: "/utf8>>] } ],
buttons = [ #but { id=form:atom([pi,decline]),
Expand All @@ -56,7 +59,7 @@ new(Name,{pi,_Code}, _) ->
type=select,
title= "Type",
tooltips = [],
options = [ #opt{name=fin_account,checked=true,title = "Client Account [FIN.ERP.UNO]"},
#opt{name=bpe_account,title = "Unknown"} ],
default = bpe_account,
options = [ #opt{name=bpe_account,checked=true,title = "Client Account [FIN.ERP.UNO]"} ],
postback = {'TypeSelect'}
} ] }.
3 changes: 1 addition & 2 deletions src/pages/bpe_index.erl
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ event({'Spawn',_}) ->
Id = case bpe:start(Atom:def(), []) of
{error,I} -> I;
{ok,I} -> I end,
io:format("trsty ~p: ~p~n",[Id,Atom]),
nitro:insert_after(header, bpe_row:new(form:atom([row,Id]),bpe:proc(Id))),
nitro:hide(frms),
nitro:show(ctrl),
?LOG_INFO("BPE: ~p.~n", [Id]);

event({'TypeSelect'}) ->
[ io:format("Process Dictionary: ~p : ~p~n",[X,erlang:get(X)]) || X <- erlang:get_keys()],
% [ io:format("Process Dictionary: ~p : ~p~n",[X,erlang:get(X)]) || X <- erlang:get_keys()],
io:format("~p",["Type Select"]);

event({'Discard',[]}) ->
Expand Down
2 changes: 0 additions & 2 deletions src/pages/bpe_login.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ event(init) ->
nitro:clear(stand),
Module = bpe_pass,
Form = Module:new(Module,Module:id(),[]),
io:format("Form: ~p~n",[Form]),
HTML = form:new(Form, Module:id(), []),
io:format("HTML: ~p~n",[Form]),
nitro:insert_bottom(stand, HTML);

event({'Next',_}) ->
Expand Down
63 changes: 0 additions & 63 deletions src/processes/fin_account.erl

This file was deleted.

0 comments on commit b3faa28

Please sign in to comment.