1 Reply Latest reply on Jul 9, 2014 9:30 PM by Tim McClure

    Issue with Generated HTML Forms in 6.1.0.CR1

    Tim McClure Apprentice

      I auto-generated process and task forms and I receive the error below.  The problem seems to be I try to lookup an activity by the task id and there is no activity but the call to resolveById returns a list containing a null object.  Why does the code expect to find an activity for my random task? 

       

         public void renderFormViaPlaceManager(@Observes RenderFormEvent event){

              String taskName = event.getParams().get("TaskName");

              if(taskName == null || taskName.equals("")){

                  return;

              }

              DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest(taskName, event.getParams());

              Set<Activity> activities = activityManager.getActivities(defaultPlaceRequest);

              if(activities.isEmpty()){

                  return;

              }

              AbstractWorkbenchScreenActivity activity = ((AbstractWorkbenchScreenActivity) activities.iterator().next());

              IsWidget widget = activity.getWidget();

              activity.launch(place, null);

              activity.onStartup(defaultPlaceRequest);

              view.getFormView().clear();

              view.getFormView().add(widget);

              activity.onOpen();

              view.getFormView().setVisible(true);

              view.getFormRenderer().setVisible(false);

              loadForm = false;

              initTaskForm("");

          }  

       

        private Collection<IOCBeanDef<Activity>> resolveById( final String identifier ) {

              if ( identifier == null ) {

                  return emptyList();

              }

       

       

              return new ArrayList<IOCBeanDef<Activity>>( 1 ) {{

                  add( activityBeansCache.getActivity( identifier ) );

              }};

          }

       

        java.lang.NullPointerException: null

         org.uberfire.client.mvp.ActivityManagerImpl.secure(ActivityManagerImpl.java:142)

         org.uberfire.client.mvp.ActivityManagerImpl.getActivities(ActivityManagerImpl.java:86)

         org.jbpm.console.ng.ht.forms.client.editors.taskform.FormDisplayPresenter.renderFormViaPlaceManager(FormDisplayPresenter.java:347)

         org.jboss.errai.ioc.client.BootstrapperImpl$313$2.fireEvent(BootstrapperImpl.java:5298)

         org.jboss.errai.ioc.client.BootstrapperImpl$313$2.fireEvent(BootstrapperImpl.java:1)

         org.jboss.errai.enterprise.client.cdi.AbstractCDIEventCallback.callback(AbstractCDIEventCallback.java:67)

         org.jboss.errai.enterprise.client.cdi.api.CDI.fireIfNotFired(CDI.java:270)

         org.jboss.errai.enterprise.client.cdi.api.CDI._fireEvent(CDI.java:258)

         org.jboss.errai.enterprise.client.cdi.api.CDI.consumeEventFromMessage(CDI.java:246)

         org.jboss.errai.enterprise.client.cdi.api.CDI$1.callback(CDI.java:64)

         org.jboss.errai.bus.client.framework.ClientMessageBusImpl$10.callback(ClientMessageBusImpl.java:628)

         org.jboss.errai.bus.client.framework.ClientMessageBusImpl.sendLocal(ClientMessageBusImpl.java:793)

         org.jboss.errai.bus.client.util.BusToolsCli.decodeToCallback(BusToolsCli.java:54)

         org.jboss.errai.bus.client.framework.transports.SSEHandler.handleReceived(SSEHandler.java:145)

         sun.reflect.GeneratedMethodAccessor707.invoke(Unknown Source)

         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

         java.lang.reflect.Method.invoke(Method.java:606)

         com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)

         com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)

         com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)

         com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)

         com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)

         com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)

         java.lang.Thread.run(Thread.java:744)

       

      Any help will be appreciated.

       

      Tim

        • 1. Re: Issue with Generated HTML Forms in 6.1.0.CR1
          Tim McClure Apprentice

          We took out the following code and everything seems to be working - anyone have any ideas?  This code wants to go to a place (activity) names after the task - this can't be right.  Any ideas?

           

          Tim

           

          package org.jbpm.console.ng.ht.forms.client.editors.taskform.FormDisplayPresenter

           

           

          BAD CODE:

           

          //    public void renderFormViaPlaceManager(@Observes RenderFormEvent event){

          //        String taskName = event.getParams().get("TaskName");

          //        if(taskName == null || taskName.equals("")){

          //            return;

          //        }

          //        DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest(taskName, event.getParams());

          //        Set<Activity> activities = activityManager.getActivities(defaultPlaceRequest);

          //        if(activities.isEmpty()){

          //            return;

          //        }

          //        AbstractWorkbenchScreenActivity activity = ((AbstractWorkbenchScreenActivity) activities.iterator().next());

          //        IsWidget widget = activity.getWidget();

          //        activity.launch(place, null);

          //        activity.onStartup(defaultPlaceRequest);

          //        view.getFormView().clear();

          //        view.getFormView().add(widget);

          //        activity.onOpen();

          //        view.getFormView().setVisible(true);

          //        view.getFormRenderer().setVisible(false);

          //        loadForm = false;

          //        initTaskForm("");

          //    }