I am working on Joget. I want to set  a value to a workflow variable from radio button. I used following code but getting an error.

I am using the following code

---------code sample in Bean shell form binder-----------------

import org.joget.workflow.model.service.*;
import org.joget.plugin.base.PluginManager;

try
{ String value1 = new String("#variable.field2status#");  //Here i receive value from radio tab but Im am not using this value, i am using  hardcoded value. I am not getting any value here //Setting the value using below code.  Getting error--> Attempt to resolve method: getBean() on undefined variable
 
WorkflowManager wm = (WorkflowManager) pluginManager.getBean"workflowManager"); wm.activityVariable(workflowAssignment.getActivityId(),"financedpmApproveStatus","Approve"); 
} catch(NumberFormatException error) 
{ System.out.println(error); 
}

---------------------  Error  -------------------------

WARNING: Error executing script
Sourced file: inline evaluation of: ``import org.joget.workflow.model.service.; import org.joget.plugin.base.PluginMa . . . '' : Typed variable declaration : Attempt to resolve method: getBean() on undefined variable or class name: pluginManager : at Line: 9 : in file: inline evaluation of: ``import org.joget.workflow.model.service.; import org.joget.plugin.base.PluginMa . . . '' : pluginManager .getBean ( "workflowManager" )

    at bsh.UtilEvalError.toEvalError(Unknown Source)
    at bsh.UtilEvalError.toEvalError(Unknown Source)
    at bsh.BSHMethodInvocation.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)

Let me know where I am going wrong. I am also not getting any output in the log for system println.

Thanks in advance

Sachin

  • No labels

3 Comments

  1. Hi Sachin,

    We don't actually need to write any code for that.

    To write a input field's value into a Workflow Variable, simply go to the "Workflow Variables" tab in the input field's properties and key in the Workflow Variable name.

    Cheers

    1. Thanks  Hugo,

      It works fine.

      Thanks for help,

      Sachin

  2. is there any way to pass external form data to workflow variable and then use workflow variable in url to map an activity?