Dmitry Maslennikov · Feb 16, 2016 go to post

You can calculate such property on a class side, something like this. Index by CitizenRef and RelocationDate, and method which looking for the next date, and returns true if nothing found.

Index CitizenRelocation On (CitizenRef, RelocationDate);

Property IsLastKnownRecord As %Boolean [ Calculated, SqlComputeCode = {set {*}=##class({%%CLASSNAME}).IsLastKnownRecordCheck({CitizenRef}, {RelocationDate})}, SqlComputed ];

Method IsLastKnownRecordGet() As %Boolean
{
    quit ..IsLastKnownRecordCheck(i%CitizenRef, i%RelocationDate)
}

ClassMethod IsLastKnownRecordCheck(CitizenRef As %Integer, RelocationDate As %Date) As %Boolean [ CodeMode = objectgenerator ]
{
    set storagename="Default"
    set storageInd=%class.Storages.FindObjectId(%classname_"||"_storagename)
    set storage=%class.Storages.GetAt(storageInd)
    set indexLocation=storage.IndexLocation
    set indexLocation=$name(@indexLocation@("CitizenRelocation"))
    do %code.WriteLine($c(9)_"quit $order(@($name("_indexLocation_"))@(CitizenRef, RelocationDate))=""""")
    quit $$$OK
}

And result you can see below

Dmitry Maslennikov · Feb 15, 2016 go to post

When macrocomment appeared in the same line with continue, next line will be marked as an error

for i=1:1:10 {

  continue:condition ##; comment

  set a=1

}

 

Interesting example I've found in Ens.Util.Time

                GoTo $Case(spec

                ,"a":getWeekdayAbbrev

                ,"A":getWeekdayFull

                ,"b":getMonthAbbrev

                ,"Z":getTimezoneName

                ,:getX)


 

Dmitry Maslennikov · Feb 15, 2016 go to post

Cache for Windows (x86-64) 2016.2 (Build 595U) Wed Feb 10 2016 19:12:54 EST

Action `Delete` in context menu by project items, no works after first use.

 

 

Deleting three thousands of items at once leads to Atelier does not respond. In project folder nothing changes. And all that time CPU in ~70% and about 2Gb memory

Dmitry Maslennikov · Feb 15, 2016 go to post

I just have found that $system.OBJ.Load() supports loading in an UDL format. And found $system.OBJ.ExportUDL() which can export classes and routines in UDL format. So, it means that we can easily organize work in Studio and in Atelier at the same time. What we should, it is to export all files in Studio hook at the same manner as it doing Atelier.

With this new possiblility, will be much easier to migrate from Studio to Atelier.

Thanks.

Dmitry Maslennikov · Feb 15, 2016 go to post

Well, we got very exciting feature.

But how about some more methods for arrays, such as:  $unshift, $pop, $shift, $concat, $join, $slice ?

It would be very helpful.

And as we have $listbuilds in Caché, I want to easily convert it to json array like below

set array = ([]).$from($lb(1,2,3))

do array.$toJSON()

[1, 2, 3]

 

Dmitry Maslennikov · Feb 12, 2016 go to post

As you may already know, tables in Caché is a classes. And Class defintion stores in %Dictionary Package.

SELECT * FROM %Dictionary.PropertyDefinition where parent='Sample.Person'

Dmitry Maslennikov · Feb 12, 2016 go to post

Ok then, how to manage to get it worked with REST in Caché. For example. My application uses REST dispatch class for csp application. This class returns static files from disk in development, or from XData in production. And then I need to use WebSocket as well, but all requests catch by REST class. And in REST route map, i want to have path '/websocket', and send it to my WebSocket class.

You want to log, every outputs in csession like in cterm in windows, or just want to log every output for concrete command/routine ?

Unfortunately not so many information could be found in documentation, yet. But what I know, when ordinary class/classmethod or clientmethod defined in %Dictionary.MethodDefinition, systemmethod defined in %Dictionary.SystemMethodDefinition (link to localhost:57772). Defintion for systemmethod is quite close to method, but with much less parameters.

Hi Luca,
Will there any academic sessions at global summit with Docker ?

I think it should be, it will be very helpful, to understand how it works with Cache, how possible to deploy applications. I like docker, and think about it, but still do not understand how it can be used with our applications, and how to make container for it, and connect to Cache's container.

Dmitry Maslennikov · Jan 27, 2016 go to post

Yes, it is so. And yes, I'm already have enough rep for editing. But I'm not sure in stackoverflow rules, is it available for such changes? And I'm not sure in my english, that's maybe main reason, why I have not done it yet.

Dmitry Maslennikov · Jan 26, 2016 go to post

And even if you don't extend any classes, it any case will be hidden extend with %Library.Base. and %systemInclude still be included.

Dmitry Maslennikov · Jan 26, 2016 go to post

I'm very agree, with advertising stackoverflow tags, it is a very good platform for questions. But unfortunately just a few people use it, some more at different google groups , and as I think much more at russian forum sql.ru.  But I see that stackoverflow, much better that any others. Unfortunately here as we already know, it is quite difficult to  recognize a question in new posts. And very bad that this site still does not have any RSS, i can't wait when it happen. And too difficult to catch any new posts via email subscriptions, which is so ugly yet.



You mentioned tag objectscript at stackoverflow, but I don't understand why so many people choose it as relevant to intersystems technologies. It does not, it looks odd, even every last question marked with this tag, depends only with caché. And it looks we should change description for this tag, which will be relevant to Caché. 

Dmitry Maslennikov · Jan 23, 2016 go to post

Is it your account on github ?

Looks like you already know how to create repository and work with github.

Just create another repository,  and create some readme (in english), license file. Most of projects on InterSystems technologies uses MIT license.

In your porject more then one class, so better to export each file separately. Easy to do it with Studio hooks, for example with this project. It can help to export project files automaticaly after compile.

And then after publish your project, Evgeny or somebody else who manage intersystems account, will fork it.

Dmitry Maslennikov · Jan 21, 2016 go to post

Final method or not it checks only in a compile time.  Much helpier would be if you show an error which you get. 

Dmitry Maslennikov · Jan 21, 2016 go to post

In Cache uses typeless language. So in some cases such as in command IF

if varName write "true" else  write "false"

or any other logical operations any non zero values will be as true values.

and '1 will give a 0

Dmitry Maslennikov · Jan 21, 2016 go to post

I guess that you writing an function for rule.  And your class where you do it extends  Ens.Util.FunctionSet  where Lookup is located. Lookup is a method and you should call it as a method, now it is as variable.

 
/// Returns the participant code based on MSH-4
ClassMethod getParticipant(iSendingFacility As %String) As %String [ Final ]
{
   set = $PIECE(iSendingFacility,"^",1)
   set = $PIECE(iSendingFacility,"^",2)
   set sc1 = ..Lookup("ParticipantCodeMap",a)
   if sc1 = "" {
      set sc1 = ..Lookup("ParticipantCodeMap",b)
   }
   sc1
}
 

And if you want to call it by terminal, it should be so:

 write ##class(Ens.Util.FunctionSet).Lookup("ParticipantCodeMap","1083601330")
Dmitry Maslennikov · Jan 21, 2016 go to post

What do you mean by environment ? In Cache we dont have such term.

Maybe you mean System Mode  on page "Memory and Startup" Page. If so,  that value only stores in global here  ^%SYS("SystemMode")

Dmitry Maslennikov · Jan 21, 2016 go to post

Well, with this example, I just changed that block, which works for all rest pages in a group except the first one.

<masterreference masterReference="rest" pagePosition="rest">
<document width="8.5in" height="11in" marginLeft="1.25in" 
marginRight="1.25in" marginTop="1.0in" 
marginBottom="1.0in" headerHeight="1.0in">
</document>
<pageheader>
<table orient="col" layout="fixed" width="6in">
<item style="text-align:left" value="Sales Report" />
<item field="@name" width="2in"></item>
<item style="text-align:right" special="page-number-of-with-xpath" field="@name" />
</table>
</pageheader>
</masterreference>
 

And it shows Sale rep in a header where page counter was shown before, for example

Sales Report Jack 2 of 5

Sales Report Jen 3 of 5

You can see my result here. A changed only first section.

Dmitry Maslennikov · Jan 21, 2016 go to post

Hi Steve, are you have seen class  ZENReports.PageLayouts in SAMPLES namespace? It shows a lot possiblities for ZEN Reports. Page headers as well. And with sample is not so difficult to make a groupped report with a value on ech page at header.  For more control on page header in reports, you should look at page  pagemaster masterreference pageheader

Dmitry Maslennikov · Jan 14, 2016 go to post

And every time for any cases, it add only 1 point. And even every view of page, unique or not also give you points.

Dmitry Maslennikov · Jan 14, 2016 go to post

Templates in ZEN, is a quite simple as I think. When you doing template page just add <pane paneName="MainContent"/>. And then in a children, you should add XData with the same name "MainContent", which starting with tag <pane>.

XData MainContent
{
<pane xmlns="http://www.intersystems.com/zen">
</pane>
}
 

You should not rewrite Contects XData in children pages, and such subpanes could in the same class, or in children. 

Dmitry Maslennikov · Jan 14, 2016 go to post

Yes, here form is required, data could tied with model only via dataController, and form or dataGrid

Dmitry Maslennikov · Jan 13, 2016 go to post

In this case, in a table you just add a new column with link 

so, now, we got an contact's ID in every row.

and then in a ViewContact page, we should add a dataController, to our Model, and define an modelId, from url

<dataController id="contactData" 

                modelClass="ZenTutorial.ContactModel"

                 modelId="#(%url.ID)#" />

You can set modelId with URI Parameters as weel, after adding a property:

Property ContactID As %ZEN.Datatype.integer(ZENURL = "ID");

and new modelId, which now uses our new Property 

modelId="#(%page.ContactID)#"



and finally form, wich connected with previously added controllerId, and it shows two fields, read only, yet. But it is not so diffucult to add editng.

<form id="MyForm" layout="vertical" controllerId="contactData">

  <text label="ID:" id="ID" name="ID" 

    dataBinding="%id" size="5"

    readOnly="true"/>
  <text label="Name:" id="Name" name="Name" 

    dataBinding="Name" size="30"

    labelClass="required" required="true"/>

</form>

 

Dmitry Maslennikov · Jan 13, 2016 go to post

It is just a simple working example. But for reali life, it could be in some class. And flexible it will be with good UI, storage anyway for such task is quite simple. How well will be your UI, for organize that tree, so flexible it will be. Here is an example of complete UI, for creatingand running Decision trees. I think you could try to connect this project with Cache. And I think it is possible to find more web-libraries, which could help you.