JBoss Community

Re: Can a POJO be Parameter Mapped?

created by Demian Calcaprina in jBPM - View the full discussion

Gary, if you use the default work item :

org.jbpm.bpmn2.handler.ServiceTaskHandler

 

I think the parameter has to be called "Parameter".

 

And then it is invoked:

...

    Object parameter = workItem.getParameter("Parameter");

        try {

            Class<?> c = Class.forName(i);

            Object instance = c.newInstance();

            Class<?>[] classes = null;

            Object[] params = null;

            if (parameterType != null) {

                classes = new Class<?>[] {

                    Class.forName(parameterType)

                };

                params = new Object[] {

                    parameter

                };

            }

            Method method = c.getMethod(operation, classes);

            Object result = method.invoke(instance, params);

 

Demian

Reply to this message by going to Community

Start a new discussion in jBPM at Community