Skip to main content
Solved

How to Expose Attribute Iteration Count in a loop

  • January 29, 2020
  • 5 replies
  • 200 views

jelle
Contributor
Forum|alt.badge.img+16
  • Contributor

I have a Custom Transformer with a loop in it. It contains Blocking Transformers, so it is linked. I would like to pass the number of iterations to the main Workspace, but I do not find how to expose the Attribute that I have set in the Advanced properties of the Custom Transformer:

the only reference that I found is: https://knowledge.safe.com/questions/4722/accessing-iteration-coutn-parameter-is-it-possible.html of @gio. Do you remember how you solved it in the end? Thanks in advance.

Best answer by gio

Hi,

 

the iteration count is a parameter, it says attribute to hold etc... but this is only "External" not "within" the custom you make. Within it is a (published) parameter.

So there is no exposing, you need to fetch the parameter into a attribute.

 

Betst to set a sampler = 1 after the creator (or parameterfetcher) as you need the information only 1X (not X nr.of feature)

Also sampling will show the iteration count on the feturecoutn (see bottom pic).

 

Here is a screencap whilst running...at 4th iteration

 

 

 

This is inside the custom.

The bottom custom output is for the ICA.

 

 

It is even possible to drive the iterationcounter by expression. In this case it was the reason i incorporated it in this custom.

 

The examples are from my "IterativeNeighbourFinder_2_2_2".\\

 

Here is output on a 10 iteration run

See the ica, sarting at missing of course. Showing runs finsished.

View original
Did this help you find an answer to your question?

5 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • January 29, 2020

Have you tried just using the AttributeExposer? If i set the attribute it's created but not exposed


jelle
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • January 29, 2020
ebygomm wrote:

Have you tried just using the AttributeExposer? If i set the attribute it's created but not exposed

Yes, that is the first thing I tried. The value remains on <missing>


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Best Answer
  • January 30, 2020

Hi,

 

the iteration count is a parameter, it says attribute to hold etc... but this is only "External" not "within" the custom you make. Within it is a (published) parameter.

So there is no exposing, you need to fetch the parameter into a attribute.

 

Betst to set a sampler = 1 after the creator (or parameterfetcher) as you need the information only 1X (not X nr.of feature)

Also sampling will show the iteration count on the feturecoutn (see bottom pic).

 

Here is a screencap whilst running...at 4th iteration

 

 

 

This is inside the custom.

The bottom custom output is for the ICA.

 

 

It is even possible to drive the iterationcounter by expression. In this case it was the reason i incorporated it in this custom.

 

The examples are from my "IterativeNeighbourFinder_2_2_2".\\

 

Here is output on a 10 iteration run

See the ica, sarting at missing of course. Showing runs finsished.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • December 2, 2020

@Jelle De Zwaef​ 

 

Ji.

 

Here is a custom setup that exposes it.

 

I used the ICA te create variable search steps. (using ICA as variable in equations)

 

It is a blockint custom in a custom.

 

Its a iterative neighborfinder.

 

 

Greets.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • December 2, 2020

Addendum

 

I see i posted this already. I respondend to FEM forummail

 

You have to take care not to enter expressions in the custom input.

Else it will lead to PArameter invoked etc. error.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings