RuleModel m = new RuleModel();
m.name = "WorkItem";
FactPattern fp1 = new FactPattern( "Person" );
fp1.setBoundName( "$p" );
SingleFieldConstraint con1 = new SingleFieldConstraint();
con1.setFieldType( DataType.TYPE_STRING );
con1.setFieldName( "name" );
con1.setOperator( "==" );
con1.setValue( "Michael" );
con1.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
fp1.addConstraint( con1 );
m.addLhsItem( fp1 );
FactPattern fp2 = new FactPattern( "Boolean" );
fp2.setBoundName( "$b1" );
SingleFieldConstraint con2 = new SingleFieldConstraint();
con2.setFieldType( DataType.TYPE_BOOLEAN );
con2.setFieldName( "this" );
con2.setOperator( "==" );
con2.setValue( "true" );
con2.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
fp2.addConstraint( con2 );
m.addLhsItem( fp2 );
FactPattern fp3 = new FactPattern( "Float" );
fp3.setBoundName( "$f1" );
SingleFieldConstraint con3 = new SingleFieldConstraint();
con3.setFieldType( DataType.TYPE_NUMERIC_FLOAT );
con3.setFieldName( "this" );
con3.setOperator( "==" );
con3.setValue( "123.456f" );
con3.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
fp3.addConstraint( con3 );
m.addLhsItem( fp3 );
FactPattern fp4 = new FactPattern( "Integer" );
fp4.setBoundName( "$i1" );
SingleFieldConstraint con4 = new SingleFieldConstraint();
con4.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
con4.setFieldName( "this" );
con4.setOperator( "==" );
con4.setValue( "123" );
con4.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
fp4.addConstraint( con4 );
m.addLhsItem( fp4 );
FactPattern fp5 = new FactPattern( "String" );
fp5.setBoundName( "$s1" );
SingleFieldConstraint con5 = new SingleFieldConstraint();
con5.setFieldType( DataType.TYPE_STRING );
con5.setFieldName( "this" );
con5.setOperator( "==" );
con5.setValue( "hello" );
con5.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
fp5.addConstraint( con5 );
m.addLhsItem( fp5 );
ActionExecuteWorkItem awi = new ActionExecuteWorkItem();
PortableWorkDefinition pwd = new PortableWorkDefinition();