Written by

InterSystems Corporation
Article Otto Medin · Apr 21, 2024 1m read

Dynamic <call> target in BPL

Hi all,

When making a Business Process reusable, I needed to make the target of a <call> configurable as a business host setting. This can be done through indirection. Here's how:

Property TargetConfigName As Ens.DataType.ConfigName;
Parameter SETTINGS = "TargetConfigName:Basic";
/// BPL Definition
XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl]
{
<process language='objectscript' request='Ens.Request' response='Ens.Response' height='2000' width='2000' >
<sequence xend='200' yend='450' >
<call name='Call configurable target' target='@process.TargetConfigName' async='1' xpos='200' ypos='250' >
<request type='Ens.Request>
<assign property="callrequestvalue="requestaction="set" />
</request>
<response type='Ens.Response>
<assign property="responsevalue="callresponseaction="set" />
</response>
</call>
<sync name='Wait' calls='Call configurable target' type='all' xpos='200' ypos='350' />
</sequence>
</process>
}

Comments

Sylvain Guilbaud · Apr 22, 2024

Hi @Otto Medin 
very good point.

In order to get links visible on the production configuration, you can add this method :

/// Return an array of connections for drawing lines on the config diagramClassMethod OnGetConnections(Output pArray As%String, pItem As Ens.Config.Item)
{
	Do##super(.pArray,pItem)
	If pItem.GetModifiedSetting("TargetConfigNames",.tValue) {
		For i=1:1:$L(tValue,",") { Set tOne=$ZStrip($P(tValue,",",i),"<>W")  Continue:""=tOne  Set pArray(tOne)="" }
	}
}

0
Ted Guarriello · Apr 22, 2024

Is there any way using that method to reference a class method call?

0
Otto Medin  Apr 29, 2024 to Ted Guarriello

Perhaps. Could you expand on what you're trying to do?

0
Eduard Lebedyuk  Apr 29, 2024 to Ted Guarriello

Do you want to call a process, the name of which is returned by a method?

You can use indirection @, or assign method result to a local variable and use @ on it.

0