Availability of simulator #194
Replies: 5 comments 1 reply
-
We will provide documentation soon, for now you can take a look how to enable simulator in the story: You will need to pass trace to the decision graph as well |
Beta Was this translation helpful? Give feedback.
-
Thank you for your assistance, @ivanmiletic. I have implemented the provided code, and the simulator is now visible in the UI. However, I am encountering an issue where running the simulator does not yield any response. Could you please assist me in resolving this issue? Additionally, I need guidance on how to pass trace in decision graph. I have attached the input JSON file for the decision graph for your reference. input json for simulator:
|
Beta Was this translation helpful? Give feedback.
-
@stefan-gorules @ivanmiletic can you please help? |
Beta Was this translation helpful? Give feedback.
-
Hi @divyeshk31 this is not something that we can tackle at least this week as we have priorities for our Enterprise customers |
Beta Was this translation helpful? Give feedback.
-
hi @ranakapil071996 import {
DecisionGraph,
JdmConfigProvider,
GraphSimulator,
GraphNode,
createJdmNode,
Simulation,
SimulationOk
} from "@gorules/jdm-editor";
function App() {
const [value, setValue] = useState();
const [graphTrace, setGraphTrace] = useState<Simulation>();
const ref = useRef(null);
const panels = [
{
id: "simulator",
title: "Simulator",
icon: <PlayCircleOutlined />,
renderPanel: () => (
<GraphSimulator
defaultRequest={json5.stringify(
{
age: 20,
},
null,
2
)}
onChange={(val) => {
console.log(val);
}}
onRun={({ graph, context }) => {
// invoke the ZEN engine
const result = yourZenEngine.evaluate(graph, context);
setGraphTrace({result})
}}
onClear={() => {}}
/>
),
},
];
return (
<div style={{ height: "100%" }}>
<JdmConfigProvider>
<DecisionGraph
ref={ref}
value={value}
onChange={(val) => setValue(val)}
simulate={graphTrace}
panels={panels}
defaultActivePanel={"simulator"}
onPanelsChange={(val) => {
console.log(val);
}}
/>
</JdmConfigProvider>
</div>
);
}
export default App; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Unable to simulate the graph because the option is not visible in the open-source code. How can I enable it?
Beta Was this translation helpful? Give feedback.
All reactions