adding custom workflow extensions to Wso2 API manager - wso2

I have recently started working on WSO2 API manager and I have added a user signup workflow to it by following on this link :
https://docs.wso2.com/display/AM180/Adding+a+User+Signup+Workflow
It was pretty simple and straightforward, but the thing is, in my case I am the admin as well as the user. So Once I send a signup request, I manually log on to workflow-admin console and approve the request and once i approve the request I can login to the API Store. But in a typical production environment, the admin as well as the user must get some kind of email notification so that they can approve/reject as well as login once request is approved. How do I achieve this kind of scenario wherein the user will get an email notification once his/ her request has been approved as well as the admin will get a notification once a request is sent?
I have checked the adding a workflow-extension module in the documentation:
https://docs.wso2.com/display/AM180/Adding+Workflow+Extensions
But i'm still trying to figure it out.
Looking forward to some help.

As far as I know the current release of the Business Process Server doesnt have support for email notifications for HumanTasks. But this will be available from the next release of the Business Process Server (v3.5). As a work around what you can do is create a service in the ESB to send out emails and create a BPEL workflow (with humanTasks) which will trigger this email service in the ESB. But if you can wait till the next release (which should be available by end of Aug), then this feature would be available with the new Business Process Server.

Ok I finally got it working.
Write a class in java similar to UserSignUpWSWorkflowExecutor.java, make sure it extends the UserSignUpWorkflowExecutor class in the org.wso2.carbon.apimgt.impl.workflow package. And now in the complete method of your class, check for the signup status and write the logic for sending mail here. After this step make a jar of the particular package/component and add it to the patches directory in binary file of wso2 API Manager, while doing so make sure the name of the jar is similar to the one in the plugins directory. After this Step start your API Manager and in the admin console there is a workflow-extensions.xml file. Edit that file and add give the name of jar that you just created along with its package name. save it and restart the API Manager.
Note : Enable the user sign up worflow executor by following this link first
https://docs.wso2.com/display/AM180/Adding+a+User+Signup+Workflow

Related

how to create realtime notification in django without using django channels

For every action such as-
log in
sign up
password reset
Notifications should be seen to the user with a notification bell icon (just like Facebook)
where real-time notifications are shown according to each action performed.
Also, an email should be sent to that user.
Note - (YOU CAN USE ANY DJANGO LIBRARY EXCEPT DJANGO CHANNELS)
this is the question that I want to solve. please help me.
You can use the Google Firebase Cloud Messaging service. There a lot of packages that work with this service. I recommend you to use fcm-django package for simplicity.

What's next: after successful token created for django all-auth; how to sync google calendars?

Ok, I hope I don't get too beat up here for this question as it is kind of complex. At least in my view, with what I know so far. So the details first:
I built a nice app with django that brings in event data for users, utilizes that data for many things (not relevant to this question) but one of the things is that it syncs these events to the users Google calendar. I made the google app within the developer console, and it uses the provided credentials.json file to allow users to authenticate the app, thus creating individual user token.json files per user, then I have another script (not within django, just a custom python file) that runs from a cron job to automatically sync/ update the calendar info from the database to the google calendars.
Now, the new problem is having this work without my help. IE: a new user logs in and creates a profile, then if they should choose to sync to their Google calendars I have to be there, running the authentication process from my personal server. So I did that, by moving the whole app to a hosted platform and brought it up to speed in production mode.
Users can create a profile, using django-allauth it works to make an initial user account where they can fill in the rest of the profile. It does populate the token string for their account, but here is where I'm stuck.
What process is there to make the token.json file OR use the existing token string (the one it saves now on the server version) to allow the system to sync the calendars? Once the token files are created, the rest of this works. I just can't get the right answers to how django-allauth will handshake with Google and do this?
Thanks for any help!
Update: ultimately wound up using a service account with google api, and directing my users to combine the service account email (adding it as a shared user to the specific calendar) and they copy/paste the shared calendar ID in their profile on my app. All the logic now just uses this share function to sync the calendars, and it works great.

Simple checkout is not working in Authorize .net

I have created a item in the Authorize.net account and get the code which create the button on website. I have tested it with test mode and order placed successfully. But when I try to make a payment using live mode then at checkout page of Simple checkout it gives me error with following message :
Transaction Declined
The configuration with processor is invalid. Call Merchant Service Provider.
I have called to the Merchant Service Provider and they said that all okay from their side. Some configuration settings are not okay with you integration.
If somebody can help me to fix this issue.
Thanks
Gaurav
You'll need to contact Authorize.Net Customer Support to ensure your account is configured properly, call 877-447-3938.

