Error while calling a Operation in Foreach Loops
Hello guys,
i try to call a Operation within 3 foreach loops.
When i try to do this, i always get the following error:
I dont get any Errpr when i log my request message at this time i want to call a operation.
Everything works and i get no error. But when i try to call the operation i get this error.
Then i tried to call a operation in the first Level (not in a ForeachLoop) it works.
I simply call the operation with the RequestMessage from my Service.
When i now try to copy this call into the third Level (within 3 foreachloops) Then i also get this error.
I dont know what i am doing wrong...
Here is the BPL:
XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl" ]
{
<process language='objectscript' request='SESRequestMessage.rqmAddressToOpenOrdering' response='SESResponseMessage.rpmGenericResponse' height='2000' width='2000' >
<context>
<property name='allOrgaElementsFromAddress' type='%Library.ListOfDataTypes' collection='list' instantiate='0' />
<property name='OrgaElementitem' type='%String' instantiate='0' >
<parameters>
<parameter name='MAXLEN' value='50' />
</parameters>
</property>
<property name='allChildOrgaElementWithParent' type='%Library.ListOfDataTypes' collection='list' instantiate='0' />
<property name='OrgaElementChildItem' type='%String' instantiate='0' >
<parameters>
<parameter name='MAXLEN' value='50' />
</parameters>
</property>
<property name='allAddressTypesFromOneOrgaElement' type='%Library.ListOfDataTypes' collection='list' instantiate='0' />
<property name='orgaElementTypeIterator' type='%String' instantiate='0' >
<parameters>
<parameter name='MAXLEN' value='50' />
</parameters>
</property>
<property name='rqmJSONDataToSend' type='SESRequestMessage.rqmJSONData' instantiate='0' />
<property name='myResponseFromOO' type='SESResponseMessage.rpmGenericResponse' instantiate='0' />
<property name='respListOfResponses' type='%Library.ListOfDataTypes' collection='list' instantiate='0' />
</context>
<sequence xend='200' yend='700' >
<if name='wenn AddressId is filled' condition='request.AddressId '= ""' xpos='200' ypos='250' xend='200' yend='600' >
<true>
<assign name="getAllORgaElementsFromAddress" property="context.allOrgaElementsFromAddress" value="##class(SESTransformationTools.prcAddressToOpenOrdering).GetOrgaElements(request.AddressId, 1)" action="set" xpos='470' ypos='400' />
<foreach name='go through all Items' property='context.allOrgaElementsFromAddress' key='context.OrgaElementitem' xpos='470' ypos='500' xend='200' yend='450' >
<assign name="Hole alle Kinder und Bilde einen Array mit allen OrgaElementIds" property="context.allChildOrgaElementWithParent" value="##class(SESTransformationTools.prcAddressToOpenOrdering).GetOrgaElementChildsFromParent(context.allOrgaElementsFromAddress.GetAt(context.OrgaElementitem))" action="set" xpos='200' ypos='250' />
<foreach name='Gehe durch jedes Kinderelement des OrgaElements' property='context.allChildOrgaElementWithParent' key='context.OrgaElementChildItem' xpos='200' ypos='350' xend='200' yend='450' >
<assign name="hole alle Addressen des OrgaElements über den Addresstyp" property="context.allAddressTypesFromOneOrgaElement" value="##class(SESTransformationTools.prcAddressToOpenOrdering).getAllAddressFromAddressType(context.allChildOrgaElementWithParent.GetAt(context.OrgaElementChildItem), 1)" action="set" xpos='200' ypos='250' />
<foreach name='gehe durch jedes AddressElement des OrgaELementTyps' property='context.allAddressTypesFromOneOrgaElement' key='context.orgaElementTypeIterator' xpos='200' ypos='350' xend='217' yend='665' >
<assign name="Build Json for OpenOrdering" property="context.rqmJSONDataToSend.JSONString" value="##class(SESTransformationTools.prcAddressToOpenOrdering).buildJSONForOpenOrdering(context.allAddressTypesFromOneOrgaElement.GetAt(context.orgaElementTypeIterator))" action="set" xpos='200' ypos='250' />
<call name='schicke den JSON an OpenOrderingx 22' target='opeXML' async='0' xpos='200' ypos='350' >
<request type='SESRequestMessage.rqmAddressToOpenOrdering' >
<assign property="callrequest" value="request" action="set" />
</request>
<response type='SESResponseMessage.rpmGenericResponse' >
<assign property="context.myResponseFromOO" value="callresponse" action="set" />
</response>
</call>
<call name='schicke den JSON an OpenOrdering' target='opeAddressToOpenOrdering' async='0' xpos='203' ypos='511' disabled="true">
<request type='SESRequestMessage.rqmJSONData' >
<assign property="callrequest" value="context.rqmJSONDataToSend" action="set" />
</request>
<response type='SESResponseMessage.rpmGenericResponse' >
<assign property="context.myResponseFromOO" value="callresponse" action="set" />
</response>
</call>
</foreach>
</foreach>
</foreach>
</true>
<false>
<alert value='"Koi AddressId gfonda"' xpos='200' ypos='400' />
</false>
</if>
</sequence>
</process>
Maybe you can help me :)
P.S. Sorry 4 my bad english skills :)
Comments
I suspect the problem is that you're using a %DynamicObject. BPLs should use persistent/persistable objects because business process execution can in some cases be suspended temporarily and then resumed. Before execution is suspended, context objects are saved into the DB.
%DynamicObjects are not persistent objects, so their values are lost when execution is suspended. You can overcome this by using %ToJSON to serialize the %DynamicObject into a stream property of the context object. Streams are persistable.
I think the error reported by bp is that the method does not exist. You can check the configuration or code of bp