Laura Cavanaugh · May 5, 2016 go to post

Hi Kenneth, Yes, we have a large looking Production that I'm trying to untangle. I'm tasked with a simple view of the input folders, output folders, and number of records processed, on which servers.; more simple than the production monitor view. Thanks.

Laura Cavanaugh · May 5, 2016 go to post

Ah, I was wondering about that XML view in the Production class. I did see the Documentation -- thanks -- but the end users would like something ... less spread out. Also, I'm trying to get my head around it as well, so that makes it hard to define this task. Thanks.

Laura Cavanaugh · May 5, 2016 go to post

Hi Attila, OK, how about the Services, Processes, and Operations items.  Are they in tables? Thanks.

Laura Cavanaugh · May 31, 2016 go to post

Hi Timothy,

I've tried many debug targets.  Using csp/NameHere/package.home.cls I get this error when I run it:

Caché Server Pages Version 2014.1.3.775.0

Error Condition


Error Condition

CSP application closed the connection before sending a complete response

and error #6710 "Could not attach to target" in studio.

For some reason, in the pages, we change the "homepage" to /NameHere/package.home.cls.  I wonder if that affects how I can/can't open it in debug mode using /csp/package.home.cls.

Thanks,

Laura

Oh -- the page displays if I take off the ?CSPDEBUG=1431597865 at the end of its URL...

Laura Cavanaugh · May 31, 2016 go to post

I'll try some things... Yes, the page displays when I remove the ?CSPDEBUG part.

Ah, /namehere/package.home.cls does nto work as a debug target.  I see that /namehere/ (or Samples) is the namespace.  But, this particular combo does not work: URL not found.

I'm not sure how the port would be wrong, since I can open the page as a URL, or with View/Web Page (F5)... as far as I know, the port is c orrect, since I'm using studio in DEV, etc. Is the port a part of the debug target? how does it know ?  Yes, we are running it on IIS on the DEV server.

I'll try the logging thing.

Thanks,

Laura

Laura Cavanaugh · Jun 1, 2016 go to post

Ah, ok.  Thanks for all this info.  I did look at ^%ISCLOG, but it was a ton of stuff.  I 'll seeif I can find something relevant, or record only the moment when I'm trying to connect.  The global STARTED at 3K-something and the rest was lost on my terminal. It looked like it was recording everthing from the entire server? Production, everythiing?

Thanks,

Laura

Laura Cavanaugh · Jun 1, 2016 go to post

Excellent, I will do that.  I'm sure I'll want to be able to run through the debugger at some point.  I was able to fix my bug, actually (it was an easy fix), but I do love a good debugger.

Thanks for all the help.

Laura

Laura Cavanaugh · Jun 2, 2016 go to post

Hi Timothy,

I thought you'd be interested to know that Kevin at InterSystems helped with this issue, and he found that some breakpoints inside javascript code were causing the error.  Just having the breakpoints there caused it -- the code didn't get anywhere near the breakpoints -- so he removed all of the breakpoints, and that worked.  We had to change the debug target ... the Zen application is mapped to another folder, rather than the default of /csp/namespace.

Thanks for your help!

IS was timely and helpful.  Thanks Kevin!

Laura

Laura Cavanaugh · Jun 10, 2016 go to post

$list and %ListOfDataTypes are different concepts: agreed.  but why does (%Library.ListOfDataTypes).BuildValueArray use $listnext then (and not work)?? LogicalToDisplay() also does not work -- for me.  When I use it on a LostOfDataTypes object.

What am I doing wrong?

Thanks,

Laura

Laura Cavanaugh · Jun 13, 2016 go to post

Thank you Eduard.  Looks like a serialized ListOfDataTypes is a $list, not a %ListOfDataTypes. 

This would not work (and is not):

TEST>s user=##class(Security.Users).%OpenId("testuser"))

TEST>w user.Roles
2@%Collection.ListOfDT
TEST>do ##class(%ListOfDataTypes).BuildValueArray(user.Roles,.array)
 