How do I send an Enterprise Activation email? Using EnableBlackBerryUserDispatcherAttributes?

This is regarding a Blackberry that is connected to a BES Server, and the Administration Web Service.
I need to enable and send an Enterprise Activation email, however I need to also set an ActivationPassword.
I looked at the help document and after tracing the abstract classes, I think I need to do "something" with EnableBlackBerryUserDispatcherAttributes.
How do I send an enterprise activation email with a password to an Exchange user? I can't find anything, anywhere. (Sure I can add a user to the server, but what good is that if I can't activate the account !?)
I've found the following objects in the webservice that indicate it is possible, but I can't figure out how to use them...
ActivationPassword;
ActivationContext;
ActivationPasswordType;
ActivationPasswordOperationTypeEnumType;
clearActivationPassword;
EnterpriseActivationEvent;
setActivationPassword;
Just to be clear the online samples only address the creation of a user, not enabling them.
My alternative is to shell out $250 bucks for this missing documentation.
If you are an ISV partner or T3 subscriber, the answer to this question is free for you at devsupport#rim.com so I'll appreciate any strings you can pull as well. While you're at it I'd appreciate if you can tell me how to update the email component as described on this part of the admin website
The user list from the company
directory is automatically updated on
a timely basis. The update process can
be manually started using the email
component.
you should have a look at the dispatcher webservice. This means you have to generate a stub for the dispatcher webservice as shown in the tutorial. The stub is a instance of com.rim.bes.bas.baa.BAADispatcher which holds methods for setting and generating EA-passwords.
Regards

What Web Applications Do You Know Using Webhooks

Description of how a webhook works from http://webhooks.pbwiki.com/ -
How do they work?
By letting the user specify a URL for various events, the application will POST data to those URLs when the events occur...Among other things, you can:
create notifications to you or anybody via email, IRC, Jabber, ...
put the data in another app (real-time data synchronization)
process the data and repost it using the app's API
validate the data and potentially prevent it from being used by the app
Who is using web hooks?
DevjaVu, BitBucket, GitHub, Shopify, Versionshelf, PayPal (IPN), Jott (Links), IMified, PBwiki, Facebook (Platform, sort of), Mailhook.org, SMTP2Web, Astrotrain, Notifixious, Assembla, ZenDesk, Google Code
Do you know of any good uses of webhooks?
AlertGrid is the webhook consumer. You can configure it to accept http calls from ANY source and raise alert (email, sms, phone) to a specified person or group of people (works worldwide!) whenever the parameters in the http callback meet your criteria or when the http call was expected but it didn't occur (kind of 'heartbeat' monitoring). There is a visual editor for you to easily create rules.
Apart from notifying people by sms or email it can also notify existing applications by sending the http requests to their APIs.
It can also visualise data received in http callbacks and show the history.
Unfortunately, the wiki is not the most up to date list of known implementations. I have my own list that I'll put on the wiki when I get around to reorganizing it. Some not mentioned in the current list:
Dropbox
Gnip
Google Code (Project Hosting)
Checkout by Amazon (both for notifications and as actual callbacks with return data)
Hubilicious
Beanstalk
Google Checkout
MailChimp
SurveyGizmo
Hey!Watch
MySpace (for app developers)
I know shopify is using webhooks quite successfully now. By extension so is fetchapp uses them as well. You either are sending an xml file, or receiving one and doing your own processing logic on it.
Oh and shopify's wiki in the link has a whole write up about how to implement it in your app.
OfficeAutopilot has an interesting version of webhooks.. they use their rule interface to trigger API posts. Can trigger in response to any system event.. email opens, clicks, page visits, purchases, etc, etc.
Kiln 1.2 uses webhooks much like GitHub, BitBucket, etc.
(Disclaimer: I'm a Kiln/FogBugz dev.)
Say for example you want to get data from any API( eg. twitter, facebook etc.,). Instead of you polling the data for every few minutes/seconds, it POSTS the data to the specified URL, whenever it is available.
By using this, you will avoid unnecessary polling like say you poll and data is not there yet.
StorageRoom is a JSON-based CMS that supports webhooks, so that you can notify other services or kick of some manual processing on your own servers.
(Please note: I created the service myself)
If you want to connect one service that supports webhooks to another service's API, you can check out IronWorker's webhook support. Here's a blog post that walks through connecting github webhooks to HipChat:
http://blog.iron.io/2012/04/one-webhook-to-rule-them-all-one-url.html
There are some other examples here too, one that takes a chargify callback and posts to Campfire.