Forum Discussion

jeswin's avatar
jeswin
Visitor
9 years ago

Is it possible to return string from Task?

Hi,

In scene graph Task Component

can we return string value instead of content node?

<interface>
    <field id = "ProcessType" type = "string" />
    <field id = "content" type = "node" />
    <field id="isValid" type="boolean" />
  </interface>


Can i return ProcessType value to Scene?

4 Replies

  • Absolutely!
    You can return any type that RSG supports - string, [ ], { }... any JSON sausage you can think of, plus a few more.
  • Thank you for your reply.

    Can you just give an example how you will get the string value from Task component to Scene component.

    I accept we can set the value for interface, but how will you return string from a function in Task Component.

    For example:

    m.taskContent = createObject("roSGNode","contentReader")
    m.taskContent.FunctionName="getProcessType"
    m.taskContent.Control="RUN"

    processType =""
    processType = m.taskContent.ProcessType


    is it possible like this? or in any other way?
  • Use this code in your Scene component:

    m.taskContent.ObserveField("ProcessType", "onProcessType")

    sub onProcessType()
        print "ProcessType: "; m.taskContent.ProcessType
    end sub
  • Yea i am doing like this only, it is working fine mate.
    Thanks for your reply