Package org.jbpm.process.workitem

Examples of org.jbpm.process.workitem.WorkDefinitionImpl


                                                          new HashMap() );
            final Map<String, Object> workDefinitionMap = (Map<String, Object>) result;

            //Populate model
            if ( workDefinitionMap != null ) {
                final WorkDefinitionImpl workDefinition = new WorkDefinitionImpl();
                workDefinition.setName( (String) workDefinitionMap.get( "name" ) );
                workDefinition.setDisplayName( (String) workDefinitionMap.get( "displayName" ) );
                workDefinition.setIcon( (String) workDefinitionMap.get( "icon" ) );
                workDefinition.setCustomEditor( (String) workDefinitionMap.get( "customEditor" ) );
                final Set<ParameterDefinition> parameters = new HashSet<ParameterDefinition>();
                if ( workDefinitionMap.get( "parameters" ) != null ) {
                    final Map<String, DataType> parameterMap = (Map<String, DataType>) workDefinitionMap.get( "parameters" );
                    if ( parameterMap != null ) {
                        for ( Map.Entry<String, DataType> entry : parameterMap.entrySet() ) {
                            parameters.add( new ParameterDefinitionImpl( entry.getKey(),
                                                                         entry.getValue() ) );
                        }
                    }
                    workDefinition.setParameters( parameters );
                }

                if ( workDefinitionMap.get( "results" ) != null ) {
                    final Set<ParameterDefinition> results = new HashSet<ParameterDefinition>();
                    final Map<String, DataType> resultMap = (Map<String, DataType>) workDefinitionMap.get( "results" );
                    if ( resultMap != null ) {
                        for ( Map.Entry<String, DataType> entry : resultMap.entrySet() ) {
                            results.add( new ParameterDefinitionImpl( entry.getKey(),
                                                                      entry.getValue() ) );
                        }
                    }
                    workDefinition.setResults( results );
                }
                if ( workDefinitionMap.get( "defaultHandler" ) != null ) {
                    workDefinition.setDefaultHandler( (String) workDefinitionMap.get( "defaultHandler" ) );
                }
                if ( workDefinitionMap.get( "dependencies" ) != null ) {
                    workDefinition.setDependencies( ( (List<String>) workDefinitionMap.get( "dependencies" ) ).toArray( new String[ 0 ] ) );
                }
                workDefinitions.put( workDefinition.getName(),
                                     workDefinition );
            }
        }
        return workDefinitions;
    }
View Full Code Here


            assertNotNull( wids );
            assertEquals( 1,
                          wids.size() );

            WorkDefinitionImpl wid = (WorkDefinitionImpl) wids.get( "MyTask" );

            assertEquals( "MyTask",
                          wid.getName() );
            assertEquals( "My Task",
                          wid.getDisplayName() );

            //Check parameters
            assertNotNull( wid.getParameters() );
            assertEquals( 7,
                          wid.getParameters().size() );

            assertNotNull( wid.getParameter( "StringParam" ) );
            assertNotNull( wid.getParameter( "IntegerParam" ) );
            assertNotNull( wid.getParameter( "FloatParam" ) );
            assertNotNull( wid.getParameter( "BooleanParam" ) );
            assertNotNull( wid.getParameter( "EnumParam" ) );
            assertNotNull( wid.getParameter( "ListParam" ) );
            assertNotNull( wid.getParameter( "ObjectParam" ) );

            assertTrue( wid.getParameter( "StringParam" ).getType() instanceof StringDataType );
            assertTrue( wid.getParameter( "IntegerParam" ).getType() instanceof IntegerDataType );
            assertTrue( wid.getParameter( "FloatParam" ).getType() instanceof FloatDataType );
            assertTrue( wid.getParameter( "BooleanParam" ).getType() instanceof BooleanDataType );
            assertTrue( wid.getParameter( "EnumParam" ).getType() instanceof EnumDataType );
            assertTrue( wid.getParameter( "ListParam" ).getType() instanceof ListDataType );
            assertTrue( wid.getParameter( "ObjectParam" ).getType() instanceof ObjectDataType );

            //Check results
            assertNotNull( wid.getResults() );
            assertEquals( 7,
                          wid.getResults().size() );

            assertNotNull( wid.getResult( "StringResult" ) );
            assertNotNull( wid.getResult( "IntegerResult" ) );
            assertNotNull( wid.getResult( "FloatResult" ) );
            assertNotNull( wid.getResult( "BooleanResult" ) );
            assertNotNull( wid.getResult( "EnumResult" ) );
            assertNotNull( wid.getResult( "ListResult" ) );
            assertNotNull( wid.getResult( "ObjectResult" ) );

            assertTrue( wid.getResult( "StringResult" ).getType() instanceof StringDataType );
            assertTrue( wid.getResult( "IntegerResult" ).getType() instanceof IntegerDataType );
            assertTrue( wid.getResult( "FloatResult" ).getType() instanceof FloatDataType );
            assertTrue( wid.getResult( "BooleanResult" ).getType() instanceof BooleanDataType );
            assertTrue( wid.getResult( "EnumResult" ).getType() instanceof EnumDataType );
            assertTrue( wid.getResult( "ListResult" ).getType() instanceof ListDataType );
            assertTrue( wid.getResult( "ObjectResult" ).getType() instanceof ObjectDataType );

        } catch ( Exception e ) {
            System.out.println( e.getMessage() );
            fail( e.getMessage() );
        }