<LIST>zBuildValueArray+2^%Library.ListOfDataTypes.1

It does not work because the user.Roles is a %ListOfDataTypes, and not a $list.  Is there anything in the %ListOfDataTypes class that I can use to convert this object's Roles property to a nice looking string or array? Or must I first convert it to a $list?  Why isn't there a function to do that for me?

Thank you,

Laura

Laura Cavanaugh · Jun 16, 2016 go to post

Ah, that was the step that was missing -- I had to Serilaize my ListOfDataType object first.  Thank you.

Sorry -- I'm not clear on the difference between %Collection.ListOfDT and %Library.ListOfDataTypes, but seeing as ##class(%Library.ListOfDataTypes).LogicalToDisplay(roles.Serialize(),"|") works... I'm happy.  is it because both objects support it?

Thank you,

Laura

Laura Cavanaugh · Jun 16, 2016 go to post

Oh! Yes, that is working.  I had a recursive compile error that I had to fix first (two classes were dependent on each other.. caused a 2-hour delay), and then I had to fix a little logic error in my code.  

That radioSet looks quite useful.

Thank you,

Laura

Laura Cavanaugh · Jun 29, 2016 go to post

Thanks David, I'll take a look.  I'm on 2014.  How will that affect the running production?  I assume the test scenario is a bit different than the actual production, where I'll have many files, all from the ISA to the IEA, naturally. But the fact that the test wasn't working threw me a bit. 

Thanks,

Laura

Laura Cavanaugh · Jun 29, 2016 go to post

David, Yes, removing the ISA and GS segments (and corresponding GE and IEA lines) worked.  The test returns results.  That's all I needed to see.  And again, I assume that the actual transform, in the production or whenever I actually run it, won't need this.  Otherwise I'll need a transform before I run my transform.  Ooh - perhaps that's what you meant by a having to call a subtransform.  

Well, I'll keep that  in mind.

Thank you,

laura

Laura Cavanaugh · Jun 29, 2016 go to post

I'm working on an Interchange loop, which calls a subtransform on a Group, which calls a subtransform on an 835 document.  The TEST button/data returns segments (i.e. no errors), but I can't quite tell if  it's creating a new target with the properly transformed data.  I'd be happy to share the transforms on this thread if anyone would like to see them.  I'd love to know if I'm doing it correctly.

Thank you,

Laura

Laura Cavanaugh · Jun 29, 2016 go to post

Hi David,

I'm resonding to your comment " I think this is documented "; I found the below link int he documentation, but an entire section in the documentation was copied and pasted, incorrectly.  

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY…

This part doesn't make sense: 

"Create a new Data Transformation (emphasis added because the below instructions are for creating an array of groups which is the next step)

  1. Create a new set action by clicking Add Action and selecting set.

  2.  Input a variable name into the Property field, such as ArrayOfGroups.

  3.  Input ##class(%Library.VariableName).%New() into the Value field, where VariableName is the value you provided in the Property field.

  4.  Input "" into the Key field."

but I can't quite figure out what it was supposed to be. In fact, inthe next step, Creating An Array of Groups, the steps above don't work anyway. 

This is basically what I was doing with my Interchange loop, which calls the Group loop, which calls the subtransform. The interchange transform runs, but I end up with the ISA line and the IEA line, and nothing else in between. Not quite true: I end up with a reference to a GroupDocsRef in between.  My output file has just two lines however.

Anyone else have an idea?  Any examples of an Ensemble 835 DTL transform at a transaction level that I somehow missed on the web?

Thanks,

Laura

Laura Cavanaugh · Jul 7, 2016 go to post

David was correct in that I had to use object script to loop through the interchange (ISA segment) and the groups (GS segment). I was able to put that code right into the transform.  Since I'm on 2014.1.3 I had to add this code, rather than using the transformation to loop.

The code looks like this:

