189
startFn func(chasm.MutableContext) (chasm.RootComponent, error),
190
options chasm.TransitionOptions,
191
>
) (result chasm.StartExecutionResult, retErr error) {
chasm_engine.go
192
>
shardContext, err := e.getShardContext(executionRef)
193
>
if err != nil {
194
return chasm.StartExecutionResult{}, err
195
}
196
197
>
archetypeID, err := executionRef.ArchetypeID(e.registry)
chasm_engine.go
198
>
if err != nil {
199
return chasm.StartExecutionResult{}, err
200
}
201
203
return chasm.StartExecutionResult{}, serviceerror.NewUnimplemented("setting runID is not supported for StartExecution")
204
}
205
206
>
currentExecutionReleaseFn, err := e.lockCurrentExecution(
chasm_engine.go
207
>
ctx,
208
>
shardContext,
209
>
namespace.ID(executionRef.NamespaceID),
210
>
executionRef.BusinessID,
211
>
archetypeID,
212
>
)
213
>
if err != nil {
214
return chasm.StartExecutionResult{}, err
215
}
217
>
currentExecutionReleaseFn(retErr)
218
>
}()
219
221
>
ctx,
222
>
shardContext,
223
>
executionRef,
224
>
archetypeID,
225
>
startFn,
226
>
options,
227
>
)
228
>
if err != nil {
229
return chasm.StartExecutionResult{}, err
230
}
231
232
>
currentRunInfo, hasCurrentRun, err := e.persistAsBrandNew(
chasm_engine.go
233
>
ctx,
234
>
shardContext,
235
>
newExecutionParams,
236
>
)
237
>
if err != nil {
238
// Even though Created is false, it's not guaranteed the execution wasn't created.
239
// The persistence layer writes history events outside the main transaction, so on errors