wfNotify in IDOC to send mail | csScriptMustBeInWorkflowContext - webcenter

I have created & called a custom service in my custom template to send mails to users when document gets sent/reject/approve. I want to copy myself in BCC in these mails so that in case of any issues, i could cross check. is there a way i can enter a specific mail address in this code. below is the code i 'm using. Will "wfNotify" be of any help?
code used
<$executeService("APPROVAL_MAIL_PILOT_USERS")$>
<$loop IS_PILOT_USER$>
<$userValue=IS_PILOT_USER.USEREXISTS$>
<$endloop$>
<$if strEqualsIgnoreCase(userValue,"1")$>
----MailFormat----
P.S- when i use wfNotify -> , i get the error
Caused by: intradoc.common.ServiceException: !csScriptMustBeInWorkflowContext,wfNotify
*ScriptStack !csDynHTMLStackDumpStart,pbhati,(datasummary)IdcService=WORKFLOW_SENDTO\,dDocName=D_1247583\,dID=1421894!$
!csDynHTMLNoStack!$
!csDynHTMLErrorMessage,/u01/Oracle/Middleware/user_projects/domains/base_domain/ucm/cs/custom/Workflow/templates/Workflow_reviewer_mail.htm,44,3!csDynHTMLReportMsgFunction,wfNotify!$
-><$wfNotify(xDocOwner,"user")$>

As far as I know, wfNotify can only be called from inside a workflow event which is why you are receiving the csScriptMustBeInWorkflowContext error.
As to a service or Idoc Script function (besides wfNotify) that can be used to send an email to a specific user/alias/token and use a custom template, I could not locate one.
You could create your own scriptable service (which you can then call from Idoc Script) or an Idoc Script function that would allow for this.

You can call wfNotify with the specific username.
But the user must have their email details completed in the user table.
Your second error with the wfNotify call - are you calling wfNotify with a 3rd param for the template?
If so - eliminate this as a source of your problem by just calling wfNotify with the first two params.
wfNotify Oracle Documentation

Related

How do I get the documentID in Business Objects Restful API?

I'm trying to figure out how to download a PDF from the BOE restful API.
I've been following the answer from ƘɌỈSƬƠƑ here:
SAP BI Open Doc URL for retrieving pdf
I was able to accomplish step 1 (getting the token).
But on the second step, it mentions using the documentID.
e.g.
/biprws/raylight/v1/documents/5690743/parameters
On the front end of BOE, if I click on the report, and choose Properties, it shows me that the "ID/CUID" is:
ID, CUID:746001, AdgNq_GsaqhOqnzc4gRN_Jg
Does that mean the "DocumentID" is 746001?
I'm not sure if I'm using the correct ID, because when I hit:
/biprws/raylight/v1/documents/746001/parameters
I get:
<error>
<error_code>100</error_code>
<message>Rule not respected (Argument 'reportIds' must not be null)</message>
</error>
You don't need to obtain prompt information (/parameters endpoint).
I think you are using the correct ID since the error is on the report. You obtain a 404 Not Found response status, if the document does not exist.
After a successful login, simply call /biprws/raylight/v1/documents/5690743 and add to your request an header with name Accept and value application/pdf. Of course the X-SAP-LogonToken should also be provided.
It will export the whole document. If you only need a specific report, you need to retrieve its ID first. Call the URI /biprws/raylight/v1/documents/5690743/reports with Accept header equals to application/json.
Choose one of the report, and get its ID (for example, in my case reportID equals 1234). Then you can export the report as a PDF by calling the URI: /biprws/raylight/v1/documents/5690743/reports/1234 with Accept header equals to application/pdf.

Unable to read the Content of Email Automation Anywhere

