Class HS.Local.Example.ProcessBPL Extends Ens.BusinessProcessBPL
{ Storage Default
{
<Type>%Storage.Persistent</Type>
} /// BPL Definition
XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl]
{
<process language='objectscript' request='EnsLib.HTTP.GenericMessage' response='EnsLib.HTTP.GenericMessage' height='2000' width='2000' >
<context>
<property name='SuccessResponse' type='%String' instantiate='0' >
<parameters>
<parameter name='MAXLEN'  value='50' />
</parameters>
</property>
<property name='ConvertedStream' type='Ens.StreamContainer' instantiate='0' />
</context>
<sequence xend='200' yend='1000' >
<code name='ConvertedStream' xpos='200' ypos='250' >
<![CDATA[ If 1=request.%IsA("Ens.StreamContainer") {
   Set context.ConvertedStream = request
 }
 If 1=request.%IsA("EnsLib.HTTP.GenericMessage") {
   Set context.ConvertedStream = ##class(Ens.StreamContainer).%New()
   Set context.ConvertedStream.Stream = ##class(%GlobalCharacterStream).%New()
   Set tSC = context.ConvertedStream.Stream.CopyFrom(request.Stream)
   Set context.ConvertedStream.OriginalFilename = $Piece(request.HTTPHeaders.GetAt("RawParams"),"=",2)
 }
 If 1=request.%IsA("EnsLib.Kafka.Message") {
   Set context.ConvertedStream = ##class(Ens.StreamContainer).%New()
   Set context.ConvertedStream.Stream = ##class(%GlobalCharacterStream).%New()
   Set tSC = context.ConvertedStream.Stream.Write(request.value)
   Set context.ConvertedStream.OriginalFilename = request.key
   Set tSC = context.ConvertedStream.%Save()
 }]]>
</code>
<if name='Check Test Transaction' condition='context.ConvertedStream.OriginalFilename="TEST.txt"' xpos='200' ypos='350' xend='200' yend='700' >
<false>
<code name='Store Document' xpos='335' ypos='500' disabled="false">
<![CDATA[ Set tSC = ##class(HS.Local.VA.eSCM.FMS.Util).StoreStream(context.ConvertedStream,context.ConvertedStream)]]>
</code>
<call name='Call ToIrisMail Operation' target='ToIrisMail' async='0' xpos='335' ypos='600' >
<request type='Ens.StreamContainer>
<assign property="callrequestvalue="context.ConvertedStreamaction="set" />
</request>
<response type='EnsLib.HTTP.GenericMessage/>
</call>
</false>
</if>
<code name='setting of success response' xpos='200' ypos='800' >
<![CDATA[ Set context.SuccessResponse = ""
 If 1=request.%IsA("EnsLib.HTTP.GenericMessage") {
   Set tmp = ##class(%Library.GlobalBinaryStream).%New()
   Set tSC = tmp.Write("File received successfully")
   Set tSC = tmp.%Save()
   Set context.SuccessResponse=##class(EnsLib.HTTP.GenericMessage).%New(tmp,,request.HTTPHeaders)
   Do context.SuccessResponse.HTTPHeaders.SetAt("HTTP/1.1 200 OK","StatusLine")
   Set tSC = context.SuccessResponse.%Save()
 }]]>
</code>
<assign name="send response back" property="responsevalue="context.SuccessResponseaction="set" xpos='200' ypos='900' />
</sequence>
</process>
} }
 

I just searched history and found these commands somebody else had used. Maybe some could help you:

sudo podman login containers.intersystems.com

sudo podman search containers.intersystems.com/intersystems/irishealth

sudo podman image list  containers.intersystems.com/intersystems/irishealth

sudo podman pull containers.intersystems.com/intersystems/webgateway-arm64:2022.2.0.372.0

sudo podman search --list-tags containers.intersystems.com/intersystems/arbiter-arm64

Hello, Thembelani,

I have implemented a similar case in this app:

https://github.com/oliverwilms/irisrest/blob/master/src/App/REST.cls#:~:...

Important helper method is this:

/// Helper method
ClassMethod GetJSONFromRequest(Output obj As %DynamicObject) As %Boolean
{
    Set ok = 1
    Try {
        Set obj = ##class(%DynamicObject).%FromJSON(%request.Content)
    } Catch ex {
        Set ok = 0
    }
    Quit ok
}

Best regards,

Oliver

I have tried using getProductionItems() using this code:

ClassMethod GetProductionItems(
pProd As %String,
pDefinition As %String,
pAutoAdd As %String) As %Status
{
Set tSC = $$$OK
If ($Get(pProd) = "") {
Set pProd = ##class(Ens.Director).GetActiveProductionName()
}
Set tProduction = ##class(Ens.Config.Production).%OpenId(pProd)
Set tSC = ##class(Ens.Director).getProductionItems(tProduction,.pDefinition,.pAutoAdd)
ZW
Quit tSC
}
 

Interesting question. I looked in Documentation and found a CreateDocumentation classMethod. I tried to test it with this code. I got an error in my Production. Let me know if this helps you. I will look at getProductionItems() next...

ClassMethod CreateDocumentation(
pProduction As %String = "",
pIntro As %Boolean = 1,
pFormat As %String,
Output LogFileName As %String,
Output URL As %String,
Output BookName As %String,
PDFFileName As %String,
PDFRenderer As %String,
ByRef Params As %String,
pAllSettings As %Boolean = 0) As %Status
{
Set tSC = $$$OK
If (pProduction = "") {
Set pProduction = ##class(Ens.Director).GetActiveProductionName()
}
Try {
Set tSC = ##class(%SYS.Ensemble).CreateDocumentation(pProduction,pIntro,$G(pFormat),.LogFileName,.URL,.BookName,$G(PDFFileName),$G(PDFRenderer),.Params,pAllSettings)
Catch {
Set tSC = ##class(%SYS.Ensemble).CreateDocumentation(pProduction,pIntro,$G(pFormat),.LogFileName,.URL,.BookName,$G(PDFFileName),$G(PDFRenderer),.Params)
}
Do $System.Status.DisplayError(tSC)
ZW
Quit tSC
}
 

Hello, Sathish, I recently published test-data app that utilizes a shell script to create a test file:

InterSystems Open Exchange
 

facture.cls defines the parameters for the RunScript classmethod.

ClassMethod DefineProductScript(
  pName As %String = "Demo2",
  pDebug As %Integer = 0) As %Status
  {
  Set pQuery = "SELECT ID from dc_iris.product WHERE Name = '?'"
  Set pQuery = $Replace(pQuery,"?",pName)
  Write:pDebug pQuery,!
  Set tSC = ##class(dc.iris.util).ExecuteQueryOneValue(pQuery,.oProduct)
  Write:pDebug tSC,!
  Set oProduct = ##class(dc.iris.product).%OpenId(oProduct)
  If ($IsObject(oProduct) = 0) Set oProduct = ##class(dc.iris.product).%New()
  Do:pDebug $System.OBJ.Dump(oProduct)
  Set oProduct.ClassName = "dc.iris.product"
  Set oProduct.MethodName = "RunScript"
  Set oProduct.RunCmd = "/opt/irisbuild/demo.sh"
  Set pRandom = "random"
  Set pOutput = "/opt/transform/practice/"
  Set pTemplate = "/usr/irissys/mgr/data/"
  Set oProduct.RunParam1 = "$Qty"
  Set oProduct.RunParam2 = pRandom
  Set oProduct.RunParam3 = pOutput
  Set oProduct.RunParam4 = pTemplate
  Set oProduct.Name = pName
  //Set oProduct.TargetPath = "/opt/transform/practice/"
  Set tSC = oProduct.%Save()
  Quit tSC
  }
ClassMethod RunScript(
  pProduct,
  pQuantity) As %Status
  {
  Set tSC = $$$OK
  Set oProduct = $Get(pProduct)
  If ($IsObject(oProduct) = 0) {
  Set oProduct = ##class(dc.iris.product).%OpenId(oProduct)
  }
  If ($IsObject(oProduct) = 0) {
  Set tSC = $$$ERROR($$$GeneralError,"No product defined")
  Quit tSC
  }
  Set pCmd = oProduct.RunCmd
  Set pNumberOfFiles = $Get(pQuantity,1)
  Set args=4
  Set args(1) = oProduct.RunParam1
  Set args(2) = oProduct.RunParam2
  Set args(3) = oProduct.RunParam3
  Set args(4) = oProduct.RunParam4
  For ii = 1:1:args {
  If (args(ii) = "$Qty") Set args(ii) = pNumberOfFiles
  }
  Set tReturn = $ZF(-100,"/SHELL",pCmd,.args)
  Quit tSC
 

}

Hi Mark,

I have adapted the code for Production Monitor into a custom class User.ProductionMonitor. It can get host info (status OK or Error) and also Queues sizes. I also created ProductionManager.csp to display the info. I hope it helps you. Hopefully you will share what you do and maybe we both get a better solution!

Please see code here: oliverwilms/production-monitor (github.com)

By default, only clients local to the Web Gateway’s hosting computer are allowed access to the Web Gateway Management pages. The browser through which the management forms are accessed must be running on the same machine as the web server and Web Gateway. For example:

http://localhost:<port_no>/csp/bin/Systems/Module.cxw

You can add additional clients to the list of authorized administrators by adding the client IP addresses to the System_Manager parameter in the SYSTEM section in CSP.ini (in install-dir\CSP\bin). The System_Manager parameter represents a comma- or plus-separated list of clients (by IP address) who may access the Web Gateway Management pages. The directive shown below grants access to three remote clients in addition to the default local access.

[SYSTEM]
System_Manager=190.8.7.6, 190.8.7.5, 190.8.7.4