Solved

Object connection transformation

  • 22 January 2020
  • 30 replies
  • 1645 views

Userlevel 3
Badge +5

Hi,

I was able to create  my first connection object and I had to create my own transformation method, following guidelines found in OpenIFS forum.

When I tested it (with the Test transformation option ) , I got a successful status.

But it does not work on the target LU.

What is the best way to debug this problem ? Haven’t found anything in the Debug console.

 

Thanks

 

Michael

icon

Best answer by Mathias Dahl 20 February 2020, 23:12

View original

30 replies

Userlevel 7
Badge +30

Hi,

This is not easy to debug and, I think that your transformation is called from IFS MWS, which means you will not find it in the debug console).

You need to make sure your transformation method actually works, but running it outside IFS. You need to send in correct input, in the form of a LU name and key ref (as I remember it), and it must produce another correct LU and key ref as output (or a list).

To have something to compare with, try run any of the other transformation IFS ships with, and see how they behave.

If you post your method here, perhaps we can spot a problem with it. Also, when you say it does not work, what does it actually mean? :) What are you testing with? What did you expect? Are there documents connected to the Source LU? Many things can go wrong when you first try this out…

/Mathias

 

Userlevel 3
Badge +5

Hi,

I expect to have documents connected to the Source LU to be available in the target LU. This is my understanding… There are indeed media documents connected to the source LU.

I wanted to test it outside IFS, but I do not exactly know what the first parameter looks like.

But it looks ok with the Key transformation test…

Anything wrong in my method ?

Thanks

/Michel

 

Userlevel 2
Badge +6

Hi,

you write you would like to attach documents and show them in the connected target LU. At the screenshot you entered the service “MediaLibary”. MediaLibary means, that you connect a media item at the source LU and the media item will be shown at the target LU. For documents you must chose a different service.

 

Maybe this is only a small configuration mistake?

 

Best regards,

Sarah

Userlevel 7
Badge +30

Hi,

you write you would like to attach documents and show them in the connected target LU. At the screenshot you entered the service “MediaLibary”. MediaLibary means, that you connect a media item at the source LU and the media item will be shown at the target LU. For documents you must chose a different service.

Exactly. If you want to use Object Connection Transformation for Attachments / Documents, you need to use the service DocReferenceObject.

 

Userlevel 3
Badge +5

Hi,

It is my mistake. I should have written “media item” rather than “media document”.

Here is a screenshot… Am I correct ?

Thanks

 

/Michel

 

Userlevel 7
Badge +30

If it is the items under Media you want to make visible in another place, you should use the MediaLibrary service, yes. It is not clear to me “where” in the application/screen you have the input focus. That determines what LU name you should use, for both source and target. You can see, under System Info, what the “Attachment LU” is. It is critical that you use the correct one, both for target and source. Normally Attachment LU is the same as Logical Unit, but not always.

In order to help out, it would be good if you could post two images, one where you show the full screen where the user is, and showing where the input focus is set right now. The second would be an image of the source screen, showing where the input focus is.

 

Userlevel 3
Badge +5

HI,

  1. Source LU with focus on Media.
  1. Now, the System info…
  1. The target with focus on media.
  1. The target System info.

 

  1. Both Attachment LU correspond to the values I have in the Object transformation

 

Userlevel 7
Badge +30

Looks like you have the correct LU names for Target and Source. Unless there is a bug in one of those forms (in the target form, would be my guess), then the only possible reason for it not working is that there is a problem in your transformation code.

 

Userlevel 7
Badge +30

One thing you could try is to just return the source key ref and not a list. This line adds the key re you found to a list:

Obj_Connect_Lu_Transform_API.Add_To_Source_Key_Ref_List(source_key_ref_list_, source_key_ref_);

However, in your case, there is not need for a list, since you only return one source object. With that said, I cannot say why it should fail, since we DO support returning multiple key refs…