View Full Code Here

            assertNotNull( wids );
            assertEquals( 3,
                          wids.size() );

            //Check WID1
            WorkDefinitionImpl wid1 = (WorkDefinitionImpl) wids.get( "MyTask1" );

            assertEquals( "MyTask1",
                          wid1.getName() );
            assertEquals( "My Task1",
                          wid1.getDisplayName() );

            //Check parameters, WID1
            assertNotNull( wid1.getParameters() );
            assertEquals( 1,
                          wid1.getParameters().size() );

            assertNotNull( wid1.getParameter( "StringParam" ) );

            assertTrue( wid1.getParameter( "StringParam" ).getType() instanceof StringDataType );

            //Check results, WID1
            assertNotNull( wid1.getResults() );
            assertEquals( 1,
                          wid1.getResults().size() );

            assertNotNull( wid1.getResult( "StringResult" ) );

            assertTrue( wid1.getResult( "StringResult" ).getType() instanceof StringDataType );

            //Check WID2
            WorkDefinitionImpl wid2 = (WorkDefinitionImpl) wids.get( "MyTask2" );

            assertEquals( "MyTask2",
                          wid2.getName() );
            assertEquals( "My Task2",
                          wid2.getDisplayName() );

            //Check parameters, WID2
            assertNotNull( wid2.getParameters() );
            assertEquals( 1,
                          wid2.getParameters().size() );

            assertNotNull( wid2.getParameter( "IntegerParam" ) );

            assertTrue( wid2.getParameter( "IntegerParam" ).getType() instanceof IntegerDataType );

            //Check results, WID2
            assertNotNull( wid2.getResults() );
            assertEquals( 1,
                          wid2.getResults().size() );

            assertNotNull( wid2.getResult( "IntegerResult" ) );

            assertTrue( wid2.getResult( "IntegerResult" ).getType() instanceof IntegerDataType );

            //Check WID3
            WorkDefinitionImpl wid3 = (WorkDefinitionImpl) wids.get( "MyTask3" );

            assertEquals( "MyTask3",
                          wid3.getName() );
            assertEquals( "My Task3",
                          wid3.getDisplayName() );

            //Check parameters, WID3
            assertNotNull( wid3.getParameters() );
            assertEquals( 1,
                          wid3.getParameters().size() );

            assertNotNull( wid3.getParameter( "ObjectParam" ) );

            assertTrue( wid3.getParameter( "ObjectParam" ).getType() instanceof ObjectDataType );

            //Check results, WID3
            assertNotNull( wid3.getResults() );
            assertEquals( 1,
                          wid3.getResults().size() );

            assertNotNull( wid3.getResult( "ObjectResult" ) );

            assertTrue( wid3.getResult( "ObjectResult" ).getType() instanceof ObjectDataType );

        } catch ( Exception e ) {
            fail( e.getMessage() );
        }
    }
