20.3 Passing Parameters to a Bounded Task Flow
A
called bounded task flow can accept input parameters from the task
flow that calls it. To pass an input parameter to a bounded task
flow, you specify one or more:
- Input parameters on the task flow call activity in the calling task flow
Input
parameters specify where the calling task flow stores parameter
values.
- Input parameter definitions on the called bounded task flow
Input
parameter definitions specify where the called bounded task flow can
retrieve parameter values at runtime.
Specify
the same name for the input parameter that you define on the task
flow call activity in the calling task flow and the input parameter
definition on the called bounded task flow. Do this so you can map
input parameter values to the called bounded task flow.
If
you do not specify an EL expression to reference the value of the
input parameter, the EL expression for
value
defaults
to the following at runtime:#{pageFlowScope.
parmName}
where
parmName
is
the value you entered for the input parameter name.
In
an input parameter definition for a called bounded task flow, you can
specify an input parameter as required. If the input parameter does
not receive a value at runtime or design time, the task flow raises
an error. An input parameter that you do not specify as required can
be ignored during task flow call activity creation.
Task
flow call activity input parameters can be passed by reference or
passed by value when calling a task flow using a task flow call
activity unless you are calling a task flow in an ADF region. If the
task flow renders in an ADF region, the task flow call activity
passes the input parameters by reference. By default, primitive types
(for example,
int
, long
,
or boolean
)
are passed by value (pass-by-value
).
The
Pass By Value check box applies only to objects, not primitives and
is used to override the default setting of passing by reference.
Mixing the two, however, can lead to unexpected behavior in cases
where parameters reference each other. If input parameter A on the
task flow call activity is passed by value and if input parameter B
on the task flow call activity is passed by reference, and B has a
reference to A, the result can be two different instances of A and B.
Section
20.3.1, "How to Pass an Input Parameter to a Bounded Task
Flow," describes
how to pass an input parameter from a calling task flow to a called
bounded task flow using a task flow call activity. Although you can
pass parameter values from any activity on the calling task flow, the
passed parameter in Section
20.3.1, "How to Pass an Input Parameter to a Bounded Task
Flow" contain
the value of an input text field on a page in the calling task flow.
If
you call a bounded task flow using a URL rather than a task flow call
activity, you pass parameters and values on the URL itself. For more
information, see Section
19.6.4, "How to Call a Bounded Task Flow Using a URL".
Instead
of explicitly passing data controls as parameters between task flows,
you can simply share them by specifying the
data-control-scope
option
on the called bounded task flow. For more information, see Section
20.4, "Sharing Data Controls Between Task Flows".
A
called task flow can also return values to the task flow that called
it when it exits. For more information about returning values from a
bounded task flow, see Section
20.5, "Specifying a Return Value from a Bounded Task Flow."
20.3.1 How to Pass an Input Parameter to a Bounded Task Flow
You
define values on the calling task flow and the called task flow.
- Create a calling and called task flow
The
calling task flow can be bounded or unbounded. The called task flow
must be bounded. For more information about creating task flows,
see Section
18.2, "Creating a Task Flow.".
- Add a task flow call activity to the calling task flow
Figure
20-3 shows
an example where the view activity passes control to the task flow
call activity.
- It may be helpful to have an understanding of the configuration options available to you before you configure a bounded task flow to receive an input parameter. For more information, Section 20.3, "Passing Parameters to a Bounded Task Flow."
- You may also find it helpful to understand functionality that can be added using other task flow features. For more information, see Section 20.1.2, "Additional Functionality for Task Flows Using Parameters."
- In the Application Navigator for your project, double-click the JSF page that contains an input component where an end user enters a value that gets passed to a bounded task flow as a parameter at runtime.
The
JSF page that you open should be referenced by a view activity in the
calling task flow.
- Select an input text component on the JSF page where an end user enters a value at runtime.
- In the Property Inspector, enter a value for the input text component.
You
can specify the value as an EL expression, for
example
#{pageFlowScope.inputValue}
.- In the Application Navigator, double-click the name of the called task flow to open its diagram.
- Click the Overview tab for the called task flow.
- In the overview editor, click the Parameters navigation tab and click the Add icon to define a new entry in the Input Parameter Definition section.
- In the Name field, enter a name for the parameter, for example,
inputParm1
. - In the Value field, enter an EL expression where the parameter value is stored and referenced, for example,
#{pageFlowScope.inputValue}
. - In the editor, open the diagram for the calling task flow.
- In the Application Navigator, drag the called bounded task flow and drop it on top of the task flow call activity that is located on the calling task flow.
Dropping
a bounded task flow on top of a task flow call activity in a diagram
automatically creates a task flow reference to the bounded task flow.
As shown in Figure
20-4,
the task flow reference contains the bounded task flow ID and a
document name. The bounded task flow ID (
id
)
is an attribute of the bounded task
flow's <task-flow-definition>
element.
The document name points to the source file for the task flow that
contains the ID.- In the Property Inspector for the task flow call activity, click Parameters and expand the Input Parameters section.
- Enter a name that identifies the input parameter.
Because
you dropped the bounded task flow on a task flow call activity having
defined input parameters, the name should be already be specified.
You must keep the same input parameter name.
- Enter a parameter value, for example,
#{pageFlowScope.parm1}
.
The
value on the task flow call activity input parameter specifies where
the calling task flow stores parameter values.
The
value on the input parameter definition for the called task flow
specifies where the value will be retrieved from for use within the
called bounded task flow once it is passed.
- At runtime, the called task flow is able to use the input parameter. Since you specified
pageFlowScope
as thevalue
in the input parameter definition for the called task flow, you can use the parameter value anywhere in the called bounded task flow. For example, you can pass it to a view activity on the called bounded task flow. For more information, see Section 19.2.1.2, "What Happens When You Pass Control Between View Activities".
20.3.2 What Happens When You Pass an Input Parameter to a Bounded Task Flow
JDeveloper
writes entries to the source files for the calling task flow and
called task flow based on the values that you select. Example
20-3 shows
an input parameter definition specified on a a bounded task flow.
<task-flow-definition id="sourceTaskflow"> ... <input-parameter-definition> <name>inputParameter1</name> <value>#{pageFlowScope.parmValue1}</value> <class>java.lang.String</class> </input-parameter-definition> ... </task-flow-definition>
Example
20-4 shows
the input parameter metadata for the task flow call activity that
calls the bounded task flow shown in Example
20-3.
At runtime, the task flow call activity calls the bounded task flow
and passes it the value specified by its
value
element.<task-flow-call id="taskFlowCall1"> ... <input-parameter> <name>inputParameter1</name> <value>#{pageFlowScope.newCustomer}</value> <pass-by-value/> </input-parameter> ... </task-flow-call>
바인드 작업 흐름에 매개 변수
전달
라는 바인드 작업 흐름은 그것을
호출 타스크 플로우의 입력 매개 변수를 받아 들일 수
있습니다. 바인드 작업
흐름에 입력 매개 변수를 전달 하나 이상을 지정합니다.
호출 타스크 플로우의 작업 흐름
콜 활동에 입력 매개 변수
입력 매개 변수는 어디서 호출
타스크 플로우 스토어의 매개 변수 값을 지정하십시오.
라는 바인드 타스크 플로우의
입력 매개 변수 정의
라는 바인드 작업 흐름은 실행시
매개 변수 값을 얻을 수 있습니다 어디에 입력 매개
변수 정의를 지정합니다.
당신은 호출 타스크 플로우라는
바인드 작업 흐름의 입력 매개 변수 정의 작업 흐름
콜 활동에 정의 된 입력 매개 변수에 동일한 이름을
지정합니다. 당신이
부르는 바인드 작업 흐름에 입력 매개 변수 값을 매핑
할 수 있도록 작업을 수행합니다.
당신이 입력 매개 변수의 값을
참조하는 EL 식을위한
EL 식 지정하지 않으면
값 런타임에 다음과 같이 기본을 :
#
{한 PageFlowScope.
parmName}
어디 parmName
당신이 입력 매개 변수 이름에 입력 한 값입니다.
필요에 따라 호출되는 바인드
작업 흐름의 입력 매개 변수 정의는 입력 매개 변수를
지정할 수 있습니다. 입력
매개 변수는 런타임 또는 디자인 타임에 값을 수신하지
않는 경우, 작업 흐름
오류가 발생합니다. 필요에
따라 지정하지 입력 매개 변수는 작업 흐름 콜 작업을
만들 때 무시할 수 있습니다.
작업 흐름 호출 활동의 입력
매개 변수를 참조로 전달되었는지,
당신은 ADF 영역에서
작업 흐름을 호출되지 않는 태스크 플로우 호출 활동을
사용하여 작업 흐름을 호출 때 값으로 전달할 수
있습니다. 작업 흐름은
ADF 영역에 그리는 경우
작업 흐름 콜 활동을 참조하여 입력 매개 변수를
전달합니다. 기본적으로,
원시 형 (예를
들어, int 형 긴 또는
부울) (값에 의해
전달됩니다 값 전달).
값의 체크 박스로 전달하는 개체
만이 아니라 원시에 적용되며,
참조 전달의 기본 설정을 재정의하는 데 사용됩니다.
두 혼합하지만, 매개
변수가 서로 참조하는 경우 예기치 않은 동작이 발생할
수 있습니다. 작업
흐름 호출 활동의 입력 매개 변수 A의
값에 의해 전달 된 작업 흐름 호출 활동의 입력 매개
변수 B가 참조로
전달되므로 B는 A에
대한 참조를 가지고있는 경우,
결과는 A와 B의
두 가지 인스턴스 인 수있는 경우
섹션 20.3.1
"어떻게 바인드 작업 흐름에 입력 매개 변수를
전달하려면"작업
흐름 호출 활동을 사용하여 호출 바인드 작업 흐름에
호출 타스크 플로우 에서 입력 매개 변수를 전달하는
방법을 설명합니다. 당신이에
호출 타스크 플로우의 모든 활동에서 전달 된 매개
변수를 매개 변수 값을 전달할 수 있지만,
"바인드 작업 흐름에 입력 매개 변수 를 전달하는
방법 "20.3.1 항에
페이지에서 입력 텍스트 필드의 값이 포함 된 작업
흐름을 호출한다.
당신은 URL
대신 작업 흐름 호출 활동을 사용하여 바인드
작업 흐름을 호출 한 경우,
URL 자체에 매개 변수 값을 전달합니다.
자세한 내용은 "URL을
사용하여 바인드 작업 흐름을 호출하는 방법"제
19.6.4을.
대신 명시 적으로 작업 흐름
사이에서 매개 변수로 데이터 컨트롤을 전달하는 것이
아니라, 단순히 지정하여
그들을 공유 할 수 있으며,
데이터 제어 범위라는 바인드 작업 흐름에서
옵션을 선택합니다. 자세한
내용은 섹션 20.4를
"데이터 공유 작업
흐름 사이에서 제어합니다."
라는 작업 흐름 또한 끝에 그것을
호출 작업 흐름에 값을 반환 할 수 있습니다.
바인드 작업 흐름에서 값을 반환하는 방법에 대한
자세한 내용은 "바인드
작업 흐름에서 반환 값을 지정한다."섹션
20.5을
20.3.1
바인드 작업 흐름에 입력 매개 변수를 전달하는
방법
당신은 호출 타스크 플로우라는
작업 흐름에서 값을 정의합니다.
시작하기 전에 :
발신 측과 착신 작업 흐름을
만듭니다.
호출자의 작업 흐름은 경계 또는
비 묶여 수 있습니다. 라는
작업 흐름은 경계를 설치할 필요가 있습니다.
작업 흐름 만들기에 대한 자세한 내용은를
참조하십시오. "작업
흐름 생성"18.2 절.
호출 타스크 플로우 작업 흐름
콜 활동을 추가합니다.
그림 20-3은보기
활동은 작업 흐름 콜 활동에 제어를 전달 예를 보여줍니다.
작업 흐름의 호출도 20-3
작업 흐름을 호출한다.
당신이 입력 매개 변수를 수신하기
위해 바인드 작업 흐름을 구성하기 전에 사용 가능한
설정 옵션의 이해를 가지고 편리합니다.
자세한 내용은 섹션 20.3
"바인드 작업 흐름에 매개 변수를 전달합니다."
또한 그것은 도움 다른 작업
흐름 기능을 사용하여 추가 할 수 기능을 이해할 수
있습니다. 자세한
내용은 제 20.1.2 항을
"작업을위한 추가
기능은 매개 변수의 사용이 흐르고 있습니다."
바인드 작업 흐름에 입력 매개
변수를 전달하려면 :
당신의 프로젝트를위한 애플리케이션
네비게이터에서 최종 사용자가 실행시 매개 변수로
바인드 작업 흐름에 전달 된 값을 입력하는 입력 구성
요소를 포함 JSF 페이지를
더블 클릭합니다.
당신이 열 JSF
페이지는 호출자의 작업 흐름의보기 활동에 의해
참조되는 것이다.
최종 사용자가 런타임에 값을
입력 JSF 페이지에서
입력 텍스트 구성 요소를 선택합니다.
속성 검사기에 입력 된 텍스트
컴퍼넌트의 값을 입력합니다.
당신은 예를 위해 EL
표현식으로 값을 지정할 수 있습니다 #
{pageFlowScope.inputValue}
애플리케이션 네비게이터에서
그 다이어그램을 여는 데 불리는 작업 흐름의 이름을
두 번 클릭합니다.
클릭 개요라는 작업 흐름 탭을.
개요 편집기에서 매개 변수 탐색
탭을 클릭하고 [추가]에
새 항목을 정의하려면 아이콘을 입력 매개 변수 정의
섹션을.
에서 이름 필드에 예를 들어,
매개 변수의 이름을 입력 inputParm1을.
의 값 필드 매개 변수 값이
저장되고 참조되는 EL 식을
입력하고 예를 들어, #
{pageFlowScope.inputValue}
편집기에서 호출 타스크 플로우
다이어그램을 엽니 다.
애플리케이션 네비게이터에서
불리는 바인드 작업 흐름을 드래그하여 호출자의 작업
흐름에 배치 된 작업 흐름 콜 활동에 놓습니다.
그림 작업 흐름 콜 활동에 바인드
작업 흐름을 놓으면 자동으로 바인드 작업 흐름 작업
흐름 참조를 만듭니다. 와
같이 그림 20-4 작업
흐름 참조는 바인드 작업 흐름 ID
및 문서 이름이 포함되어 있습니다.
바인드 작업 흐름 ID
(id)는 바인드 작업 흐름의 속성 인 <작업
흐름 정의> 요소.
문서 이름은 ID가
포함 된 작업 흐름의 소스 파일을 가리킨다.
속성 검사기에서 그림 20-4
작업 흐름 참조
속성 ·
관리자의 작업 흐름 참조.
작업 흐름 콜 활동에 대한 속성
관리자에서 클릭하여 매개 변수를 확장하는 입력 매개
변수 섹션을.
입력 매개 변수를 식별하는
이름을 입력합니다.
당신이 정의 된 입력 매개 변수를
갖는 태스크 플로우 통화 활동에 바인드 작업 흐름을
떨어졌기 때문에 이름이 이미 지정되어야한다.
당신은 같은 입력 매개 변수 이름을 유지해야합니다.
예를 들어,
매개 변수 값을 입력하고 #
{pageFlowScope.parm1}
작업 흐름 호출 활동의 입력
매개 변수의 값은 어디 호출 작업 흐름을 포함하는
매개 변수 값을 지정합니다.
값은 그것이 전달라는 바인드
작업 흐름에서 사용하기 때문에 검색되는 장소라는
작업 흐름의 입력 매개 변수 정의 값을 지정합니다.
실행시 호출되는 작업 흐름은
입력 매개 변수를 사용하는 것이 가능하다.
당신이 지정하고 있기 때문에 같은 PageFlowScope을로
값라는 작업 흐름의 입력 매개 변수 정의는라는 바인드
작업 흐름의 원하는 위치에 매개 변수 값을 사용할 수
있습니다. 예를 들어
불리는 바인드 작업 흐름의보기 활동에 전달할 수
있습니다. 자세한
내용은 "무슨 일이
일어나는가 당신은보기 활동 사이의 제어를 전달"섹션
19.2.1.2을.
20.3.2
당신이 바인드 작업 흐름에 입력 매개 변수를
전달할 때의 처리
JDeveloper는
선택한 값에 따라 호출 타스크 플로우라는 작업 흐름의
소스 파일에 항목을 기록합니다.
예 20-3은 AA
바인드 작업 흐름에 지정된 입력 매개 변수 정의를
보여줍니다.
예 20-3의
입력 매개 변수 정의
<작업
흐름 정의 ID =
"sourceTaskflow">
...
<입력
매개 변수의 정의>
<이름>
inputParameter1 </ name>
<값>
# {pageFlowScope.parmValue1} </ value>
<클래스>
java.lang.String의 </
클래스>
</
입력 매개 변수의 정의>
...
</
작업 흐름 정의>
예 20-4는에
표시된 바인드 작업 흐름을 호출 타스크 플로우 호출
활동의 입력 매개 변수의 메타 데이터를 표시 예
20-3을.
실행시 작업 흐름 콜 활동은 바인드 작업 흐름을
호출하고 저 지정된 값 전달 치의 요소를.
작업 흐름 콜 활동에 대한 예제
20-4의 입력 매개 변수
<작업
흐름 콜 ID = "taskFlowCall1">
...
<입력
매개 변수>
<이름>
inputParameter1 </ name>
<값>
# {pageFlowScope.newCustomer} </ value>
<값
전달 />
</
입력 매개 변수>
...
</
작업 흐름 콜>
---------------------------------------------------------------
from - https://docs.oracle.com ~~~~ someWhere
N
https://translate.google.com/
Thks oracleNgoogle
---------------------------------------------------------------
from - https://docs.oracle.com ~~~~ someWhere
N
https://translate.google.com/
Thks oracleNgoogle
댓글 없음:
댓글 쓰기