Hello Deepak, 

Looking at your JSON, it seems your property name has a “view” too much in it, 
it should be : 

> "propertyName": "properties.viewCount"


Regards,
  Serge… 

> On 21 Jun 2017, at 11:06, Deepak Malhotra <[email protected]> wrote:
> 
> Dear Serge,
> 
> Thanks for the reply.
> 
> I tried creating segment you have given and was able to segment user on that 
> basis.
> But when i m trying to create my new segment having below structure
> 
> {
>   "metadata": {
>     "id": "viewCount",
>     "scope": "viewcountscope",
>     "enabled": true,
>     "name": "View count Segment",
>     "description": "Segment of user view count"
>   },
>   "condition": {
>     "type": "profilePropertyCondition",
>     "parameterValues": {
>       "propertyName": "properties.view.viewCount",
>       "comparisonOperator": "greaterThan",
>       "propertyValue": 3
>     }
>   }
> }
> 
> and data is stored is below format
> 
> It's Json
> properties: {
> nbOfVisits: 124,
> lastVisit: "2017-06-20T04:40:19Z",
> firstVisit: "2017-06-18T07:07:45Z",
> previousVisit: "2017-06-20T04:31:18Z",
> signup: [],
> account: [],
> view: [
> {
> pageUrl: [
> "https://gohellotv.in/vu/287387/sooo-bad 
> <https://gohellotv.in/vu/287387/sooo-bad>",
> "https://gohellotv.in/vu/287387/sooo-bad 
> <https://gohellotv.in/vu/287387/sooo-bad>",
> "https://gohellotv.in/search/rajdeepmishra45 
> <https://gohellotv.in/search/rajdeepmishra45>",
> "https://gohellotv.in/discover <https://gohellotv.in/discover>"
> ],
> viewCount: 4,
> title: "sooo bad",
> categoryName: "Movies",
> userId: "30157911",
> cId: "287387",
> hashtag: "#funny"
> },
> 
> So we are getting ognl.enhance.UnsupportedCompilationException: Can't compile 
> nested chain expressions.
> ognl.OgnlException: source is null for getProperty(null, "viewCount")
> 
> So,can you please help us to sort out this.
> Thanks !!
> 
> Thanks and Regards
> Deepak Malhotra
> Software Developer
> P K Online Ventures Pvt. Ltd.
> Building No. 128, Ground Floor, Institutional Area,
> Sector 44, Near Apparel House, Gurugram, Haryana 122001
> 
> On Tue, Jun 20, 2017 at 7:02 PM, Serge Huber <[email protected] 
> <mailto:[email protected]>> wrote:
> Hello you can find the API for manipulating segments here :
> 
> http://unomi.incubator.apache.org/rest-api-doc/index.html#1558745832 
> <http://unomi.incubator.apache.org/rest-api-doc/index.html#1558745832>
> 
> Note that you will need to access it through the secure endpoint at
> https://localhost:9443/cxs <https://localhost:9443/cxs> (it works also on the 
> endpoint
> http://localhost:8181/cxs <http://localhost:8181/cxs> but this is due to a 
> bug so it might go away in
> the future).
> 
> Most of the field should be self explanatory except for the conditions. The
> condition is actually a tree of conditions. Here is an example of a segment
> definition with a simple condition:
> 
> {
>   "metadata": {
>     "id": "uniqueSegmentId",
>     "scope": "exampleScope",
>     "enabled": true,
>     "name": "Example segment name",
>     "description": "Example segment description"
>   },
>   "condition": {
>     "type": "profilePropertyCondition",
>     "parameterValues": {
>       "propertyName": "properties.nbOfVisits",
>       "comparisonOperator": "greaterThan",
>       "propertyValueInteger": 3
>     }
>   }
> }
> 
> In this example, we create a segment that will incorporate all the profiles
> that have the property nbOfVisits greater than 3. The available conditions
> are deployed in Unomi using JSON files you can find in the
> META-INF/cxs/conditions directory, as in this example:
> https://github.com/apache/incubator-unomi/tree/master/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions
>  
> <https://github.com/apache/incubator-unomi/tree/master/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions>
> 
> The condition system is actually pluggeable, so you could build your own
> new conditions or extend existing ones. Each condition JSON defines the
> parameters that are available, as well as their type. For example the
> booleanCondition.json description boolean conditions that accept
> sub-conditions and a boolean operator to combine conditions using a boolean
> operator.
> 
> Here is an example of a segment that has a boolean condition and
> sub-conditions:
> 
> {
>   "metadata": {
>     "id": "_8yux206mc",
>     "scope": "exampleScope",
>     "enabled": true,
>     "name": "booleanSegment",
>     "description": "booleanSegmentDescription"
>   },
>   "condition": {
>     "type": "booleanCondition",
>     "parameterValues": {
>       "operator": "and",
>       "subConditions": [
>         {
>           "type": "profilePropertyCondition",
>           "parameterValues": {
>             "propertyName": "properties.age",
>             "comparisonOperator": "greaterThanOrEqualTo",
>             "propertyValueInteger": 18
>           }
>         },
>         {
>           "type": "profilePropertyCondition",
>           "parameterValues": {
>             "propertyName": "properties.gender",
>             "comparisonOperator": "equals",
>             "propertyValue": "male"
>           }
>         }
>       ]
>     }
>   }
> }
> 
> In this example you can see the boolean condition type with the parameter
> values using the "and" operator and the sub-conditions. In this case we
> build a segment that checks if the profile properties age is greater than
> or equal to 18 and the gender is male.
> 
> If we look at the booleanCondition.json file available here :
> https://github.com/apache/incubator-unomi/blob/master/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/booleanCondition.json
>  
> <https://github.com/apache/incubator-unomi/blob/master/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/booleanCondition.json>
> 
> 
> {
>   "metadata": {
>     "id": "booleanCondition",
>     "name": "booleanCondition",
>     "description": "",
>     "tags": [
>       "logical",
>       "profileCondition",
>       "eventCondition",
>       "sessionCondition",
>       "sourceEventCondition"
>     ],
>     "readOnly": true
>   },
>   "conditionEvaluator": "booleanConditionEvaluator",
>   "queryBuilder": "booleanConditionESQueryBuilder",
>   "parameters": [
>     {
>       "id": "operator",
>       "type": "String",
>       "multivalued": false,
>       "defaultValue": "and"
>     },
>     {
>       "id": "subConditions",
>       "type": "Condition",
>       "multivalued": true
>     }
>   ]
> }
> 
> You can see it defines those two parameters we used. The conditionEvaluator
> and queryBuilder properties are references to OSGi service properties
> declared in the plugin's Blueprint descriptor file, which you can find here
> :
> https://github.com/apache/incubator-unomi/blob/master/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
>  
> <https://github.com/apache/incubator-unomi/blob/master/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml>
> 
> This is only interesting to you if you want to define new conditions, but
> you should already be able to do a lot with the built-in conditions as they
> may be combined in complex ways to segment the profiles. Please note that
> conditions should be kept simple as they do have an impact on performance.
> 
> This should get you started (I hope), let me know if you have additional
> questions, I'll do my best to answer them.
> 
> Best regards,
>   Serge Huber.
> 
> Serge Huber
> CTO & Co-Founder
> T +41 22 361 3424
> 9 route des Jeunes | 1227 Acacias | Switzerland
> jahia.com <http://jahia.com/> <http://www.jahia.com/ <http://www.jahia.com/>>
> SKYPE | LINKEDIN <https://www.linkedin.com/in/sergehuber 
> <https://www.linkedin.com/in/sergehuber>> | TWITTER
> <https://twitter.com/sergehuber <https://twitter.com/sergehuber>> | VCARD
> <http://www.jahia.com/vcard/HuberSerge.vcf 
> <http://www.jahia.com/vcard/HuberSerge.vcf>>
> 
> 
> > JOIN OUR COMMUNITY <http://www.jahia.com/ <http://www.jahia.com/>> to 
> > evaluate, get trained and
> to discover why Jahia is a leading User Experience Platform (UXP) for
> Digital Transformation.
> 
> On Tue, Jun 20, 2017 at 11:41 AM, Deepak Malhotra <
> [email protected] <mailto:[email protected]>> wrote:
> 
> > Hi Unomi Dev Team,
> >
> > Me and my team is working on unomi and done capturing part now we want to
> > do segmentation,but we are not able to make it
> > So,any help from your side on it would be appreciated.
> >
> > *Thanks and Regards*
> >
> > *Deepak MalhotraSoftware Developer*
> > *P K Online Ventures Pvt. Ltd.*
> >

Reply via email to