Coloring IO object data

Haoyang
Haoyang New Altair Community Member
edited November 2024 in Community Q&A
Hi,

I defined an IOobject datatype, and assigned a color to it, I find it when there is too much lines consisting this type of data in a process, the previous lines will not show the correct color and this data was removed from the output of the operator(no data when I hover my mouse above the output port). It seems RM only render the last few lines that carries this type of data. I also tested this with breakpoints, I connected several operators outputting this same type of object, and have a breakpoint for each of them, when I executed the operators one by one, the first four operators have normal output line color. However, when I executed the fifth operator, the color for the first one returned to gray which was the default. Sometimes, this breakpoint method have kept all the color and sometimes not, if I don't set the breakpoint and execute the process as a whole, there will only be the last 4 lines colored. Also, even in the case where all the colors were kept because of the breakpoint, when I go to the higher process and return to this subprocess, the color will again only available to the last 4 lines. It seems that you have used a buffer or what and have cleared them after execution, without keeping the color.

Best,
Haoyang

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answers

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    Hi,
    looks like your metadata transformation code doesnt work? Then it would only show the right color after execution.

    BR,
    Martin
  • Haoyang
    Haoyang New Altair Community Member
    @MartinLiebig
    Hi, thanks for answering, I believe it's the reason.
    Could you kindly show me an example of setting the metadata transformation? I believe if I can define what kind of metadata a port is going to output, then it will automatically be colored to the right color?

    Best,
    Haoyang
  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
  • Haoyang
    Haoyang New Altair Community Member
    @MartinLiebig
    Thanks, I get it. Seems I will have to define transformation rules for each port.

    But I still have some problem, I implemented my own ioobject, which extends ResultObjectAdapter. When I used this class in the function getMetaData(), then it says my class is not a MetaData class. However, when I went to change my class to extends MetaData, I can no longer use it as  an IOobject, what should I do to get some datatype I want to pass around as an IOobject and can be used as a MetaData.

    I am new to extending RM, sorry about bothering you with so much questions.

    Best,
    Haoyang
  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    The AbstractAnomalyModel used in the code above is also a custom model defined in this extension.

    I think you need to register it in the PlugitInit ( https://github.com/MartinLiebig/rapidminer-anomalydetection/blob/master/src/main/java/com/rapidminer/extension/anomalydetection/PluginInitAnomalyDetection.java , line 67) and need to profide some config in the resources if you want to have a specific color.

    Out of interest: What kind of extension are you working on? Maybe our product team can give you a hand.

    BR,
    Martin

  • Haoyang
    Haoyang New Altair Community Member
    Answer ✓
    @MartinLiebig

    I think I found the solution, if I just want to define the metadata and color of a port, I should use the GenerateNewMDRule function, which will take a port and IOobject as input. In this case, my operator output port get the correct color. However, I implemented a super operator where this colored-port-operator is put into, when I put the operator into my self-implemented super operator, its ports lost its metadata and color, so I further investigated your ALSOOperator.java and find it necessary to add a 
    getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
    to any super operator to make sure it keeps the metadata of operators inside.

    Best,
    Haoyang
  • Haoyang
    Haoyang New Altair Community Member
    @MartinLiebig

    I am working on something to allow users to use first order logic to build tree/flowchart structures in RM, and more than that, I am also using python operators to make it more powerful which I am unable to tell at this stage because it's a research project I am working on. After all, I am quite happy you have such a good community for me to get support.

    Best,
    Haoyang
  • MartinLiebig
    MartinLiebig
    Altair Employee
    Hi,
    You have to define two classes. One for the metadata, one for the object itself. Thats what you register in the PluginInit.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.