2

i am trying to write a class which will be used as Apex Plugin in flows .i write the code

public class FlowController {

   //Instance of the Flow
   public Flow.Interview.doubler myFlow {get; set;}
   public Double value {get; set;}

   public Double getOutput() {
      if (myFlow == null) return null;
      return (Double)(myFlow.getVariableValue('v1'));
   }

   public void start() {
      Map<String, Object> myMap = new Map<String, Object>();
      myMap.put('v1', input);
      myFlow = new Flow.Interview.doubler(myMap);
      myFlow.start();
   }
}

when i try to save it .i get the error

Error: Compile Error: Invalid type: doubler at line 4 column 11 

can anyone please tell why i am facing this . i pasted this code from http://www.salesforce.com/us/developer/docs/apexcode/Content/flow_interview_class.htm

1 Answer 1

5

The line in the example code: public Flow.Interview.doubler myFlow {get; set;} needs to be modified with the unique name of your flow. doubler is the name of the flow which is used in the example.

For instance if you created a flow called ModemTroubleShooting in your code you would reference it as:

public Flow.Interview.ModemTroubleShooting myFlow {get; set;}

and

myFlow = new Flow.Interview.ModemTroubleshooting(myMap);

Here is another link to some example documentation from Salesforce about using Flows in VF and Apex

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_flows_advanced.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .