@@ -1116,15 +1116,9 @@ func (s *systemDatabase) Recv(ctx context.Context, input WorkflowRecvInput) (any
11161116 // Check if operation was already executed
11171117 // XXX this might not need to be in the transaction
11181118 checkInput := checkOperationExecutionDBInput {
1119- << << << < HEAD
11201119 workflowID : destinationID ,
11211120 stepID : stepID ,
11221121 stepName : functionName ,
1123- == == == =
1124- workflowID : destinationID ,
1125- operationID : stepID ,
1126- functionName : functionName ,
1127- >> >> >> > origin / main
11281122 }
11291123 recordedResult , err := s .CheckOperationExecution (ctx , checkInput )
11301124 if err != nil {
@@ -1245,7 +1239,6 @@ func (s *systemDatabase) SetEvent(ctx context.Context, input WorkflowSetEventInp
12451239 functionName := "DBOS.setEvent"
12461240
12471241 // Get workflow state from context
1248- << << << < HEAD
12491242 wfState , ok := ctx .Value (workflowStateKey ).(* workflowState )
12501243 if ! ok || wfState == nil {
12511244 return newStepExecutionError ("" , functionName , "workflow state not found in context: are you running this step within a workflow?" )
@@ -1256,18 +1249,6 @@ func (s *systemDatabase) SetEvent(ctx context.Context, input WorkflowSetEventInp
12561249 }
12571250
12581251 stepID := wfState .NextStepID ()
1259- == == == =
1260- workflowState , ok := ctx .Value (WorkflowStateKey ).(* WorkflowState )
1261- if ! ok || workflowState == nil {
1262- return newStepExecutionError ("" , functionName , "workflow state not found in context: are you running this step within a workflow?" )
1263- }
1264-
1265- if workflowState .isWithinStep {
1266- return newStepExecutionError (workflowState .WorkflowID , functionName , "cannot call SetEvent within a step" )
1267- }
1268-
1269- stepID := workflowState .NextStepID ()
1270- >> >> >> > origin / main
12711252
12721253 tx , err := s .pool .Begin (ctx )
12731254 if err != nil {
@@ -1277,17 +1258,10 @@ func (s *systemDatabase) SetEvent(ctx context.Context, input WorkflowSetEventInp
12771258
12781259 // Check if operation was already executed and do nothing if so
12791260 checkInput := checkOperationExecutionDBInput {
1280- << << << < HEAD
12811261 workflowID : wfState .workflowID ,
12821262 stepID : stepID ,
12831263 stepName : functionName ,
12841264 tx : tx ,
1285- == == == =
1286- workflowID : workflowState .WorkflowID ,
1287- operationID : stepID ,
1288- functionName : functionName ,
1289- tx : tx ,
1290- >> >> >> > origin / main
12911265 }
12921266 recordedResult , err := s .CheckOperationExecution (ctx , checkInput )
12931267 if err != nil {
@@ -1310,32 +1284,19 @@ func (s *systemDatabase) SetEvent(ctx context.Context, input WorkflowSetEventInp
13101284 ON CONFLICT (workflow_uuid, key)
13111285 DO UPDATE SET value = EXCLUDED.value`
13121286
1313- << << << < HEAD
13141287 _ , err = tx .Exec (ctx , insertQuery , wfState .workflowID , input .Key , messageString )
1315- == == == =
1316- _, err = tx .Exec (ctx , insertQuery , workflowState .WorkflowID , input .Key , messageString )
1317- >> >> >> > origin / main
13181288 if err != nil {
13191289 return fmt .Errorf ("failed to insert/update workflow event: %w" , err )
13201290 }
13211291
13221292 // Record the operation result
13231293 recordInput := recordOperationResultDBInput {
1324- << << << < HEAD
13251294 workflowID : wfState .workflowID ,
13261295 stepID : stepID ,
13271296 stepName : functionName ,
13281297 output : nil ,
13291298 err : nil ,
13301299 tx : tx ,
1331- == == == =
1332- workflowID : workflowState .WorkflowID ,
1333- operationID : stepID ,
1334- operationName : functionName ,
1335- output : nil ,
1336- err : nil ,
1337- tx : tx ,
1338- >> >> >> > origin / main
13391300 }
13401301
13411302 err = s .RecordOperationResult (ctx , recordInput )
@@ -1355,7 +1316,6 @@ func (s *systemDatabase) GetEvent(ctx context.Context, input WorkflowGetEventInp
13551316 functionName := "DBOS.getEvent"
13561317
13571318 // Get workflow state from context (optional for GetEvent as we can get an event from outside a workflow)
1358- << << << < HEAD
13591319 wfState , ok := ctx .Value (workflowStateKey ).(* workflowState )
13601320 var stepID int
13611321 var isInWorkflow bool
@@ -1372,24 +1332,6 @@ func (s *systemDatabase) GetEvent(ctx context.Context, input WorkflowGetEventInp
13721332 workflowID : wfState .workflowID ,
13731333 stepID : stepID ,
13741334 stepName : functionName ,
1375- == == == =
1376- workflowState , ok := ctx .Value (WorkflowStateKey ).(* WorkflowState )
1377- var stepID int
1378- var isInWorkflow bool
1379-
1380- if ok && workflowState != nil {
1381- isInWorkflow = true
1382- if workflowState.isWithinStep {
1383- return nil , newStepExecutionError (workflowState .WorkflowID , functionName , "cannot call GetEvent within a step" )
1384- }
1385- stepID = workflowState .NextStepID ()
1386-
1387- // Check if operation was already executed (only if in workflow)
1388- checkInput := checkOperationExecutionDBInput {
1389- workflowID : workflowState .WorkflowID ,
1390- operationID : stepID ,
1391- functionName : functionName ,
1392- >> >> >> > origin / main
13931335 }
13941336 recordedResult , err := s .CheckOperationExecution (ctx , checkInput )
13951337 if err != nil {
@@ -1472,19 +1414,11 @@ func (s *systemDatabase) GetEvent(ctx context.Context, input WorkflowGetEventInp
14721414 // Record the operation result if this is called within a workflow
14731415 if isInWorkflow {
14741416 recordInput := recordOperationResultDBInput {
1475- << << << < HEAD
14761417 workflowID : wfState .workflowID ,
14771418 stepID : stepID ,
14781419 stepName : functionName ,
14791420 output : value ,
14801421 err : nil ,
1481- == == == =
1482- workflowID : workflowState .WorkflowID ,
1483- operationID : stepID ,
1484- operationName : functionName ,
1485- output : value ,
1486- err : nil ,
1487- >> >> >> > origin / main
14881422 }
14891423
14901424 err = s .RecordOperationResult (ctx , recordInput )
0 commit comments