}
@Test
public void testRHSExecuteWorkItem1() {
RuleModel m = new RuleModel();
m.name = "WorkItem";
FactPattern p = new FactPattern( "Person" );
p.setBoundName( "$p" );
SingleFieldConstraint con = new SingleFieldConstraint();
con.setFieldType( DataType.TYPE_STRING );
con.setFieldName( "name" );
con.setOperator( "==" );
con.setValue( "Michael" );
con.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
p.addConstraint( con );
m.addLhsItem( p );
ActionExecuteWorkItem awi = new ActionExecuteWorkItem();
PortableWorkDefinition pwd = new PortableWorkDefinition();
pwd.setName( "WorkItem" );
awi.setWorkDefinition( pwd );
PortableBooleanParameterDefinition p1 = new PortableBooleanParameterDefinition();
p1.setName( "BooleanParameter" );
p1.setValue( Boolean.TRUE );
pwd.addParameter( p1 );
PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
p2.setName( "FloatParameter" );
p2.setValue( 123.456f );
pwd.addParameter( p2 );
PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
p3.setName( "IntegerParameter" );
p3.setValue( 123 );
pwd.addParameter( p3 );
PortableStringParameterDefinition p4 = new PortableStringParameterDefinition();
p4.setName( "StringParameter" );
p4.setValue( "hello" );
pwd.addParameter( p4 );
m.addRhsItem( awi );
String result = BRDRLPersistence.getInstance().marshal( m );
assertTrue( result.indexOf( "org.kie.internal.process.instance.WorkItemManager wim = (org.kie.internal.process.instance.WorkItemManager) drools.getWorkingMemory().getWorkItemManager();" ) != -1 );
assertTrue( result.indexOf( "org.kie.internal.process.instance.impl.WorkItemImpl wiWorkItem = new org.kie.internal.process.instance.impl.WorkItemImpl();" ) != -1 );