SAP Workflow read decision note from CDS view for mail template - workflow

As the title suggests, I must read the decision note from a workflow user decision task in a CDS view (https://blogs.sap.com/2013/04/01/sap-workflow-decision-task-new-capability-to-add-notes/). The CDS view is used to provide data to a mail template, which is send after a user has declined a certain workflow step. The decision note why the item was declined should be send within the mail to inform the recipient what went wrong.
In ABAP there exists two different functions (SO_NOTE_READ or SO_DOCUMENT_READ_API1) to read the decision note, which worked great and I was able to read the decision notes easily. However I could not find an equivalent in pure CDS.
I also found two different solution to solve the issue. But the solution only enables me to access the database layer with SQl queries or use virtual elements annotations.
ABAP CDS View - use a class method
The latter solution only works with an annotation based solution, which the mail template is not and I did not found a solution on how to read the decision note from purely SQL.
Anyone has a solution to replace the FM SO_NOTE_READ in purely CDS for this issue? Note that I am using a flexible workflow and mails are triggered with the Fiori App "Maintain E-Mail templates" thus sending the mail with ABAP is not possible/wanted.

Related

Stress testing of flow (Rest) with JMeter

I have a rest service which receives a customer's ID and an input, acording to this the services response something different, it's basically a menu, but the reponse could be different (depends on the customers input), so I need to stress this service to see how many request the server can handle and try to determine the max TPS, but since is a flow I don't know how I can simulate this, any idea or page that can be useful?
Thanks in advance for your help
What you mostly need is an understanding of how to handle dynamic parameters. Imagine you are simulating a user which goes on a blog, views a random blog article and then posts a comment about it.
It's all about designing a user which has a dynamic behavior, which changes depending on variables or server output. JMeter supports this kind of simulation very well by providing dozen of useful components like:
CSV Datasets,
Regexp Variable extractors,
and more.
We have written an article which explains how to simulate users with a dynamic behavior. It's very similar to what you would do in JMeter since OctoPerf is based on JMeter, with a Web UI built on top.

REST API Flow and Email Templates

Business Model:
This business makes handmade specialty items from a large inventory of photo examples on the web site. The owner does not want to bill until the item is ready to ship.
I'm sure the business model itself can keep us debating for days, but please do not question his approach as that is not really the point here. It is simply how he wants to run his business.
Design:
I have developed a system for him which manages his transactions (no financial information) until he is ready, whereupon he selects the transactions by checking the ones he wants from a query-select-list of unprocessed orders. I can then convert each ordered item to an HTML stream, REST objects, or whatever. The customer should receive the invoice email and click on a button to take him to PayPal for payment.
I want to use the REST API object model to send all the required information to PayPal, describe the invoice and then send the email/invoice to the customer via the API. It is not uncommon to have multiple items ordered at once.
Q1 - The API looks like it supports this usage but can anyone experienced with its use tell me if there is a show stopper I have not discovered yet?
Q2 - I have already developed an HTML template for this purpose. Perhaps prematurely. Does REST API allow for the use of templates? I do not see how yet but hoping there is a way.
Many thanks.
2K
After some more research and a half hour with Integration Support:
A1: There are no show stoppers in the scenario described above. The REST API (and PayPal) supports the usage I have in mind. If anyone desires I will post back results in a few days after code complete and a bit of testing.
A2: I was informed that my own HTML templates are supported but I still do not see how. With the spirit of "Trust, but verify" I will continue with my efforts and ask for Integration Support at that point if I need it.
My cup and my Stack both overflow. I am fortunate.
2kTech

How to create/insert product programmatically in Websphere Commerce 7 WCS7

I'm developing an ecommerce based on Websphere Commerce 7 WCS7. I need to import products from an external supplier, which is exposing a webservice. I've already implemented a Controller Command performing all the operation needed to extract the products from the remote service, and I've them avalaible as custom Java classes.
I'm a little bit confused about the approach I should follow in this case. I've defined the attributes needed in my scenario and used the dataload utility to import them in the DB. What should I do next? I expect to be able to "create" WCS product programmatically from my Controller Command but I don't know how to use the attribute I've defined in a programmatic insert.
Can someone point me on the right track on how to perform this kind of operation? I went through the documentation, but, given the fact I'm quite new of the WCS environment, I don't know how to proceed according to the current best practices.
It is possible to create a new catalog entry programmatically if you copy what is being done in the LOBTools. I have not done this myself though. I have always added new products via the data loads and when we did need to add from an external service I just output the information to a file and loaded along with our other products. The reason was due to keeping the catalog in sync with the product management system.
Have a look at the various DataBean classes in WCS, like: CatalogEntryDataBean.
See here for WCS data beans:Link
And here for "activation" of a DataBean:Link

Looking for an email/report templating engine with database backend - for end-users

We have a number of customers that we have to send monthly invoices too. Right now, I'm managing a codebase that does SQL queries against our customer database and billing database and places that data into emails - and sends it.
I grow weary of maintaining this every time we want to include a new promotion or change our customer service phone numbers. So, I'm looking for a replacement to move more of this into the hands of those requesting the changes.
In my ideal world, I need :
A WYSIWYG (man, does anyone even say that anymore?) email editor that generates templates based upon the output from a Database Query.
The ability to drag and drop various fields from the database query into the email template.
Display of sample email results with the database query.
Web application, preferably not requiring IIS.
Involve as little code as possible for the end-user, but allow basic functionality (i.e. arrays/for loops)
Either comes with it's own email delivery engine, or writes output in a way that I can easily write a Python script to deliver the email.
Support for generic Database Connectors. (I need MSSQL and MySQL)
F/OSS
So ... can anyone suggest a project like this, or some tools that'd be useful for rolling my own?
(My current alternative idea is using something like ERB or Tenjin, having them write the code, but not having live-preview for the editor would suck...)
I think your looking for a reporting tool which is also capable of sending email. Sending a generared report in html or pdf shouldn't be to hard to do as well.
I've used JasperReports in the past for which I think it should fit your needs.
Another good solution is the pentaho reporting tool
You could easily write something on your own.. give them a basic edit control and allow them to use psuedo variables like {customername} {anothercustomerattribute} within the mail body.
On submit either send directly or save as template.
When the template is sent away the script automatically parses stuff like {customername} into the real customers name from the database.
Your own very very simple custom scriptlanguage :)
Everything else like loops and so on would be maintained on serverside. And if you want particular groups of customers to receive the letter, allow the enduser to select from selectboxes or whatever and do the rest on the serverside with pre-defined rules.

