SingleSessionCommandService service = jpaService.newStatefulKnowledgeSession();
int sessionId = service.getSessionId();
log.info("---> created SingleSessionCommandService id: " + sessionId);
StartProcessCommand startProcessCommand = new StartProcessCommand("com.sample.ruleflow");
log.info("### Starting process ###");
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("x", "SomeString");
parameters.put("y", new MyEntity("This is a test Entity with annotation in fields"));
parameters.put("m", new MyEntityMethods("This is a test Entity with annotations in methods"));
parameters.put("f", new MyEntityOnlyFields("This is a test Entity with annotations in fields and without accesors methods"));
parameters.put("z", new MyVariableSerializable("This is a test SerializableObject"));
startProcessCommand.setParameters(parameters);
WorkflowProcessInstance processInstance = (WorkflowProcessInstance) service.execute( startProcessCommand );
log.info( "Started process instance {}", processInstance.getId() );
TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
WorkItem workItem = handler.getWorkItem();