View Full Code Here

            //Copy the Work Items into Structures suitable for GWT
            final Set<PortableWorkDefinition> workItems = new HashSet<PortableWorkDefinition>();
            for ( Map.Entry<String, WorkDefinition> entry : workDefinitions.entrySet() ) {
                final PortableWorkDefinition wid = new PortableWorkDefinition();
                final WorkDefinitionImpl wd = (WorkDefinitionImpl) entry.getValue();
                wid.setName( wd.getName() );
                wid.setDisplayName( wd.getDisplayName() );
                wid.setParameters( convertWorkItemParameters( entry.getValue().getParameters() ) );
                wid.setResults( convertWorkItemParameters( entry.getValue().getResults() ) );
                workItems.add( wid );
            }
            return workItems;
View Full Code Here

            assertNotNull( wids );
            assertEquals( 1,
                          wids.size() );

            WorkDefinitionImpl wid = (WorkDefinitionImpl) wids.get( "MyTask" );

            assertEquals( "MyTask",
                          wid.getName() );
            assertEquals( "My Task",
                          wid.getDisplayName() );

            //Check parameters
            assertNotNull( wid.getParameters() );
            assertEquals( 7,
                          wid.getParameters().size() );

            assertNotNull( wid.getParameter( "StringParam" ) );
            assertNotNull( wid.getParameter( "IntegerParam" ) );
            assertNotNull( wid.getParameter( "FloatParam" ) );
            assertNotNull( wid.getParameter( "BooleanParam" ) );
            assertNotNull( wid.getParameter( "EnumParam" ) );
            assertNotNull( wid.getParameter( "ListParam" ) );
            assertNotNull( wid.getParameter( "ObjectParam" ) );

            assertTrue( wid.getParameter( "StringParam" ).getType() instanceof StringDataType );
            assertTrue( wid.getParameter( "IntegerParam" ).getType() instanceof IntegerDataType );
            assertTrue( wid.getParameter( "FloatParam" ).getType() instanceof FloatDataType );
            assertTrue( wid.getParameter( "BooleanParam" ).getType() instanceof BooleanDataType );
            assertTrue( wid.getParameter( "EnumParam" ).getType() instanceof EnumDataType );
            assertTrue( wid.getParameter( "ListParam" ).getType() instanceof ListDataType );
            assertTrue( wid.getParameter( "ObjectParam" ).getType() instanceof ObjectDataType );

            //Check results
            assertNotNull( wid.getResults() );
            assertEquals( 7,
                          wid.getResults().size() );

            assertNotNull( wid.getResult( "StringResult" ) );
            assertNotNull( wid.getResult( "IntegerResult" ) );
            assertNotNull( wid.getResult( "FloatResult" ) );
            assertNotNull( wid.getResult( "BooleanResult" ) );
            assertNotNull( wid.getResult( "EnumResult" ) );
            assertNotNull( wid.getResult( "ListResult" ) );
            assertNotNull( wid.getResult( "ObjectResult" ) );

            assertTrue( wid.getResult( "StringResult" ).getType() instanceof StringDataType );
            assertTrue( wid.getResult( "IntegerResult" ).getType() instanceof IntegerDataType );
            assertTrue( wid.getResult( "FloatResult" ).getType() instanceof FloatDataType );
            assertTrue( wid.getResult( "BooleanResult" ).getType() instanceof BooleanDataType );
            assertTrue( wid.getResult( "EnumResult" ).getType() instanceof EnumDataType );
            assertTrue( wid.getResult( "ListResult" ).getType() instanceof ListDataType );
            assertTrue( wid.getResult( "ObjectResult" ).getType() instanceof ObjectDataType );

        } catch ( Exception e ) {
            System.out.println( e.getMessage() );
            fail( e.getMessage() );
        }
