Documentation ¶
Index ¶
- func Bytetoobj(config []byte) (types.TranCode, error)
- func Configtoobj(config string) (types.TranCode, error)
- func Execute(trancode string, data map[string]interface{}, ...) (map[string]interface{}, error)
- func ExecuteUnitTest(trancode string, systemsessions map[string]interface{}) (map[string]interface{}, error)
- func ExecuteUnitTestWithTestData(trancode string, testcase map[string]interface{}, ...) (map[string]interface{}, error)
- func ExecutebyExternal(trancode string, data map[string]interface{}, DBTx *sql.Tx, ...) (map[string]interface{}, error)
- func GetTranCodeDatabyCode(Code string) (types.TranCode, error)
- func GetTransCode(name string) (types.TranCode, error)
- type TranCodeData
- type TranFlow
- type TranFlowstr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteUnitTest ¶
func ExecutebyExternal ¶
func GetTransCode ¶
GetTransCode retrieves the transaction code for the given name. It reads the transaction code configuration file and returns the corresponding TranCode object. If an error occurs during the process, it returns an empty TranCode object and an error.
Types ¶
type TranCodeData ¶
type TranCodeData struct { TranCode string `json:"code"` // contains filtered or unexported fields }
type TranFlow ¶
type TranFlow struct { Tcode types.TranCode DBTx *sql.Tx Ctx context.Context CtxCancel context.CancelFunc Externalinputs map[string]interface{} // {sessionanme: value} SystemSession map[string]interface{} DocDBCon *documents.DocDB SignalRClient signalr.Client ErrorMessage string TestwithSc bool TestResults map[string]interface{} // contains filtered or unexported fields }
func NewTranFlow ¶
func (*TranFlow) Execute ¶
Execute executes the transaction flow. It starts the timer to measure the execution time and logs the performance duration. It recovers from any panics and logs the error message. It retrieves the system session, external inputs, and external outputs from the transaction flow. It starts a new database transaction if one doesn't exist. It starts a new context with a timeout if one doesn't exist. It executes the first function group of the transaction code and iterates through subsequent function groups until the code is no longer 1. It commits the database transaction if it was started in this function. It returns the external outputs and nil error if successful.
type TranFlowstr ¶
type TranFlowstr struct {
TestwithSc bool `json:"TestwithSc,omitempty"`
}