use of org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallBusinessRuleTaskAssignments.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallBusinessRuleTaskAssignments() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_BUSINESSRULETASKASSIGNMENTS);
assertDiagram(diagram, 4);
assertEquals("BusinessRuleTaskAssignments", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> businessRuleNode = diagram.getGraph().getNode("_45C2C340-D1D0-4D63-8419-EF38F9E73507");
BusinessRuleTask businessRuleTask = (BusinessRuleTask) businessRuleNode.getContent().getDefinition();
assertEquals(businessRuleTask.getTaskType().getValue(), TaskTypes.BUSINESS_RULE);
DataIOSet dataIOSet = businessRuleTask.getDataIOSet();
AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo();
assertEquals(assignmentsinfo.getValue(), "|input1:String,input2:String||output1:String,output2:String|[din]pv1->input1,[din]pv2->input2,[dout]output1->pv2,[dout]output2->pv2");
}
use of org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallBusinessRuleTask.
@Test
public void testUnmarshallBusinessRuleTask() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_BUSINESSRULETASKRULEFLOWGROUP);
BusinessRuleTask businessRuleTask = null;
Iterator<Element> it = nodesIterator(diagram);
while (it.hasNext()) {
Element element = it.next();
if (element.getContent() instanceof View) {
Object oDefinition = ((View) element.getContent()).getDefinition();
if (oDefinition instanceof BusinessRuleTask) {
businessRuleTask = (BusinessRuleTask) oDefinition;
break;
}
}
}
assertNotNull(businessRuleTask);
assertNotNull(businessRuleTask.getExecutionSet());
assertNotNull(businessRuleTask.getExecutionSet().getRuleFlowGroup());
assertNotNull(businessRuleTask.getGeneral());
assertNotNull(businessRuleTask.getGeneral().getName());
assertEquals(businessRuleTask.getTaskType().getValue(), TaskTypes.BUSINESS_RULE);
assertEquals("my business rule task", businessRuleTask.getGeneral().getName().getValue());
assertEquals("my-ruleflow-group", businessRuleTask.getExecutionSet().getRuleFlowGroup().getValue());
assertEquals("true", businessRuleTask.getExecutionSet().getIsAsync().getValue().toString());
assertEquals("true", businessRuleTask.getExecutionSet().getIsAsync().getValue().toString());
assertEquals("System.out.println(\"Hello\");", businessRuleTask.getExecutionSet().getOnEntryAction().getValue().getValues().get(0).getScript());
assertEquals("java", businessRuleTask.getExecutionSet().getOnEntryAction().getValue().getValues().get(0).getLanguage());
assertEquals("System.out.println(\"Bye\");", businessRuleTask.getExecutionSet().getOnExitAction().getValue().getValues().get(0).getScript());
assertEquals("java", businessRuleTask.getExecutionSet().getOnExitAction().getValue().getValues().get(0).getLanguage());
}
use of org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask in project kie-wb-common by kiegroup.
the class ContextUtilsTest method testIsFormGenerationSupported.
@Test
public void testIsFormGenerationSupported() {
Assert.assertTrue(ContextUtils.isFormGenerationSupported(createNode(new UserTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new ScriptTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new BusinessRuleTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new NoneTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new StartNoneEvent())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new EndNoneEvent())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new ParallelGateway())));
}
Aggregations