I had a quick look at one of the standard transformation methods and in that one they only return a string with the source key ref.

Worth a try…

 

 

Userlevel 3
Badge +5

Hi Mathias,

 

I commented out the call to the function and changed the return value.

I still get a successful status when I use the Key Test transformation RMB option.

But no luck with the target…

Should we then suspect a bug as you suggest and I should open a case with IFS support?

 

 

Userlevel 7
Badge +30

Hi again,

I deployed your custom API and configured OCT like you have done, and it works for me. I am testing on Apps 10 Update 7, but I don’t think it should matter much since this has been quite stable for a long time. I did a small recording to show how my screens look:

https://imgur.com/a/nQgBwRC

So, the way I see it, there is not bug to be found. But I cannot understand why it does not work for you. Are you absolutely sure you have the focus in the right place in the form, when you test? In some forms, the focus tend to jump around and, as a user, if you want to see what is connected in a certain part of the form, you need to click there. In the video above I have to click on the actual line under the Variables tab, for example, to see any media items at all.

Good luck!

/Mathias

 

Userlevel 7
Badge +30

One more thing: Sometimes, the Test command says things are successful, even though it will not work. It is important to see that something that looks like a valid key ref is returned, as below:

You said the test was successful, but I don’t think you mentioned if the Source Key looked correct.

By the way, and I don’t know manufacturing, but I noticed that the Shop_Order_Analysis_Api.Get_Control_Plan_No method can sometimes return NULL. In such cases, it will not work, of course (since there is no control plan to get media from).

 

Userlevel 3
Badge +5

Hi Mathias,

There are 2 videos , one IFS and one Oracle SQL developper  with a different Control plan record :

https://drive.google.com/open?id=1kbWe0XxSq9QJfC94WDktE8oGZRureKQ5

 

I do not see anything wrong so far...

If the value returned by the function shop_order_analysis_api.get_control_plan_no(analysis_no_) looks correct, I have no idea what is the parameter value received by the function!!!

 

Thanks,

 

/Michel

Userlevel 7
Badge +30

Hi,

Thanks for the videos!

There is one critical moment in the video, where you arrive in the Analysis Result screen. You show that there are no connected media items or documents. But, and this ties back to something I touched on earlier: where is the input focus in the form? If it is not on the Variable lines you are not seeing what you want to see. It is hard to see if you click in the Variables table or not. Can you confirm that you have clicked on a line there?

/Mathias

 

Userlevel 3
Badge +5

Hi,

 

I uploaded a new video (IFS with focus) that should show focus on different Variable lines.

Thanks for your time...

 

/Michel

Userlevel 7
Badge +30

Thanks! It does indeed seem like it does not work in your environment. I am running out of ideas here, but have some questions still:

  1. What version are you on?
  2. Are there any customizations in this area?
  3. When I looked, there was a standard (from R&D) OCT rule from ManufTool to QmanSampleValue. Is that working? Are any OCT rules working?
  4. This is a silly question, but I don’t think I know, and the screenshot and videos does not show, so: is your new rule Active? (there are checkboxes to the right)
Userlevel 3
Badge +5

Hi Mathias,

 

Here are the answers :

 

  1. 10.7
  2. No
  3. There is no data in ManufTool. We will create some and test it.
  4. YES. :-)
Userlevel 7
Badge +30

Thanks! Looking forward to hear if any OCT rules are working in your environment. This gets more and more “strange”…

 

Userlevel 3
Badge +5

Hi Mathias,

 

I tried the standard  OCT rule from ManufTool to QmanSampleValue as you suggested in two environments (the customer and our own testing ). It works fine in both cases. I am also running out of ideas!!!

 

Michel

Userlevel 7
Badge +30

Hi,

The plot thickens, as they say… This makes no sense. One explanation would be that your rule, or the transformation method, is not run/used (if that is the case, I would not understand why...).

I think I have found a way for you to check what the OCT framework returns, for your objects. Here is an example that I just tried:

select * from table (doc_reference_object_api.Get_Key_Refs('ShopOrd', 'ORDER_NO=200142^RELEASE_NO=*^SEQUENCE_NO=*^'));

Above, replace the lu name and keyref with the one for your target object and see what is returned. For me, this data is returned:

SRC_LU_NAME        TRANS_SRC_LU_NAME    KEY_REF                                         READ_

------------------ -------------------- ----------------------------------------------- -----

ShopOrd            Shop Order           ORDER_NO=200142^RELEASE_NO=*^SEQUENCE_NO=*^     FALSE

EngPartRevision    Engineering Part Rev PART_NO=5000^PART_REV=^                         TRUE

PartRevision       Part Revision        CONTRACT=501^ENG_CHG_LEVEL=1^PART_NO=5000^      TRUE

(sorry about the formatting, if you copy and paste it someplace it may look better)

If the query above works for you, that is it returns some data, you can add some debug/trace statements in your transformation method to see if the code actually runs. Don’t forget to enable server output.

Good luck!

/Mathias

 

Userlevel 3
Badge +5

Hi Mathias,

Hard to believe but it now works!!!

Yesterday, I had decided to add traces in the package to let me know if the procedure was called.

Suddenly, I add medias in the Analysis screen. !!!!

AND No change in the code…

I am still trying to understand though. I know that there has been a recent upgrade!!!

And also I found that there is a Object connection Refresh cache option that I was not aware of. Could explain ?,

 

Anyhow, great great thanks for your help. Really appreciated...

Userlevel 7
Badge +30

Good to hear you sorted it out! :) I cannot explain it, and this is the only case like this I have heard of, so let’s put this into the “random fluke” category :)

I have never noticed any cache causing problems with this, by the way.

 

Userlevel 7
Badge +30

Could you set this as answered? I think my reply a few posts above, outlines a possible way to debug this, even though it is a bit technical…

 

Userlevel 2
Badge +6

Hi @Mathias Dahl,

This was a really good and interesting thread!

The following (an excerpt from one of your posts above) gave some hope that you could use ‘*’ as values for keys that are not available on the target. E.g. when you want to show documents connected to the requisition lines also on the header.

The code example you show returns the key_refs even though two of the keys are sent in as ‘*’ values. That worked fine when I tested it in a database tool. But I didn’t get it to work when setting up the OCT.

select * from table (doc_reference_object_api.Get_Key_Refs('ShopOrd', 'ORDER_NO=200142^RELEASE_NO=*^SEQUENCE_NO=*^'));

 

Could it be a candidate for future enhancements to make it possible to use ‘*’ as values when mapping keys? :)

Best regards,

Erik

Userlevel 7
Badge +30

Hi @Mathias Dahl,

This was a really good and interesting thread!

The following (an excerpt from one of your posts above) gave some hope that you could use ‘*’ as values for keys that are not available on the target. E.g. when you want to show documents connected to the requisition lines also on the header.

The code example you show returns the key_refs even though two of the keys are sent in as ‘*’ values. That worked fine when I tested it in a database tool. But I didn’t get it to work when setting up the OCT.

select * from table (doc_reference_object_api.Get_Key_Refs('ShopOrd', 'ORDER_NO=200142^RELEASE_NO=*^SEQUENCE_NO=*^'));

 

Could it be a candidate for future enhancements to make it possible to use ‘*’ as values when mapping keys? :)

Best regards,

Erik

Hi Erik, nice to see you here! :)

Above, I *think* two of the keys actually have the *value* “*”, but that is just a guess. Some objects allow it, I think.

As for your idea: perhaps. The risk, of course, is that you get multiple hits in the “source” if you do not specify all the keys. In some cases it will work, in others, it won’t.

Of course, we do support multiple hits, but only when you write a PL/SQL method/function to do the transformation.

When would you want this?

/Mathias

 

Reply