I am reading the incoming mails from a outlook mailbox using automation anywhere Email Automation - Get All Messages menu. My simple code is given below. But everytime I am getting html objects and tags printing in the message box, I want only the email message.
Start Loop "Each message on server:outlook.office.365.com,User Name:xyz#xyz.com,SSL Server Type:POP3,Message Format:Plain Text"
Message Box:"$Email Message$"
Can anyone help????
In your original Email Automation - Get All Messages command, there should be a "Message Format" option below port number.
If not - you could offload to a javascript script that might look like this and call it via Run Script:
function noTags(vString) {
return vString.replace(/<(.|\n)*?>/g, '');
}
Passing vString into it and getting vString back out, now without the tags.

Email alias from LegacyExchangeDN - LDAP

I am working with Exchange EWS API. The API returns me a value which is legacyExchangeDN. The value looks like this -
/o=Amazon/ou=Exchange Administrative Group (FYDXXXXXXXXDLT)/cn=Recipients/cn=b08141c097dfd32432klbva43595-email-list
The value is also cropped in some cases (last few characters are not returned by the API)
How can I convert this value into meaningful email address?
Usually you would see this when you make a findItems request because Exchange doesn't resolve the Native (EX) Addresses back to SMTP addresses in this operation. So if you make a GetItem (or Load/Loadpropertiesforitems) request on the particular item you want to look at it as long as that address can be resolve in the GAL (eg that user or object hasn't been deleted) it should return the resolved address. The other option is to use the ResolveName operation https://msdn.microsoft.com/en-us/library/office/dn645423(v=exchg.150).aspx

Astrid request returning empty

I'm trying to use the http://Astrid.com API, specifically to get data using the method under the "Request Format" section on this page - http://astrid.com/apidoc/file.README.html
The URL I built is:
https://astrid.com/api/7/task_list?app_id=[MY APP ID]&time=1&user_id=[MY USER ID]&sig=[MY REQUEST SIGNATURE]
And it returns this:
{"list":[],"time":1363131562,"status":"success"}
Seems like it worked, but does anyone know why the "list" array might be returning empty? I've created a bunch of tasks in my profile so it should be showing those.
Thanks!
You need to sign in first with the method user_signin. If successful you get a token.
Then you need to call the task_list method providing the token.
You do not need to provide a user id with the task_list method. It is only used to select tasks that you share with this user.
Example for signing in:
https://astrid.com/api/7/user_signin?provider=password&app_id=YOUR_APP_ID&secret=YOUR_ASTRID_PASSWORD&sig=SIGNATURE&time=1365715302.36&email=YOUR_EMAIL
Example for getting your tasks:
https://astrid.com/api/7/task_list?active=true&token=THE_TOKEN&sig=SIGNATURE&app_id=YOUR_APP_ID&time=1365715304.41

Debugging K2 workflow - how to view data associated with error conditions?

I have a K2 Blackpearl workflow. In the workflow I populate a process data field with email addresses pulled from a SharePoint list. Using the Text - Join function with the SP List's SmartObject's GetList method for the values and a semi-colon for the separator.
In theory, this should produce a well-formatted string with multiple addresses for the "To" line of the E-mail event. However, I keep receiving a "The specified string is not in the form required for an e-mail address." at the point where the workflow should attempt to send an email.
I've tried using the string "john.doe#company.com;jane.dove#company.com;abc.def#company.com" directly and I've tried splitting the string on the semi-colons in the Activity's destination set. In the first case, there is one instance trying to send the email. In the second instance, the emails are resolved to users and though I select the "ActivityInstanceDestUserEmail" for the "To" line, I still get the error message.
We are using K2 Blackpearl 4.6 with a SharePoint 2010 farm configured strictly for Claims authentication. The users to which I wish to send the email have valid email addresses if resolved using the K2SPS provider, but when the emails are resolved into destination slots, they are resolved into accounts with the K2 provider. I'm guessing that this is the problem with my second method for sending the email. But the first, putting the whole string in the "To" line should have worked it is straight email addresses - no resolving to users is needed.
What am I doing wrong? Is there another way to accomplish this?
Changes in the configuration of our customer security provider, labelled "K2SPS" seem to have resolved the problem - at least for now.