Search in sources :

Example 1 with QueryBasedWorkflowInput

use of com.graphaware.nlp.workflow.input.QueryBasedWorkflowInput in project neo4j-nlp by graphaware.

the class DynamicConfigurationTest method testWorfklowItemsInfosShouldBeLoadedFromPreviousState.

@Test
public void testWorfklowItemsInfosShouldBeLoadedFromPreviousState() throws Exception {
    resetSingleton();
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
    keyValueStore = new GraphKeyValueStore(getDatabase());
    QueryBasedWorkflowInput workflowInput = new QueryBasedWorkflowInput("test", getDatabase());
    DynamicConfiguration configuration = new DynamicConfiguration(getDatabase());
    workflowInput.setConfiguration(new WorkflowInputQueryConfiguration(new HashMap<>()));
    try (Transaction tx = getDatabase().beginTx()) {
        configuration.storeWorkflowInstanceItem(workflowInput);
        tx.success();
    }
    GraphAwareRuntime runtime = GraphAwareRuntimeFactory.createRuntime(getDatabase());
    runtime.registerModule(new NLPModule("NLP", NLPConfiguration.defaultConfiguration(), getDatabase()));
    runtime.start();
    runtime.waitUntilStarted();
}
Also used : WorkflowInputQueryConfiguration(com.graphaware.nlp.workflow.input.WorkflowInputQueryConfiguration) Transaction(org.neo4j.graphdb.Transaction) HashMap(java.util.HashMap) GraphAwareRuntime(com.graphaware.runtime.GraphAwareRuntime) NLPModule(com.graphaware.nlp.module.NLPModule) GraphKeyValueStore(com.graphaware.common.kv.GraphKeyValueStore) QueryBasedWorkflowInput(com.graphaware.nlp.workflow.input.QueryBasedWorkflowInput) ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Test(org.junit.Test) AbstractEmbeddedTest(com.graphaware.nlp.AbstractEmbeddedTest)

Aggregations

GraphKeyValueStore (com.graphaware.common.kv.GraphKeyValueStore)1 AbstractEmbeddedTest (com.graphaware.nlp.AbstractEmbeddedTest)1 NLPModule (com.graphaware.nlp.module.NLPModule)1 QueryBasedWorkflowInput (com.graphaware.nlp.workflow.input.QueryBasedWorkflowInput)1 WorkflowInputQueryConfiguration (com.graphaware.nlp.workflow.input.WorkflowInputQueryConfiguration)1 GraphAwareRuntime (com.graphaware.runtime.GraphAwareRuntime)1 HashMap (java.util.HashMap)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 Test (org.junit.Test)1 Transaction (org.neo4j.graphdb.Transaction)1