use of org.jbpm.process.workitem.WorkDefinitionImpl in project kie-wb-common by kiegroup.
the class WorkItemDefinitionParser method parseJBPMWorkItemDefinitions.
@SuppressWarnings("unchecked")
private static Map<String, WorkDefinitionImpl> parseJBPMWorkItemDefinitions(final String content, final Function<String, String> dataUriProvider) throws Exception {
final List<Map<String, Object>> workDefinitionsMaps = (List<Map<String, Object>>) WidMVELEvaluator.eval(content);
final Map<String, WorkDefinitionImpl> result = new HashMap<>(workDefinitionsMaps.size());
for (Map<String, Object> workDefinitionMap : workDefinitionsMaps) {
if (workDefinitionMap != null) {
String origWidName = ((String) workDefinitionMap.get("name")).replaceAll("\\s", "");
Matcher widNameMatcher = UNICODE_WORDS_PATTERN.matcher(origWidName);
if (widNameMatcher.matches()) {
final WorkDefinitionImpl workDefinition = parseMVELWorkItemDefinition(workDefinitionMap, dataUriProvider, widNameMatcher.group());
result.put(workDefinition.getName(), workDefinition);
} else {
LOG.error("The work item has an invalid name [ " + workDefinitionMap.get("name") + "]." + "It must contain words only, skipping it.");
}
}
}
return result;
}
use of org.jbpm.process.workitem.WorkDefinitionImpl in project jbpm-work-items by kiegroup.
the class JavaHandlerWorkitemIntegrationTest method testWorkitemValidity.
@Test
public void testWorkitemValidity() {
String repoPath = "file://" + System.getProperty("builddir") + "/" + System.getProperty("artifactId") + "-" + System.getProperty("version") + "/repository";
Map<String, WorkDefinitionImpl> repoResults = new WorkItemRepository().getWorkDefinitions(repoPath, null, System.getProperty("artifactId"));
assertNotNull(repoResults);
assertEquals(2, repoResults.size());
assertTrue(repoResults.containsKey("Java"));
assertTrue(repoResults.containsKey("JavaInvocation"));
}
use of org.jbpm.process.workitem.WorkDefinitionImpl in project jbpm-work-items by kiegroup.
the class JiraWorkitemIntegrationTest method testWorkitemValidity.
@Test
public void testWorkitemValidity() {
String repoPath = "file://" + System.getProperty("builddir") + "/" + System.getProperty("artifactId") + "-" + System.getProperty("version") + "/repository";
Map<String, WorkDefinitionImpl> repoResults = new WorkItemRepository().getWorkDefinitions(repoPath, null, System.getProperty("artifactId"));
assertNotNull(repoResults);
assertEquals(4, repoResults.size());
assertTrue(repoResults.containsKey("JiraAddComment"));
assertTrue(repoResults.containsKey("JiraCreateIssue"));
assertTrue(repoResults.containsKey("JiraJqlSearch"));
assertTrue(repoResults.containsKey("JiraResolveIssue"));
}
use of org.jbpm.process.workitem.WorkDefinitionImpl in project jbpm-work-items by kiegroup.
the class ParserWorkitemIntegrationTest method testWorkitemValidity.
@Test
public void testWorkitemValidity() {
String repoPath = "file://" + System.getProperty("builddir") + "/" + System.getProperty("artifactId") + "-" + System.getProperty("version") + "/repository";
Map<String, WorkDefinitionImpl> repoResults = new WorkItemRepository().getWorkDefinitions(repoPath, null, System.getProperty("artifactId"));
assertNotNull(repoResults);
assertEquals(1, repoResults.size());
assertTrue(repoResults.containsKey("Parser"));
}
use of org.jbpm.process.workitem.WorkDefinitionImpl in project jbpm-work-items by kiegroup.
the class TwitterWorkitemIntegrationTest method testWorkitemValidity.
@Test
public void testWorkitemValidity() {
String repoPath = "file://" + System.getProperty("builddir") + "/" + System.getProperty("artifactId") + "-" + System.getProperty("version") + "/repository";
Map<String, WorkDefinitionImpl> repoResults = new WorkItemRepository().getWorkDefinitions(repoPath, null, System.getProperty("artifactId"));
assertNotNull(repoResults);
assertEquals(2, repoResults.size());
assertTrue(repoResults.containsKey("TwitterUpdateStatus"));
assertTrue(repoResults.containsKey("TwitterSendDirectMessage"));
}
Aggregations