Breadcrumbs

Step 3 Modify a macro

Now you know how to record and how to play a macro. Let's go further and let's modify an existing macro.

Change existing blocks


Open the Active Pro Macro Manager

  active pro macro manager.png


You will see the Macro you recorded before

image2019-8-25_12-2-42.png


Open it by double clicking on it.

image2019-8-25_12-3-56.png


So if you didn't fall asleep before, you remember that one modification was generating one block. Let's have a look to the third block (the first modification though) called "Set facets to..."

To open a block, just double click on it, a popup will appear. Let's examine it in details.

  • Notice that the block is a "Set Value Block". There is a different block for every type of modification (Add Component, Add link, Add relation...)

  • The target is where the modification will happen. It's relative to where your started recording the macro. Here was the device. So it's modifying the point called "Index".

  • There are several ways to define the value. Here it automatically chose "Container" and added the facets.

image2019-8-25_12-6-14.png


Let's change the value of the facets to add a min to 0 and a precision of 2.

image2019-8-25_12-24-28.png

Hit ok. Save the bog file.


Play again the macro (with a manual selection or using the query). See the changes

image2019-8-25_12-25-54.png


Append new modifications to an existing macro


Let's say now you want to add an history extension to the index point, change the interval and enable the extension. You can do this easily by overriding an existing macro.

Start recording a macro again from the same origin (the first device in our example). 

But instead of creating a new macro, select "override" and choose the previous macro.

Hit Record.

image2019-8-25_12-29-50.png


Add the history extension to the index point.

Change the interval

Enable the extension.

image2019-8-25_12-31-52.png


When you're done, again click right and stop recording. See the result. Three more blocks have been added to the macro.

image2019-8-25_12-41-23.png


[Advanced] Create new blocks


Let's continue our example and let's say now you want to change the History Name.

image2019-8-25_12-47-13.png


 You can append the existing macro as we did before, or you can just add a block from the palette.

Open the macro through Active Pro Macro Manager

active pro macro manager.png

And open your macro.


Open the btibMacro palette, the "blocks" folder and drag a SetSlot component to the macro. Put it between the last block and the end block (remove the existing link between them)

And link the executed topic to the execute action.

image2019-8-25_12-55-59.png

Now open the block. We have to define:

  • The target

  • The slotName

  • The value

image2019-8-25_12-57-26.png


The target is the history extension we added before.

Locate the block called "Add Numeric Interval...".

image2019-8-25_12-58-29.png


There is a part at the top called "Artifacts". Whenever a block add a new component, it references it through an artifact so you are able to reuse it later.

Have a look to the following block like "Set interval to 5 mins". The target is {artifact1}. The syntax follows SFormat (Super Format). We don't need to see it in details here, just remember to put the artifact into curly brackets.

image2019-8-25_13-0-31.png


So let's set our new block. Choose extract Value from "Container".

image2019-8-25_13-2-39.png


Then Select the type baja:Format which is the type of the slot "HistoryName"

image2019-8-25_13-3-45.png

And fill-in with %parent.parent.displayName%_index for example. Then hit ok. Save the macro

image2019-8-25_13-4-55.png

Play it again.


Next Step


Step 4 Go beyond with macros