DDConfigUpdater { public String parseWorkitemValue(String value) { if (value.trim().toLowerCase().startsWith(MVEL_PREFIX)) { return value.trim().substring(MVEL_PREFIX.length()).trim(); } else if (value.trim().toLowerCase().startsWith(REFLECTION_PREFIX)) { return value.trim().substring(REFLECTION_PREFIX.length()).trim(); } else { return value.trim(); } } DDConfigUpdater(); @Inject  DDConfigUpdater(DDEditorService ddEditorService,
                           KieModuleService moduleService,
                           DDConfigUpdaterHelper configUpdaterHelper); void processResourceAdd(@Observes final ResourceAddedEvent resourceAddedEvent); void processResourceUpdate(@Observes final ResourceUpdatedEvent resourceUpdatedEvent); void processWorkitemInstall(@Observes final DesignerWorkitemInstalledEvent workitemInstalledEvent); void processServiceTaskEvent(@Observes final ServiceTaskResourceEvent serviceResourceEvent); String parseWorkitemValue(String value); String getWorkitemResolver(String value,
                                      String defaultResolver); boolean isValidWorkitem(String name, String value);  }
@Test public void testParseWorkitemValue() { assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue("new com.myhandlers.MyHandler()")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue(" new com.myhandlers.MyHandler()")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue("new com.myhandlers.MyHandler() ")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue("mvel: new com.myhandlers.MyHandler()")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue("reflection: new com.myhandlers.MyHandler()")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue("MVEL: new com.myhandlers.MyHandler()")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue("REFLECTION: new com.myhandlers.MyHandler()")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue(" MveL: new com.myhandlers.MyHandler()")); assertEquals("new com.myhandlers.MyHandler()", ddConfigUpdater.parseWorkitemValue(" ReFlEcTIoN:new com.myhandlers.MyHandler() ")); }