@seera/elaa-rule-engine-react-lib
v0.7.8
Published
Policy rule engine
Downloads
35
Readme
rule-engine-react-lib
Made with create-react-library
Install
npm install --save rule-engine-react-lib
Usage
import React, {useRef} from 'react';
import Draw from '@seera/elaa-rule-engine-react-lib';
import '@seera/elaa-rule-engine-react-lib/css/DrawComponent.css';
import Rules from './Rules';
//import {initialDiagram, otherDiagram} from './Diagrams';
function App() {
const onSubmit = (data) => {
console.log(data);
console.log(JSON.stringify(data.ruleDefinition));
}
const onPreview = (ruleDefinition) => {
console.log(ruleDefinition);
console.log(JSON.stringify(ruleDefinition));
}
return (
<>
<div className="workflow">
<Draw rules={Rules}
saveEnabled={false}
loadEnabled={false}
exportEnabled={false}
fullScreenEnabled={false}
onSubmit={onSubmit}
onPreview={onPreview}
loadWorkflow={initialDiagram}
resetEnabled={true}
lang={"en"}
/>
</div>
</>
);
}
export default App;
License
MIT © ricardopaulotajawal