PeopleSoft logins

I'm building a web application that will have access to PeopleSoft's database via jdbc.
Is it possible that I can use PeopleSoft's id/password for my custom application, so users accessing my website will not have to have another username/password?
Peoplesoft stores user details in the table PSOPRDEFN.
You will be able to verify the username against: PSOPRDEFN.OPRID.
The password field is: OPERPSWD.
Unfortunately the encryption function used for this field: hash() is available only from within peoplecode.
If you want to use a single sign on you should be able to do so by customizing the USERMAINT.gbl component perhaps in the saveprechange peoplecode, to save the password in a second field of your choice with an encryption algorithm that you can implement from JDBC as well.
If you want to reuse PeopleSoft security, you'd need to connect at a higher level than JDBC straight into the database. You could look at a component interface (codeable in Java) or send a SOAP message into PeopleSofts Integration Gateway - both methods would authenticate you against peopleSoft using its own security mechanisms.
The old way was to customize psuser.c to your needs and recompile as a new dll, used it your program, assuming you're on a Microsoft platform. As mentioned above, you could have a peoplesoft developer create a component interface ( or use the one that is delivered ). You can export wrapper Java or C/C++ code from a CI, a template. This code can then be used in an external program to call the CI. one way or the other, you have to interface with peopletools to call their decrypt for passwords.
Depending on how dynamic your business is, whether you add lots of employees each day, you could export psoprdefn using app messaging to another database. On the send, you could encrypt passwords however you like. But as you can surmise, this would not be real-time.
One thing I remember doing long ago was have a peoplesoft tech person develop a page the sole functionality of which was to call my java class and which obtained user/pswds as needed. Once I had them, I was good to go.
You can use the psjoa.jar , in that way you can signon via app.server using the same users and passwords in the psoprdefn table.
PeopleSoft has an LDAP integration ability but it has to be configured. If you are accessing via a Java wrapper around a component interface, a special account can be set up in PeopleSoft with access only to the underlying component, but the login/password would have to be passed into the component interface. This can be encrypted or sent over https.
PeopleSoft also has what it calls "row level" security - the ability to partition data sets so that for example your code could only access employee data within a specific business unit or accounting info for a particular line of business. This is all controlled within the PeopleSoft online security application.