public void startTaskForm ( ) { Map < String , String > requestParameterMap = FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . getRequestParameterMap ( ) ; String taskId = requestParameterMap . get ( "taskId" ) ; String callbackUrl = requestParameterMap . get ( "callbackUrl" ) ; if ( taskId == null || callbackUrl == null ) { if ( FacesContext . getCurrentInstance ( ) . isPostback ( ) ) { // if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added // as preRenderView event // see http://stackoverflow.com/questions/2830834/jsf-fevent-prerenderview-is-triggered-by-fajax-calls-and-partial-renders-some return ; } // return it anyway but log an info message log . log ( Level . INFO , "Called startTask method without proper parameter (taskId='" + taskId + "'; callbackUrl='" + callbackUrl + "') even if it seems we are not called by an AJAX Postback. Are you using the camundaTaskForm bean correctly?" ) ; return ; } // Note that we always run in a conversation this . url = callbackUrl ; businessProcess . startTask ( taskId , true ) ; }
Get taskId and callBackUrl from request and start a conversation to start the form