View Full Code Here

            assertNotNull( wids );
            assertEquals( 3,
                          wids.size() );

            //Check WID1
            WorkDefinitionImpl wid1 = (WorkDefinitionImpl) wids.get( "MyTask1" );

            assertEquals( "MyTask1",
                          wid1.getName() );
            assertEquals( "My Task1",
                          wid1.getDisplayName() );

            //Check parameters, WID1
            assertNotNull( wid1.getParameters() );
            assertEquals( 1,
                          wid1.getParameters().size() );

            assertNotNull( wid1.getParameter( "StringParam" ) );

            assertTrue( wid1.getParameter( "StringParam" ).getType() instanceof StringDataType );

            //Check results, WID1
            assertNotNull( wid1.getResults() );
            assertEquals( 1,
                          wid1.getResults().size() );

            assertNotNull( wid1.getResult( "StringResult" ) );

            assertTrue( wid1.getResult( "StringResult" ).getType() instanceof StringDataType );

            //Check WID2
            WorkDefinitionImpl wid2 = (WorkDefinitionImpl) wids.get( "MyTask2" );

            assertEquals( "MyTask2",
                          wid2.getName() );
            assertEquals( "My Task2",
                          wid2.getDisplayName() );

            //Check parameters, WID2
            assertNotNull( wid2.getParameters() );
            assertEquals( 1,
                          wid2.getParameters().size() );

            assertNotNull( wid2.getParameter( "IntegerParam" ) );

            assertTrue( wid2.getParameter( "IntegerParam" ).getType() instanceof IntegerDataType );

            //Check results, WID2
            assertNotNull( wid2.getResults() );
            assertEquals( 1,
                          wid2.getResults().size() );

            assertNotNull( wid2.getResult( "IntegerResult" ) );

            assertTrue( wid2.getResult( "IntegerResult" ).getType() instanceof IntegerDataType );

            //Check WID3
            WorkDefinitionImpl wid3 = (WorkDefinitionImpl) wids.get( "MyTask3" );

            assertEquals( "MyTask3",
                          wid3.getName() );
            assertEquals( "My Task3",
                          wid3.getDisplayName() );

            //Check parameters, WID3
            assertNotNull( wid3.getParameters() );
            assertEquals( 1,
                          wid3.getParameters().size() );

            assertNotNull( wid3.getParameter( "ObjectParam" ) );

            assertTrue( wid3.getParameter( "ObjectParam" ).getType() instanceof ObjectDataType );

            //Check results, WID3
            assertNotNull( wid3.getResults() );
            assertEquals( 1,
                          wid3.getResults().size() );

            assertNotNull( wid3.getResult( "ObjectResult" ) );

            assertTrue( wid3.getResult( "ObjectResult" ).getType() instanceof ObjectDataType );

        } catch ( Exception e ) {
            fail( e.getMessage() );
        }
    }
View Full Code Here

            //Copy the Work Items into Structures suitable for GWT
            final Set<PortableWorkDefinition> workItems = new HashSet<PortableWorkDefinition>();
            for ( Map.Entry<String, WorkDefinition> entry : workDefinitions.entrySet() ) {
                final PortableWorkDefinition wid = new PortableWorkDefinition();
                final WorkDefinitionImpl wd = (WorkDefinitionImpl) entry.getValue();
                wid.setName( wd.getName() );
                wid.setDisplayName( wd.getDisplayName() );
                wid.setParameters( convertWorkItemParameters( entry.getValue().getParameters() ) );
                wid.setResults( convertWorkItemParameters( entry.getValue().getResults() ) );
                workItems.add( wid );
            }
            return workItems;
View Full Code Here

            //Populate model
            if ( workDefinitionsMap != null ) {
                for ( Map<String, Object> workDefinitionMap : workDefinitionsMap ) {

                    if ( workDefinitionMap != null ) {
                        final WorkDefinitionImpl workDefinition = new WorkDefinitionImpl();
                        workDefinition.setName( (String) workDefinitionMap.get( "name" ) );
                        workDefinition.setDisplayName( (String) workDefinitionMap.get( "displayName" ) );
                        workDefinition.setIcon( (String) workDefinitionMap.get( "icon" ) );
                        workDefinition.setCustomEditor( (String) workDefinitionMap.get( "customEditor" ) );
                        final Set<ParameterDefinition> parameters = new HashSet<ParameterDefinition>();
                        if ( workDefinitionMap.get( "parameters" ) != null ) {
                            final Map<String, DataType> parameterMap = (Map<String, DataType>) workDefinitionMap.get( "parameters" );
                            if ( parameterMap != null ) {
                                for ( Map.Entry<String, DataType> entry : parameterMap.entrySet() ) {
                                    parameters.add( new ParameterDefinitionImpl( entry.getKey(),
                                                                                 entry.getValue() ) );
                                }
                            }
                            workDefinition.setParameters( parameters );
                        }

                        if ( workDefinitionMap.get( "results" ) != null ) {
                            final Set<ParameterDefinition> results = new HashSet<ParameterDefinition>();
                            final Map<String, DataType> resultMap = (Map<String, DataType>) workDefinitionMap.get( "results" );
                            if ( resultMap != null ) {
                                for ( Map.Entry<String, DataType> entry : resultMap.entrySet() ) {
                                    results.add( new ParameterDefinitionImpl( entry.getKey(),
                                                                              entry.getValue() ) );
                                }
                            }
                            workDefinition.setResults( results );
                        }
                        if ( workDefinitionMap.get( "defaultHandler" ) != null ) {
                            workDefinition.setDefaultHandler( (String) workDefinitionMap.get( "defaultHandler" ) );
                        }
                        if ( workDefinitionMap.get( "dependencies" ) != null ) {
                            workDefinition.setDependencies( ( (List<String>) workDefinitionMap.get( "dependencies" ) ).toArray( new String[ 0 ] ) );
                        }
                        workDefinitions.put( workDefinition.getName(),
                                             workDefinition );
                    }
                }
            }
        }
