Documentation ¶
Index ¶
- func EvaluateExpressionFacts(expressionFacts []situation.ExpressionFact, data map[string]interface{}) map[string]interface{}
- func ExtractHistoryDataSearch(historySituations []HistorySituationsV4, ...) search.QueryResult
- func ExtractSituationData(situationID int64, situationInstanceID int64) (situation.Situation, map[string]string, error)
- func ReplaceGlobals(service HistoryService) func()
- type GetHistorySituationsOptions
- type HistoryFactsBuilder
- func (builder HistoryFactsBuilder) GetHistoryFactLast(situationID int64, instanceID int64, factID int64) sq.SelectBuilder
- func (builder HistoryFactsBuilder) GetHistoryFacts(historyFactsIds []int64) sq.SelectBuilder
- func (builder HistoryFactsBuilder) Insert(history HistoryFactsV4, resultJSON []byte) sq.InsertBuilder
- func (builder HistoryFactsBuilder) Update(id int64, resultJSON []byte) sq.UpdateBuilder
- type HistoryFactsQuerier
- func (querier HistoryFactsQuerier) Exec(builder sq.InsertBuilder) error
- func (querier HistoryFactsQuerier) ExecUpdate(builder sq.UpdateBuilder) error
- func (querier HistoryFactsQuerier) Insert(history HistoryFactsV4) (int64, error)
- func (querier HistoryFactsQuerier) Query(builder sq.SelectBuilder) ([]HistoryFactsV4, error)
- func (querier HistoryFactsQuerier) QueryOne(builder sq.SelectBuilder) (HistoryFactsV4, error)
- func (querier HistoryFactsQuerier) QueryReturning(builder sq.InsertBuilder) (int64, error)
- func (querier HistoryFactsQuerier) Update(history HistoryFactsV4) error
- type HistoryFactsV4
- type HistoryRecordV4
- type HistoryService
- func (service HistoryService) ExtractFactData(situationID int64, instanceID int64, historyFactsNew []HistoryFactsV4, ...) ([]HistoryFactsV4, map[string]interface{}, error)
- func (service HistoryService) GetHistoryFactsFromSituation(historySituations []HistorySituationsV4) ([]HistoryFactsV4, []HistorySituationFactsV4, error)
- func (service HistoryService) GetHistoryFactsFromSituationIds(historySituationsIds []int64) ([]HistoryFactsV4, []HistorySituationFactsV4, error)
- func (service HistoryService) GetHistorySituationsIdsByCustomInterval(options GetHistorySituationsOptions, interval time.Duration, ...) ([]HistorySituationsV4, error)
- func (service HistoryService) GetHistorySituationsIdsByStandardInterval(options GetHistorySituationsOptions, interval string) ([]HistorySituationsV4, error)
- func (service HistoryService) GetHistorySituationsIdsLast(options GetHistorySituationsOptions) ([]HistorySituationsV4, error)
- type HistorySituationFactsBuilder
- type HistorySituationFactsQuerier
- type HistorySituationFactsV4
- type HistorySituationsBuilder
- func (builder HistorySituationsBuilder) GetHistorySituationsDetails(subQueryIds string, subQueryIdsArgs []interface{}) sq.SelectBuilder
- func (builder HistorySituationsBuilder) GetHistorySituationsIdsBase(options GetHistorySituationsOptions) sq.SelectBuilder
- func (builder HistorySituationsBuilder) GetHistorySituationsIdsByCustomInterval(options GetHistorySituationsOptions, interval time.Duration, ...) sq.SelectBuilder
- func (builder HistorySituationsBuilder) GetHistorySituationsIdsByStandardInterval(options GetHistorySituationsOptions, interval string) sq.SelectBuilder
- func (builder HistorySituationsBuilder) GetHistorySituationsIdsLast(options GetHistorySituationsOptions) sq.SelectBuilder
- func (builder HistorySituationsBuilder) Insert(history HistorySituationsV4, parametersJSON []byte, expressionFactsJSON []byte, ...) sq.InsertBuilder
- func (builder HistorySituationsBuilder) Update(id int64, parametersJSON []byte, expressionFactsJSON []byte, ...) sq.UpdateBuilder
- type HistorySituationsQuerier
- func (querier HistorySituationsQuerier) ExecUpdate(builder sq.UpdateBuilder) error
- func (querier HistorySituationsQuerier) Insert(history HistorySituationsV4) (int64, error)
- func (querier HistorySituationsQuerier) Query(builder sq.SelectBuilder) ([]HistorySituationsV4, error)
- func (querier HistorySituationsQuerier) QueryIDs(builder sq.SelectBuilder) ([]int64, error)
- func (querier HistorySituationsQuerier) QueryReturning(builder sq.InsertBuilder) (int64, error)
- func (querier HistorySituationsQuerier) Update(history HistorySituationsV4) error
- type HistorySituationsV4
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateExpressionFacts ¶
func EvaluateExpressionFacts(expressionFacts []situation.ExpressionFact, data map[string]interface{}) map[string]interface{}
func ExtractHistoryDataSearch ¶
func ExtractHistoryDataSearch(historySituations []HistorySituationsV4, historySituationFacts []HistorySituationFactsV4, historyFacts []HistoryFactsV4) search.QueryResult
func ExtractSituationData ¶
func ReplaceGlobals ¶
func ReplaceGlobals(service HistoryService) func()
ReplaceGlobals affect a new service to the global service singleton
Types ¶
type HistoryFactsBuilder ¶
type HistoryFactsBuilder struct{}
func (HistoryFactsBuilder) GetHistoryFactLast ¶
func (builder HistoryFactsBuilder) GetHistoryFactLast(situationID int64, instanceID int64, factID int64) sq.SelectBuilder
func (HistoryFactsBuilder) GetHistoryFacts ¶
func (builder HistoryFactsBuilder) GetHistoryFacts(historyFactsIds []int64) sq.SelectBuilder
func (HistoryFactsBuilder) Insert ¶
func (builder HistoryFactsBuilder) Insert(history HistoryFactsV4, resultJSON []byte) sq.InsertBuilder
func (HistoryFactsBuilder) Update ¶
func (builder HistoryFactsBuilder) Update(id int64, resultJSON []byte) sq.UpdateBuilder
type HistoryFactsQuerier ¶
type HistoryFactsQuerier struct { Builder HistoryFactsBuilder // contains filtered or unexported fields }
func (HistoryFactsQuerier) Exec ¶
func (querier HistoryFactsQuerier) Exec(builder sq.InsertBuilder) error
func (HistoryFactsQuerier) ExecUpdate ¶ added in v5.0.13
func (querier HistoryFactsQuerier) ExecUpdate(builder sq.UpdateBuilder) error
func (HistoryFactsQuerier) Insert ¶
func (querier HistoryFactsQuerier) Insert(history HistoryFactsV4) (int64, error)
func (HistoryFactsQuerier) Query ¶
func (querier HistoryFactsQuerier) Query(builder sq.SelectBuilder) ([]HistoryFactsV4, error)
func (HistoryFactsQuerier) QueryOne ¶
func (querier HistoryFactsQuerier) QueryOne(builder sq.SelectBuilder) (HistoryFactsV4, error)
func (HistoryFactsQuerier) QueryReturning ¶
func (querier HistoryFactsQuerier) QueryReturning(builder sq.InsertBuilder) (int64, error)
func (HistoryFactsQuerier) Update ¶ added in v5.0.13
func (querier HistoryFactsQuerier) Update(history HistoryFactsV4) error
type HistoryFactsV4 ¶
type HistoryRecordV4 ¶
type HistoryRecordV4 struct { SituationID int64 SituationInstanceID int64 Ts time.Time HistoryFacts []HistoryFactsV4 Parameters map[string]string ExpressionFacts map[string]interface{} }
HistoryRecordV4 represents a single and unique situation history entry
func (HistoryRecordV4) OverrideParameters ¶
func (hr HistoryRecordV4) OverrideParameters(p map[string]string)
OverrideParameters overrides the parameters of the History Record
type HistoryService ¶
type HistoryService struct { HistorySituationsQuerier HistorySituationsQuerier HistorySituationFactsQuerier HistorySituationFactsQuerier HistoryFactsQuerier HistoryFactsQuerier }
func New ¶
func New(db *sqlx.DB) HistoryService
func (HistoryService) ExtractFactData ¶
func (service HistoryService) ExtractFactData(situationID int64, instanceID int64, historyFactsNew []HistoryFactsV4, existingFactIDs []int64) ([]HistoryFactsV4, map[string]interface{}, error)
Flatten situation data (old and new facts + parameters)
func (HistoryService) GetHistoryFactsFromSituation ¶
func (service HistoryService) GetHistoryFactsFromSituation(historySituations []HistorySituationsV4) ([]HistoryFactsV4, []HistorySituationFactsV4, error)
func (HistoryService) GetHistoryFactsFromSituationIds ¶
func (service HistoryService) GetHistoryFactsFromSituationIds(historySituationsIds []int64) ([]HistoryFactsV4, []HistorySituationFactsV4, error)
func (HistoryService) GetHistorySituationsIdsByCustomInterval ¶
func (service HistoryService) GetHistorySituationsIdsByCustomInterval(options GetHistorySituationsOptions, interval time.Duration, referenceDate time.Time) ([]HistorySituationsV4, error)
func (HistoryService) GetHistorySituationsIdsByStandardInterval ¶
func (service HistoryService) GetHistorySituationsIdsByStandardInterval(options GetHistorySituationsOptions, interval string) ([]HistorySituationsV4, error)
func (HistoryService) GetHistorySituationsIdsLast ¶
func (service HistoryService) GetHistorySituationsIdsLast(options GetHistorySituationsOptions) ([]HistorySituationsV4, error)
type HistorySituationFactsBuilder ¶
type HistorySituationFactsBuilder struct{}
func (HistorySituationFactsBuilder) GetHistorySituationFacts ¶
func (builder HistorySituationFactsBuilder) GetHistorySituationFacts(historySituationsIds []int64) sq.SelectBuilder
func (HistorySituationFactsBuilder) InsertBulk ¶
func (builder HistorySituationFactsBuilder) InsertBulk(historySituationFacts []HistorySituationFactsV4) sq.InsertBuilder
type HistorySituationFactsQuerier ¶
type HistorySituationFactsQuerier struct { Builder HistorySituationFactsBuilder // contains filtered or unexported fields }
func (HistorySituationFactsQuerier) Execute ¶
func (querier HistorySituationFactsQuerier) Execute(builder sq.InsertBuilder) error
func (HistorySituationFactsQuerier) Query ¶
func (querier HistorySituationFactsQuerier) Query(builder sq.SelectBuilder) ([]HistorySituationFactsV4, error)
type HistorySituationFactsV4 ¶
type HistorySituationsBuilder ¶
type HistorySituationsBuilder struct{}
func (HistorySituationsBuilder) GetHistorySituationsDetails ¶
func (builder HistorySituationsBuilder) GetHistorySituationsDetails(subQueryIds string, subQueryIdsArgs []interface{}) sq.SelectBuilder
func (HistorySituationsBuilder) GetHistorySituationsIdsBase ¶
func (builder HistorySituationsBuilder) GetHistorySituationsIdsBase(options GetHistorySituationsOptions) sq.SelectBuilder
func (HistorySituationsBuilder) GetHistorySituationsIdsByCustomInterval ¶
func (builder HistorySituationsBuilder) GetHistorySituationsIdsByCustomInterval(options GetHistorySituationsOptions, interval time.Duration, referenceDate time.Time) sq.SelectBuilder
func (HistorySituationsBuilder) GetHistorySituationsIdsByStandardInterval ¶
func (builder HistorySituationsBuilder) GetHistorySituationsIdsByStandardInterval(options GetHistorySituationsOptions, interval string) sq.SelectBuilder
func (HistorySituationsBuilder) GetHistorySituationsIdsLast ¶
func (builder HistorySituationsBuilder) GetHistorySituationsIdsLast(options GetHistorySituationsOptions) sq.SelectBuilder
func (HistorySituationsBuilder) Insert ¶
func (builder HistorySituationsBuilder) Insert(history HistorySituationsV4, parametersJSON []byte, expressionFactsJSON []byte, metadatasJSON []byte) sq.InsertBuilder
func (HistorySituationsBuilder) Update ¶ added in v5.0.13
func (builder HistorySituationsBuilder) Update(id int64, parametersJSON []byte, expressionFactsJSON []byte, metadatasJSON []byte) sq.UpdateBuilder
type HistorySituationsQuerier ¶
type HistorySituationsQuerier struct { Builder HistorySituationsBuilder // contains filtered or unexported fields }
func (HistorySituationsQuerier) ExecUpdate ¶ added in v5.0.13
func (querier HistorySituationsQuerier) ExecUpdate(builder sq.UpdateBuilder) error
func (HistorySituationsQuerier) Insert ¶
func (querier HistorySituationsQuerier) Insert(history HistorySituationsV4) (int64, error)
func (HistorySituationsQuerier) Query ¶
func (querier HistorySituationsQuerier) Query(builder sq.SelectBuilder) ([]HistorySituationsV4, error)
func (HistorySituationsQuerier) QueryIDs ¶
func (querier HistorySituationsQuerier) QueryIDs(builder sq.SelectBuilder) ([]int64, error)
func (HistorySituationsQuerier) QueryReturning ¶
func (querier HistorySituationsQuerier) QueryReturning(builder sq.InsertBuilder) (int64, error)
func (HistorySituationsQuerier) Update ¶ added in v5.0.13
func (querier HistorySituationsQuerier) Update(history HistorySituationsV4) error
type HistorySituationsV4 ¶
Click to show internal directories.
Click to hide internal directories.