s GroupIn = ""
  for {
  
    s GroupIn=source.NextChild(GroupIn,source.GetSegmentIndex("GroupDocsRef",.ok))
  
    Quit:'$IsObject(GroupIn)
    s tSC =GroupIn.PokeDocType("HIPAA_5010:Group")
    s tSC=GroupIn.BuildMap()
     
    s TSIn=""
    
    For {
     Set TSIn=GroupIn.NextChild(TSIn,GroupIn.GetSegmentIndex("TransactionSetDocsRef",.ok))
     
     Quit:'$IsObject(TSIn)
     s tSC =TSIn.PokeDocType("HIPAA_5010:835")
     
     s TSOut = ""

The transformation that has the code in it looks like this:

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl]
{
<transform sourceClass='EnsLib.EDI.X12.Document' targetClass='EnsLib.EDI.X12.Document' sourceDocType='HIPAA_5010:Interchange' targetDocType='HIPAA_5010:Interchange' create='copy' language='objectscript' >
<annotation>This sorts the Transaction Sets from an Interchange into Groups. It also calls a transform on the Transaction Sets. Much of this was copied from the Demo.X12.SorterDTL.ByGroup.SorterTransform.dtl in the 2016 ENSDEMO namespace.</annotation>
<assign value='0' property='target.{GroupDocsRef:ChildCount}' action='set' >
<annotation>Initiate the child count in the Interchange to zero</annotation>
</assign>
<assign value='0' property='target.{IEA:NumberofIncludedFunctionalGr}' action='set' >
<annotation>Initiate the child count in the Interchange to zero</annotation>
</assign>
<assign value='##class(%Library.ArrayOfObjects).%New()' property='ArrayOfGroups' action='set' >
<annotation>Create the array of Groups</annotation>
</assign>
<code>
<![CDATA[ s GroupIn = ""
  for {
  
    s GroupIn=source.NextChild(GroupIn,source.GetSegmentIndex("GroupDocsRef",.ok))
  
    Quit:'$IsObject(GroupIn)
    s tSC =GroupIn.PokeDocType("HIPAA_5010:Group")
    s tSC=GroupIn.BuildMap()
     
    s TSIn=""
    
    For {
     Set TSIn=GroupIn.NextChild(TSIn,GroupIn.GetSegmentIndex("TransactionSetDocsRef",.ok))
     
     Quit:'$IsObject(TSIn)
     s tSC =TSIn.PokeDocType("HIPAA_5010:835")
     
     s TSOut = ""]]></code>
<subtransform class='My835Transform' targetObj='TSOut' sourceObj='TSIn' >
<annotation>Transform the transaction set </annotation>
</subtransform>
<assign value='TSOut.{BPR:TransactionHandlingCode}' property='key' action='set' />
<assign value='##class(HelperMethods).FindParents(TSOut,GroupIn,ArrayOfGroups,,key)' property='tSC' action='set' />
<code>  <-- another code snippit to finish the for loops
<![CDATA[ }
  }]]></code>  
<foreach property='ArrayOfGroups' key='tKey' >
<assign value='ArrayOfGroups.GetAt(tKey)' property='tGroupOut' action='set' />
<assign value='##class(HelperMethods).AddChildToDocsRef(tGroupOut,target,"GroupDocsRef")' property='tSC' action='set' />
</foreach>
</transform>

Note that it was all done using the GUI that Intersystems provides for editing a transform (in Management Portal or Studio). I copied most of the transform from Demo.X12.SorterDTL.ByGroup.SorterTransform in 2016 which I had to download to my personal computer in order to have the demo; I mostly copied the 2016 demo transform called Demo.X12.SorterDTL.byGroup.SorterTransform.dtl.

Apparently the looping in 2014 uses  EnsLib.EDI.X12.Document.GetNextIndex, which does not work, while in 2016 the looping uses Document.NextChild, which does work.  Hence, the code insertion in this 2014 transform.

I might be able to help anyone with questions about it, although InterSystems is very good at responding to WRC ticket requests.

Thanks go to Michael Breen at IS.

Laura

Laura Cavanaugh · Jul 26, 2016 go to post

Yes, the user would be some kind of admin who has access to all the tables needed to display.  And, INFORMATION_SCHEMA.TABLES is not found in the management portal, anyway.  

Thanks,

Laura

Laura Cavanaugh · Jul 26, 2016 go to post

Well, I'm getting the data with %Dictionary.CompiledClass.  It's not quite the same as a SQL table, but it will do.  if you do have any info on some kind of SQL API, however, let me know.

Thanks,

Laura

e.g.

Select Name, SqlTableName from %dictionary.compiledclass where Name [ 'Data'

Laura Cavanaugh · Jul 27, 2016 go to post

Oh that looks lovely, and it works great on my local 2016 cube, but not on my server which is 2014. I forget to check the latest version sometimes.

Oh well.

Thanks,

Laura

Laura Cavanaugh · Jul 27, 2016 go to post

Yes, I have! And it looks like a great app, but I haven't installed it yet. I'm not sure if that would give me access programmatically to the tables though; trying to populate a table of table names for security setup. Thanks for the app!

Laura

Laura Cavanaugh · Jul 29, 2016 go to post

I have tried every combination I can think of:

//zenThis.DoDebug(); //zenThis is null
//zenPage.DoDebug(); //Attempt to call non-ZENMethod
//this.DoDebug(); //attempt to call non-ZENMethod
//%this.DoDebug(); //available only in ObjectScript
//do ..DoDebug(); //same
(I'm actually calling a DoDebug zenmethod)

It's possible that i have to compile all the child classes; I just don't want to do that yet until no one else is on the system. I can call some other zenmethod that already exists, and it can find it. Just can't find my new zenmethod, although the javascript method is available.

Thanks -L

Laura Cavanaugh · Jul 29, 2016 go to post

I did indeed have to re-compile all 180 dependent classes.  The zenmethod is now available the parent page.  Good to know.

Laura Cavanaugh · Aug 11, 2016 go to post

Ah, yes... I'm thinking that it's an OS level authentication that is also a part of the connection, and that the "handshake" hadn't finished the first time.  I'll look into it. I would prefer not to have to keep duplicates in each namespace as I create more Productions.

(If you have any comments on creating Productions in separate namespaces, I'd love to hear!)

Thank you,

Laura

Laura Cavanaugh · Aug 11, 2016 go to post

No.  If the Zenmethod is a javascript method, it does not work any better.  The parameter *silent* is showing up in firebug (in FireFox) as "1", and then is immediately shown in the alert box as undefined.

I was rifiling through some of the demo code in 2016, but I could not quickly find an example of a Zenmethod calling a javascript method with a parameter.  All the javascript methods with parameters are called from html, not Zenmethods.

Aside from skipping the parameter, any thoughts?

Laura Cavanaugh · Aug 11, 2016 go to post

Yes, as written it should be fine, as indicated from tests run on w3schools.com.  This should work too:

&js<var silent='1'; zenPage.doReturn(silent);>

but alas, the compiled code (?) is not getting it. I have not yet tried a simple zen page, but I suspect it's not the code... how do I remove the compiled code and recompile? What else is there??

Thanks for your thoughts.

Laura

Laura Cavanaugh · Aug 11, 2016 go to post

I thought it was kinda funny that the compiled javascript looked like this:

self.CallReasnModify_doReturn = function(silent,silent) {
  confirm('silent = ' + silent)

but I thought it was just how InterSystems generated it.  I changed the name of the variable to 'foo' and it then looked like this:

self.CallReasnModify_doReturn = function(foo,silent) {
      confirm('silent = ' + foo)
    
    

And it worked. ?  Brings me back around to a compile thing. What's the deal with the extra parameter in there?

Laura Cavanaugh · Aug 11, 2016 go to post

Cache for Windows (x86-64) 2014.1.3 (Build 775U) Fri Nov 21 2014 12:34:59 EST

This has happened to me before....