You have to cast your %CharacterStream to a specific implementation, say, to %GlobalCharacterStream. The latter one implements %GlobalStreamAdaptor, which inherits from %AbstractStream and %Stream.Object. Finally, the %Stream.Object class exposes the CopyFrom method which allows you to copy data from your %Stream.GlobalBinary instance (and vice versa)

It seems to me that I found the answer (was googling for two hours and found nothing, then used forum search and voila):

  1. Declare a class which inherits Ens.Production:
Class My.Production Extends Ens.Production
{

XData ProductionDefinition
{
<Production Name="My.Production" TestingEnabled="true" LogGeneralTraceEvents="true">
  <Description></Description>
  <ActorPoolSize>1</ActorPoolSize>
</Production>
}
}
  1. And launch:
Set isProductionRunning = ##class(Ens.Director).IsProductionRunning("My.Production")
If isProductionRunning = 0 {
            Set sc = ##class(Ens.Director).StartProduction("My.Production")
}

> What parameter are you trying to change?

My subclassed Transform calls some external web service and I want to  allow a user configure that web service settings (url-port-ssl-etc) by clicking on the business process <transform> element. Also, it is crucial that such a transformation cannot be delegated to BO. So anyway, thank you, it is fine if I move settings to BP, but it is not that elegant :(

Here it is:

Class MyHL7HTTPService Extends EnsLib.HL7.Service.HTTPService
{

Method OnAdapterHTTPResponse(
    ByRef pStatus As %Status,
    ByRef pHTTPResponseStatus As %String,
    ByRef pBodyLen As %Integer,
    ByRef pResponseBodyStream As %Stream.Object,
    ByRef pMainResponseHeader As %String,
    ByRef pHeaderExtra As %String)
{
    set pHeaderExtra = pHeaderExtra _ "Access-Control-Allow-Origin: *"_ $char(13) _ $char(10) 
                                    _ "Access-Control-Allow-Headers: *" _ $char(13) _ $char(10) 
                                    _ "Access-Control-Allow-Methods: *" _ $char(13) _ $char(10)
}

}