두 개의 "Hello World"프로세스를 생성하여 하위 프로세스 노드에 소용돌이 모양을 부여했습니다. 하위 프로세스에서 메인 프로세스로 다시 출력하는 데 문제가 있습니다. 나는 누군가 내가 잘못하고있는 것을 나에게 계몽 할 수 있기를 희망한다. 나는 문서 나 예제를 찾을 수 없기 때문에 광산이 왜 작동하지 않는지 밝혀 준다. 내 주요 과정에서Drools SubProcess out mapping failed - 내가 뭘 잘못하고 있니?
, 나는 다음 (나는 머리글, 바닥 글을 냈다 한 메모와 위치 X, Y, 높이, 폭 특성)이 있습니다 여기
... snip... <header> <variables> <variable name="name" > <type name="org.drools.process.core.datatype.impl.type.StringDataType" /> <value>World</value> </variable> <variable name="length" > <type name="org.drools.process.core.datatype.impl.type.IntegerDataType" /> <value>0</value> </variable> </variables> </header> ... snip... <subProcess id="4" name="SubHello" processId="subhello" waitForCompletion="true" > <mapping type="in" from="name" to="name" /> <mapping type="out" from="length" to="length" /> </subProcess> ... snip...
그리고는 간단한 subhello
입니다 단순히 입력을 받아 그것을 밖으로 인쇄 한 다음 입력의 길이를 가져옵니다 하위 프로세스는 다시 그것을 밖으로 돌아갑니다 :
... snip... <header> <variables> <variable name="name" > <type name="org.drools.process.core.datatype.impl.type.StringDataType" /> <value></value> </variable> <variable name="length" > <type name="org.drools.process.core.datatype.impl.type.IntegerDataType" /> <value></value> </variable> </variables> </header> <nodes> <start id="1" name="Start" /> <end id="2" name="End" /> <actionNode id="3" name="Action" > <action type="expression" dialect="mvel" > System.out.println(name + ", " + length + ", in SubProcess, before"); length = name.length; System.out.println(length + ", in SubProcess, after"); </action> </actionNode> </nodes> ... snip...
이 내가 문서와 예제를 해석하는 방법에 따라입니다. 필요한 변수는 주 프로세스와 하위 프로세스 모두에 선언 된 다음 subProcess in/out 매핑 요소를 사용하여 from 및 to 속성을 설정합니다.
name
이 문제없이 subProcess에 전달 된 동안 length
을 주 프로세스로 다시 보내지 못했습니다. subprocess의 length
이 성공적으로 수정되었습니다. 그러나 출구에서 메인 프로세스의 length
은 변경되지 않았습니다.
내가 뭘 잘못하고 있니? 포인터와 설명을 많이 주시면 감사하겠습니다. 감사.
고마워. 문서를 처리 할 때 실제로 context.setVariable()을 호출해야한다는 점을 분명히해야한다는 점에 유의하고 싶습니다. Action 노드 doc은 length = name.length를 수행하는 것이 지역 변수를 설정한다는 것을 언급하지 않습니다. SubFlow 문서에서 필자는 length = length를 설정하는 것으로 충분하다고 생각했습니다. 하지만 다시 한 번 감사드립니다! 다음 이벤트 처리를 찾고 있습니다. – aberrant80