RuleFlowContentModel model) {
List<TransferNode> transferNodes = new ArrayList<TransferNode>();
for ( int i = 0; i < nodes.length; i++ ) {
Node node = nodes[i];
TransferNode.Type type = getType( node );
TransferNode tn = null;
if ( type == TransferNode.Type.WORK_ITEM ) {
tn = createWorkItemTransfernode( (WorkItemNode) node );
} else if ( type == TransferNode.Type.HUMANTASK ) {
tn = createHumanTaskTransferNode( (HumanTaskNode) node );
} else if ( type == TransferNode.Type.SPLIT ) {
tn = createSplitNode( (Split) node );
} else if ( type == TransferNode.Type.FOR_EACH ) {
tn = createRuleFlowContentModelTransferNode( ((ForEachNode) node).getNodes() );
} else if ( type == TransferNode.Type.COMPOSITE ) {
tn = createRuleFlowContentModelTransferNode( ((CompositeNode) node).getNodes() );
} else {
tn = new TransferNode();
}
/*
* Creates connections for from and to this node.
*/
createConnections( model,
node );
tn.setId( node.getId() );
//Guard needed to Migrate v4 ruleflows to v5
Integer x = (Integer) node.getMetaData( "x" );
if ( x != null ) {
tn.setX( x );
}
// Guard needed to Migrate v4 ruleflows to v5
Integer y = (Integer) node.getMetaData( "y" );
if ( y != null ) {
tn.setY( y );
}
Integer height = (Integer) node.getMetaData( "height" );
if ( height != null ) {
tn.setHeight( height );
}
Integer width = (Integer) node.getMetaData( "width" );
if ( width != null ) {
tn.setWidth( width );
}
tn.setName( node.getName() );
tn.setType( type );
transferNodes.add( tn );
}