이 콘텐츠는 선택한 언어로 제공되지 않습니다.

3.4. Data


While the rule flow is designed specifically to allow you to create process control flows, you also have to plan it from a data perspective. Throughout the execution of a process, data is retrieved, stored, passed on and used.
To store run-time data while a process is executing, use variables. A variable is defined by a name and a data type. This could be something very basic, such as Boolean, int, or String, or it could be any kind of Object sub-class.
Define variables inside a variable scope. The top-level scope is that for the process itself. Sub-scopes can be defined via a composite node. Variables that are defined in sub-scopes can only be accessed by nodes within that scope.
Whenever a variable is accessed, the process will search for the appropriate definitive variable scope.
You are allowed to nest variable scopes. A node will always search for a variable in its parent container. If the variable cannot be found, it will look in that one's parent container, and so on, until the process instance itself is reached. If the variable cannot be found, a read access yields null, and a write access produces an error message, with the process continuing its execution.
You can use variables in these ways:
  • you can set process-level variables when starting a process by providing a map of parameters to the invocation of the startProcess method. These parameters are then set as variables on the process scope.
  • actions can access variables directly. They do so by using the name of the variable as a parameter name:
    // call method on the process variable "person"
    person.setAge(10);
    Copy to Clipboard Toggle word wrap
    You can change the value of a variable via the knowledge context:
    kcontext.setVariable(variableName, value);
    Copy to Clipboard Toggle word wrap
  • you can make WorkItem and SubFlow nodes pass the value of parameters to the "outside world" by mapping the variable to one of the work item parameters. To do so, either use a parameter mapping or interpolate it into a String parameter, using #{expression} . You can also copy a WorkItem's output to a variable via a result mapping.
  • various other nodes can also access data. Event nodes, for example, can store the data associated with an event in a variable. Exception handlers can read error data from a specific variable. Check the properties of the different node types for more information.
Finally, every process and rule can access globals. These are globally-defined variables that are considered immutable with regard to rule evaluation and data in the knowledge session.
You can access the knowledge session via the actions in the knowledge context:
kcontext.getKnowledgeRuntime().insert( new Person(...) );
Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동