package Ġcom . template Ċ Ċ import Ġco . parallel universe . fib ers . Suspend able Ċ import Ġcom . template . contracts . Request Contract Ċ import Ġcom . template . states . Request State Ċ import Ġnet . cord a . core . contracts . Unique Identifier Ċ import Ġnet . cord a . core . flows .* Ċ import Ġnet . cord a . core . identity . Party Ċ import Ġnet . cord a . core . transactions . Signed Transaction Ċ import Ġnet . cord a . core . transactions . Transaction Builder Ċ import Ġnet . cord a . core . utilities . Progress Tracker Ċ Ċ @ Initi ating Flow Ċ @ Start able By RPC Ċ class ĠRequest Flow ( val Ġloan Amount : ĠInt , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġinter medi ary : ĠParty ): Flow Logic < Signed Transaction >() Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġobject ĠINITIAL ISE Ġ: ĠProgress Tracker . Step (" Initial ising Ġflow .") ĊĠĠĠĠĠĠĠ Ġobject ĠBUILD _ TX Ġ: ĠProgress Tracker . Step (" Building Ġtransaction .") ĊĠĠĠĠĠĠĠ Ġobject ĠVERIFY _ TX Ġ: ĠProgress Tracker . Step (" Verify ing Ġtransaction .") ĊĠĠĠĠĠĠĠ Ġobject ĠSIGN _ TX Ġ: ĠProgress Tracker . Step (" signing Ġtransaction .") ĊĠĠĠĠĠĠĠ Ġobject ĠFIN ALI SE Ġ: ĠProgress Tracker . Step (" Final ising Ġtransaction .") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġchild Progress Tracker () Ġ= ĠFinal ity Flow . tracker () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun Ġtracker () Ġ= ĠProgress Tracker ( INITIAL ISE , ĠBUILD _ TX , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠVERIFY _ TX , ĠSIGN _ TX , ĠFIN ALI SE ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġval Ġprogress Tracker Ġ= Ġtracker () ĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġcall (): ĠSigned Transaction Ġ{ ĊĠĠĠĠĠĠĠ Ġprogress Tracker . current Step Ġ= ĠINITIAL ISE ĊĠĠĠĠĠĠĠ Ġval Ġnot ary Ġ= Ġservice Hub . network Map Cache . not ary Id entities . first () ĊĠĠĠĠĠĠĠ Ġval Ġoutput State Ġ= ĠRequest State ( loan Amount , Ġour Identity , Ġinter medi ary , ĠUnique Identifier ()) ĊĊĠĠĠĠĠĠĠ Ġprogress Tracker . current Step Ġ= ĠBUILD _ TX ĊĠĠĠĠĠĠĠ Ġval Ġtransaction Builder Ġ= ĠTransaction Builder ( not ary ). ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġadd Output State ( output State , ĠRequest Contract . REQUEST _ CONTRACT _ ID ). ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġadd Command ( Request Contract . Commands . Issue (), Ġour Identity . own ing Key ) ĊĊĠĠĠĠĠĠĠ Ġprogress Tracker . current Step Ġ= ĠVERIFY _ TX ĊĠĠĠĠĠĠĠ Ġtransaction Builder . verify ( service Hub ) ĊĊĠĠĠĠĠĠĠ Ġprogress Tracker . current Step Ġ= ĠSIGN _ TX ĊĠĠĠĠĠĠĠ Ġval Ġsigned Transaction Ġ= Ġservice Hub . sign Initial Transaction ( transaction Builder ) ĊĊĠĠĠĠĠĠĠ Ġval Ġsession Ġ= Ġinitiate Flow ( output State . inter medi ary ) ĊĠĠĠĠĠĠĠ Ġsub Flow ( Send Transaction Flow ( session , signed Transaction )) ĊĊĠĠĠĠĠĠĠ Ġprogress Tracker . current Step Ġ= ĠFIN ALI SE ĊĠĠĠĠĠĠĠ Ġreturn Ġsub Flow ( Final ity Flow ( signed Transaction )) ĊĠĠĠ Ġ} Ċ } Ċ