🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

[SOLVED]How to check the input Object Type?

User: "wujiang"
New Altair Community Member
Updated by Jocelyn
Hello,

-I have two output ports which contents "obj1 (obj1.class), obj2 (obj2.class)" for each as the release object.
-I have one input prot.
-What I want is checking the input object type when I get the Data form whatever which output port released.

obj1(output) \
                    ------- input port  
obj2(output) /

I thought I can do like:

if(input.getData() instancof Obj1)
   do ....
But the "getData()" method was deprecated

I have to use "input.get(Obj1.class)" or"input.get(Obj2.class)"

If I do so, I think the way what I just proposed won't be work.

Could you help me?

Thanks

Jiang

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Marco_Boeck"
    New Altair Community Member
    Hi,

    you can call "getAnyDataOrNull()" on the input port. You can then check what you got and deliver it to the desired output port.

    Regards,
    Marco
    User: "wujiang"
    New Altair Community Member
    OP
    Thanks Marco, It works fine.  ;D ;D ;D