この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

Newer Version Available

This content describes an older version of this product. View Latest

フロー変数の取得

Apex で特定のフローのフロー変数を取得できます。

Flow.Interview Apex クラスには、フロー変数を取得する getVariableValue メソッドがあります。フロー変数は、Visualforce ページに埋め込まれたフロー内、またはサブフロー要素によってコールされる個別のフロー内にあります。次の例では、このメソッドを使用して Visualforce ページに埋め込まれたフローからブレッドクラム (ナビゲーション) 情報を取得します。そのフローにサブフロー要素が含まれ、参照される各フローにも vaBreadCrumb 変数が含まれる場合、どのフローでインタビューが実行されているかに関わらず、すべてのフローのブレッドクラムを Visualforce ページから取得できます。

1public class SampleContoller {
2
3   // Instance of the flow
4   public Flow.Interview.Flow_Template_Gallery myFlow {get; set;}
5
6   public String getBreadCrumb() {
7      String aBreadCrumb;
8      if (myFlow==null) { return 'Home';}
9      else aBreadCrumb = (String) myFlow.getVariableValue('vaBreadCrumb');
10
11      return(aBreadCrumb==null ? 'Home': aBreadCrumb);
12
13   }
14}