Skip to content

Instantly share code, notes, and snippets.

@eduard93
Created August 17, 2020 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduard93/4dcc6987d13e87587fdb8d08ea28d0dc to your computer and use it in GitHub Desktop.
Save eduard93/4dcc6987d13e87587fdb8d08ea28d0dc to your computer and use it in GitHub Desktop.
test.Production.xml
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2020.4.0ML (Build 519U)" ts="2020-08-17 17:28:01">
<Class name="test.Production">
<Super>Ens.Production</Super>
<TimeChanged>65608,62469.218744</TimeChanged>
<TimeCreated>65608,61935.696681</TimeCreated>
<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="test.Production" TestingEnabled="true" LogGeneralTraceEvents="true">
<Description></Description>
<ActorPoolSize>2</ActorPoolSize>
<Item Name="ValidateOperation" Category="" ClassName="EnsLib.Workflow.Operation" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
<Setting Target="Host" Name="AutoCreateRole">1</Setting>
</Item>
</Production>
]]></Data>
</XData>
<Method name="Test">
<Description>
w $System.Status.GetErrorText(##class(test.Production).Test())</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>link="ya.ru",img="https://www.w3schools.com/w3css/img_lights.jpg"</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
/*
{
"abc": 124,
"myLink": "ya.ru",
"myImg": "localhost:52773/rest/156.jpg",
"$$$Handler": {"myLink":"link","myImg":"img"}
}
*/
set target = "ValidateOperation"
set request = ##class(EnsLib.Workflow.TaskRequest).%New()
set request.%Title = "Заголовок"
set request.%Actions = "Принять,Отклонить"
set request.%FormFields = "abc,myLink,myImg,$$$Handler"
do request.%FormValues.SetAt(124, "abc")
do request.%FormValues.SetAt(link, "myLink")
do request.%FormValues.SetAt(img, "myImg")
do request.%FormValues.SetAt({"myLink":"link","myImg":"img"}.%ToJSON(), "$$$Handler")
set sc = ##class(EnsLib.Testing.Service).SendTestRequest(target, request, ,.sessionId, $$$NO)
quit sc
]]></Implementation>
</Method>
</Class>
</Export>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment