@Before public void init() { when(jbpmWorkDefinition.getName()).thenReturn(NAME); when(jbpmWorkDefinition.getCategory()).thenReturn(CATWGORY); when(jbpmWorkDefinition.getDescription()).thenReturn(DESC); when(jbpmWorkDefinition.getDisplayName()).thenReturn(DISPLAY_NAME); when(jbpmWorkDefinition.getDocumentation()).thenReturn(DOC); when(jbpmWorkDefinition.getDefaultHandler()).thenReturn(HANDLER); when(jbpmWorkDefinition.getPath()).thenReturn(PATH); when(jbpmWorkDefinition.getIcon()).thenReturn(ICON); when(dataUriProvider.apply(eq(ICON_PATH))).thenReturn(ICON_DATA); when(param1.getName()).thenReturn("param1"); when(param1.getType()).thenReturn(new StringDataType()); when(param2.getName()).thenReturn("param2"); when(param2.getType()).thenReturn(new StringDataType()); Set<ParameterDefinition> parameters = new HashSet<ParameterDefinition>(2) {{ add(param1); add(param2); }}; when(jbpmWorkDefinition.getParameters()).thenReturn(parameters); }
workItem.setName(workDefinition.getName()); workItem.setCategory(workDefinition.getCategory()); workItem.setDocumentation(workDefinition.getDocumentation()); workItem.setDescription(workDefinition.getDescription()); workItem.setDefaultHandler(workDefinition.getDefaultHandler());
public void selectionChanged(SelectionChangedEvent event) { importButton.setEnabled(!event.getSelection().isEmpty()); if (!event.getSelection().isEmpty()) { Object selected = ((StructuredSelection) event.getSelection()).getFirstElement(); if (selected instanceof WorkDefinitionImpl) { String docs = ((WorkDefinitionImpl) selected).getDocumentation(); if (docs != null) { if (documentation != null) { documentation.setUrl(((WorkDefinitionImpl) selected).getPath() + "/" + docs); } } else { if (documentation != null) { documentation.setText(""); } } } else { if (documentation != null) { documentation.setText(""); } } } } });
myTaskDef.getVersion()); assertNotNull(myTaskDef.getDocumentation()); assertEquals("documentation for sample workitem", myTaskDef.getDocumentation());