Hi Analytics team,

I have wrote a siddhi extension to retrieve devices of user and an
execution plan with that extension as follows:

@Export('org.wso2.iot.operation:1.0.0')
define stream operation (meta_deviceIdentifiers string, meta_deviceType
string, code string, type string, isEnabled bool, payLoad string);

define trigger cronTriggerStream at '0 * * ? * *' ;

from cronTriggerStream
select device:getDevicesOfUser("admin", "android") as
meta_deviceIdentifiers, "android" as meta_deviceType, "NOTIFICATION" as
code, "PROFILE" as type, true as isEnabled, "{'messageText':'Hello'}" as
payLoad
insert into operation;

device:getDevicesOfUser extension supposed to retrieve device ids of the
user. Internal logic in this execution plan does have getting tenant id
from the privilege carbon context. However when this extension get called
as above with using a trigger instead of external event, it doesn't set the
tenant id which running the execution plan, in to privilege carbon context.
When I debugged the code, I have found tenant id as -1.

Do we need to do any additional things to make trigger in execution plan to
be aware with the tenant which it is running?

Thanks & regards,
/charithag
-- 
*Charitha Goonetilleke*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 77 751 3669 <%2B94777513669>
Twitter:@CharithaWs <https://twitter.com/CharithaWs>, fb: charithag
<https://www.facebook.com/charithag>, linkedin: charithag
<http://www.linkedin.com/in/charithag>

<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to