Skip to content

Commit

Permalink
fix(CompiledGraph): when asNode is provided next node is evaluated ke…
Browse files Browse the repository at this point in the history
…eping in consideration edges

work on #14
  • Loading branch information
bsorrentino committed Aug 31, 2024
1 parent 0d7b1df commit d3595cb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ public RunnableConfig updateState( RunnableConfig config, Map<String,Object> val
.map( cp -> cp.updateState(values, stateGraph.getChannels()) )
.orElseThrow( () -> (new IllegalStateException("Missing Checkpoint!")) );

String nextNodeId = null;
if( asNode != null ) {
nextNodeId = nextNodeId( asNode, stateGraph.getStateFactory().apply(updatedCheckpoint.getState()) );
}
// update checkpoint in saver
var newConfig = saver.put( config, updatedCheckpoint );

return RunnableConfig.builder(newConfig)
.checkPointId( updatedCheckpoint.getId() )
.nextNode( asNode )
.nextNode( nextNodeId )
.build();
}

Expand Down

0 comments on commit d3595cb

Please sign in to comment.