mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? Add BusinessID search attribute option. CHASM archetype developers that require Visibility will need to call `WithBusinessIDAlias` as a required RegistrableComponent option. Adds validation if BusinessIDAlias option is not set, but contains Visibility as a child component, registration to the CHASM Registry will fail. ## Why? CHASM archetypes define separate aliases for BusinessID, eg. `ActivityID`, `ScheduleID`, etc. End users of these archetypes will query Visibility using a filter such as `ActivityID = my-activity-id`, and should be able to map to the underlying shared `system` visibility storage column. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s)
44 lines
949 B
Go
44 lines
949 B
Go
package tests
|
|
|
|
import "go.temporal.io/server/chasm"
|
|
|
|
type (
|
|
library struct {
|
|
chasm.UnimplementedLibrary
|
|
}
|
|
)
|
|
|
|
var Library = &library{}
|
|
|
|
func (l *library) Name() string {
|
|
return "tests"
|
|
}
|
|
|
|
func (l *library) Components() []*chasm.RegistrableComponent {
|
|
return []*chasm.RegistrableComponent{
|
|
chasm.NewRegistrableComponent[*PayloadStore]("payloadStore",
|
|
chasm.WithBusinessIDAlias("PayloadStoreId"),
|
|
chasm.WithSearchAttributes(
|
|
PayloadTotalCountSearchAttribute,
|
|
PayloadTotalSizeSearchAttribute,
|
|
PayloadExecutionStatusSearchAttribute,
|
|
),
|
|
),
|
|
}
|
|
}
|
|
|
|
func (l *library) Tasks() []*chasm.RegistrableTask {
|
|
return []*chasm.RegistrableTask{
|
|
chasm.NewRegistrablePureTask(
|
|
"payloadTTLPureTask",
|
|
&PayloadTTLPureTaskValidator{},
|
|
&PayloadTTLPureTaskExecutor{},
|
|
),
|
|
chasm.NewRegistrableSideEffectTask(
|
|
"payloadTTLSideEffectTask",
|
|
&PayloadTTLSideEffectTaskValidator{},
|
|
&PayloadTTLSideEffectTaskExecutor{},
|
|
),
|
|
}
|
|
}
|