Search in sources :

Example 11 with ObjectModelResolver

use of org.kie.internal.runtime.conf.ObjectModelResolver in project jbpm by kiegroup.

the class ReflectionObjectModelResolverTest method testSimpleContextValueObjectModel.

@Test
public void testSimpleContextValueObjectModel() {
    ObjectModel model = new ObjectModel("org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject", new Object[] { "context" });
    ObjectModelResolver resolver = new ReflectionObjectModelResolver();
    Map<String, Object> contextParam = new HashMap<String, Object>();
    contextParam.put("context", "value from the context");
    Object result = resolver.getInstance(model, this.getClass().getClassLoader(), contextParam);
    assertNotNull(result);
    assertTrue(result instanceof SimpleCustomObject);
    assertEquals("value from the context", ((SimpleCustomObject) result).getName());
}
Also used : ObjectModel(org.kie.internal.runtime.conf.ObjectModel) NamedObjectModel(org.kie.internal.runtime.conf.NamedObjectModel) HashMap(java.util.HashMap) ObjectModelResolver(org.kie.internal.runtime.conf.ObjectModelResolver) ThirdLevelCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) EmbedingCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) Test(org.junit.Test)

Aggregations

ObjectModelResolver (org.kie.internal.runtime.conf.ObjectModelResolver)11 SimpleCustomObject (org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject)10 Test (org.junit.Test)10 ObjectModel (org.kie.internal.runtime.conf.ObjectModel)10 EmbedingCustomObject (org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject)7 ThirdLevelCustomObject (org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject)7 NamedObjectModel (org.kie.internal.runtime.conf.NamedObjectModel)7 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 CaseEventListener (org.jbpm.casemgmt.api.event.CaseEventListener)1 NotifyParentCaseEventListener (org.jbpm.casemgmt.impl.wih.NotifyParentCaseEventListener)1 Cacheable (org.kie.internal.runtime.Cacheable)1 Closeable (org.kie.internal.runtime.Closeable)1 DeploymentDescriptor (org.kie.internal.runtime.conf.DeploymentDescriptor)1