use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition in project kie-wb-common by kiegroup.
the class WorkItemDefinitionClientParserTest method testMissingDisplayName.
@Test
public void testMissingDisplayName() {
String widFile = loadTestFile(MISSING_DISPLAY_NAME_WID_FILE);
List<WorkItemDefinition> defs = WorkItemDefinitionClientParser.parse(widFile);
assertEquals(1, defs.size());
WorkItemDefinition wid = defs.get(0);
assertEquals("Email", wid.getName());
assertEquals("", wid.getDisplayName());
assertEquals("defaultemailicon.gif", wid.getIconDefinition().getUri());
assertEquals(BPMNCategories.CUSTOM_TASKS, wid.getCategory());
assertEquals("Some documentation", wid.getDocumentation());
assertTrue(wid.getResults().isEmpty());
assertEquals(EMAIL_WID_EXTRACTED_PARAMETERS, wid.getParameters());
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition in project kie-wb-common by kiegroup.
the class CustomTaskShapeViewHandlerTest method testHandleIconDefinitionNull.
@Test
@SuppressWarnings("unchecked")
public void testHandleIconDefinitionNull() {
final WorkItemDefinition wid = mock(WorkItemDefinition.class);
when(wid.getIconDefinition()).thenReturn(null);
when(registry.get(eq(WID_ID))).thenReturn(wid);
checkIconLoad(WorkItemDefinitionClientUtils.getDefaultIconData());
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition in project kie-wb-common by kiegroup.
the class CustomTaskShapeViewHandlerTest method testHandleIconDataNull.
@Test
@SuppressWarnings("unchecked")
public void testHandleIconDataNull() {
final WorkItemDefinition wid = mock(WorkItemDefinition.class);
final IconDefinition iconDef = mock(IconDefinition.class);
when(iconDef.getIconData()).thenReturn(null);
when(wid.getIconDefinition()).thenReturn(iconDef);
when(registry.get(eq(WID_ID))).thenReturn(wid);
checkIconLoad(WorkItemDefinitionClientUtils.getDefaultIconData());
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition in project kie-wb-common by kiegroup.
the class WorkItemDefinitionParser method emptyWid.
public static WorkItemDefinition emptyWid() {
WorkItemDefinition wid = new WorkItemDefinition();
wid.setIconDefinition(new IconDefinition());
wid.getIconDefinition().setUri("");
wid.setUri("");
wid.setName("");
wid.setCategory("");
wid.setDescription("");
wid.setDocumentation("");
wid.setDisplayName("");
wid.setResults("");
wid.setDefaultHandler("");
wid.setDependencies(new Dependencies(Collections.emptyList()));
wid.setParameters("");
return wid;
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition in project kie-wb-common by kiegroup.
the class WorkItemDefinitionRemoteDeployService method deploy.
void deploy(final Metadata metadata, final String url, final String names) {
if (null != url && url.trim().length() > 0) {
final Collection<WorkItemDefinition> items = remoteLookupService.execute(WorkItemDefinitionRemoteRequest.build(url, names));
final List<Asset> assets = items.stream().flatMap(this::toAssets).collect(Collectors.toList());
if (!assets.isEmpty()) {
// Deploy into file system.
backendFileSystemManager.deploy(resources.resolveResourcesPath(metadata), new Assets(assets), DEPLOY_MESSAGE + url);
// Install into current KIE runtime.
projectInstaller.install(items, metadata);
}
}
}
Aggregations