View Full Code Here

        //Copy the Work Items into Structures suitable for GWT
        Set<PortableWorkDefinition> workItems = new HashSet<PortableWorkDefinition>();
        for (Map.Entry<String, WorkDefinition> entry : workDefinitions.entrySet()) {
            PortableWorkDefinition wid = new PortableWorkDefinition();
            WorkDefinitionImpl wd = (WorkDefinitionImpl) entry.getValue();
            wid.setName(wd.getName());
            wid.setDisplayName(wd.getDisplayName());
            wid.setParameters(convertWorkItemParameters(entry.getValue().getParameters()));
            wid.setResults(convertWorkItemParameters(entry.getValue().getResults()));
            workItems.add(wid);
        }
        return workItems;
View Full Code Here

            //Populate model
            if ( workDefinitionsMap != null ) {
                for ( Map<String, Object> workDefinitionMap : workDefinitionsMap ) {

                    if ( workDefinitionMap != null ) {
                        WorkDefinitionImpl workDefinition = new WorkDefinitionImpl();
                        workDefinition.setName( (String) workDefinitionMap.get( "name" ) );
                        workDefinition.setDisplayName( (String) workDefinitionMap.get( "displayName" ) );
                        workDefinition.setIcon( (String) workDefinitionMap.get( "icon" ) );
                        workDefinition.setCustomEditor( (String) workDefinitionMap.get( "customEditor" ) );
                        Set<ParameterDefinition> parameters = new HashSet<ParameterDefinition>();
                        if ( workDefinitionMap.get( "parameters" ) != null ) {
                            Map<String, DataType> parameterMap = (Map<String, DataType>) workDefinitionMap.get( "parameters" );
                            if ( parameterMap != null ) {
                                for ( Map.Entry<String, DataType> entry : parameterMap.entrySet() ) {
                                    parameters.add( new ParameterDefinitionImpl( entry.getKey(),
                                                                                 entry.getValue() ) );
                                }
                            }
                            workDefinition.setParameters( parameters );
                        }

                        if ( workDefinitionMap.get( "results" ) != null ) {
                            Set<ParameterDefinition> results = new HashSet<ParameterDefinition>();
                            Map<String, DataType> resultMap = (Map<String, DataType>) workDefinitionMap.get( "results" );
                            if ( resultMap != null ) {
                                for ( Map.Entry<String, DataType> entry : resultMap.entrySet() ) {
                                    results.add( new ParameterDefinitionImpl( entry.getKey(),
                                                                              entry.getValue() ) );
                                }
                            }
                            workDefinition.setResults( results );
                        }
                        if ( workDefinitionMap.get( "defaultHandler" ) != null ) {
                            workDefinition.setDefaultHandler( (String) workDefinitionMap.get( "defaultHandler" ) );
                        }
                        if ( workDefinitionMap.get( "dependencies" ) != null ) {
                            workDefinition.setDependencies( ((List<String>) workDefinitionMap.get( "dependencies" )).toArray( new String[0] ) );
                        }
                        workDefinitions.put( workDefinition.getName(),
                                             workDefinition );
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.jbpm.process.workitem.WorkDefinitionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.