protected DataType getDataType(String itemSubjectRef, Map<String, ItemDefinition> itemDefinitions, ClassLoader cl) { DataType dataType = new ObjectDataType(); if (itemDefinitions == null) { return dataType; } ItemDefinition itemDefinition = itemDefinitions.get(itemSubjectRef); if (itemDefinition != null) { String structureRef = itemDefinition.getStructureRef(); if ("java.lang.Boolean".equals(structureRef) || "Boolean".equals(structureRef)) { dataType = new BooleanDataType(); } else if ("java.lang.Integer".equals(structureRef) || "Integer".equals(structureRef)) { dataType = new IntegerDataType(); } else if ("java.lang.Float".equals(structureRef) || "Float".equals(structureRef)) { dataType = new FloatDataType(); } else if ("java.lang.String".equals(structureRef) || "String".equals(structureRef)) { dataType = new StringDataType(); } else if ("java.lang.Object".equals(structureRef) || "Object".equals(structureRef)) { dataType = new ObjectDataType(structureRef); } else { dataType = new ObjectDataType(structureRef, cl); } } return dataType; }
protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); ForEachNode forEachNode = (ForEachNode) node; final String variableName = element.getAttribute("variableName"); if (variableName != null && variableName.length() != 0) { forEachNode.setVariable(variableName, new ObjectDataType()); } final String collectionExpression = element.getAttribute("collectionExpression"); if (collectionExpression != null && collectionExpression.length() != 0) { forEachNode.setCollectionExpression(collectionExpression); } final String waitForCompletion = element.getAttribute("waitForCompletion"); if ("false".equals(waitForCompletion)) { forEachNode.setWaitForCompletion(false); } }
DataType dataType = new ObjectDataType(); ItemDefinition itemDefinition = itemDefinitions.get(itemSubjectRef); if (itemDefinition != null) { dataType = new ObjectDataType("java.lang.Object"); dataType = new ObjectDataType(structureRef, cl);
public Variable findVariable(String variableName) { for (Variable variable: getVariables()) { if (variable.getName().equals(variableName)) { return variable; } } if (variableName.startsWith(CASE_FILE_PREFIX) && variableName.indexOf(".") == -1) { Variable caseVariable = new Variable(); caseVariable.setName(CASE_FILE_PREFIX+variableName); caseVariable.setType(new ObjectDataType()); return caseVariable; } return null; }
DataType dataType = new ObjectDataType(); if (itemDefinitions != null) { ItemDefinition itemDefinition = itemDefinitions.get(localItemSubjectRef); if (itemDefinition != null) { dataType = new ObjectDataType(itemDefinition.getStructureRef(), parser.getClassLoader());
variable.setMetaData(id, variable.getName()); DataType dataType = new ObjectDataType(); Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>) ((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions"); dataType = new ObjectDataType("java.lang.Object"); dataType = new ObjectDataType(structureRef, parser.getClassLoader());
DataType dataType = new ObjectDataType(); dataType = new ObjectDataType("java.lang.Object"); dataType = new ObjectDataType(structureRef, parser.getClassLoader());
variable = new Variable(); variable.setName( "Person" ); variable.setType( new ObjectDataType( Person.class.getName() ) ); variables.add( variable ); variable = new Variable(); variable.setName( "MyObject" ); variable.setType( new ObjectDataType() ); variables.add( variable ); variable = new Variable();
variable.setName("persons"); ListDataType listDataType = new ListDataType(); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("org.jbpm.process.test.Person"); listDataType.setType(personDataType); forEachNode.setId(3); forEachNode.setCollectionExpression("persons"); personDataType = new ObjectDataType(); personDataType.setClassName("org.drools.Person"); process.addNode(forEachNode);
public static RuleFlowProcess newProcessWithOneVariableAndOneWork(String processId, String variableName, String workName) { RuleFlowProcess process = new RuleFlowProcess(); process.setId(processId); List<Variable> variables = new ArrayList<Variable>(); Variable variable = new Variable(); variable.setName(variableName); ObjectDataType extendingSerializableDataType = new ObjectDataType(); extendingSerializableDataType.setClassName(Person.class.getName()); variable.setType(extendingSerializableDataType); variables.add(variable); process.getVariableScope().setVariables(variables); StartNode startNode = new StartNode(); startNode.setName( "Start" ); startNode.setId(1); WorkItemNode workItemNode = new WorkItemNode(); workItemNode.setName( "workItemNode" ); workItemNode.setId( 2 ); Work work = new WorkImpl(); work.setName( workName ); workItemNode.setWork( work ); EndNode endNode = new EndNode(); endNode.setName("EndNode"); endNode.setId(4); connect( startNode, workItemNode ); connect( workItemNode, endNode ); process.addNode( startNode ); process.addNode( workItemNode ); process.addNode( endNode ); return process; }
variable.setType( new ObjectDataType() ); variables.add( variable ); variable = new Variable();
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("java.lang.String"); variable.setType(personDataType);
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("org.drools.Person"); variable.setType(personDataType);
Variable variable = new Variable(); variable.setName("x"); ObjectDataType extendingSerializableDataType = new ObjectDataType(); extendingSerializableDataType.setClassName(MyVariableExtendingSerializable.class.getName()); variable.setType(extendingSerializableDataType);
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("org.drools.Person"); variable.setType(personDataType);
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("org.drools.Person"); variable.setType(personDataType);
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("org.drools.Person"); variable.setType(personDataType);
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("org.drools.Person"); variable.setType(personDataType);
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("org.drools.Person"); variable.setType(personDataType);
Variable variable = new Variable(); variable.setName("event"); ObjectDataType personDataType = new ObjectDataType(); personDataType.setClassName("java.lang.String"); variable.setType(personDataType);