User define Task for Mongo DB CRUD Operation in Conductor UI - netflix-conductor

can we have a User Defined Task type that can perform CRUD operations with Mogo DB?
the reason we are asking, as we are seeking help or guidance where
We will define USER Define Task
Created task will appear or can be used by Conductor at design time using Conductor UI
similar post created on Conductor Discussion

Related

Event Sourcing - How to aggregate

I am trying to understand how to implement this in Event sourcing model / DDD.
Assume a distributed application in which user submits an application for something, say Job/Loan. So the application raises an UserApplied Event.
There are few micro services like credit service, criminal record service.. they consume this UserApplied event do some validation, responds with CriminalCheckPassed, CreditCheckPassed ... etc. Assume there are 5 checks to be done. In future we might also add more checks like this.
The app consume these events and take some decision. That is - only if they are all validated successfully app can approve the user application by changing the status to UserApproved. Any of the validations failed, them it would be UserDeclined. Something like that.
It sounds simple. But I am banging my head how to implement that correctly?
This is my event store
I have a materialized view
If we have to update the materialized view/aggregate whenever we receive an event, app needs 5 different events to take decision. Till then it will be pending. Even when I receive the 5th event, the materialized view does not know how many events it has received before. I will end up querying entire event-store.
Another approach is - adding these columns in the materialized view. So that we know if we have received all these events. It will work. But looks super ugly.
My question is - how to use the aggregation properly in this case?
If I understand correctly, the validation is a part of domain logic (it is something that has to be made sure that it passes). Here, there are some external services like Credit Service and Criminal Record Service.
First, I would model User as an Entity and an Aggregate Root of itself. Then, I will model Job Application as another Entity and another Aggregate Root of itself. Now there are 2 aggregates, with the relationship: User can have many Job Applications.
Now, you need to validate some things before you create a Job Application instance. This validation requires some knowledge from other services. This can be solved by creating a domain service, say JobApplicationCreationService which sole responsibility is to create new instance of Job Application. Then, you would want to inject those external services here. Inside the service, do the validation using the services you injected, then if all validations pass, return a new Job Application instance. This Aggregate instance will have fulfilled your validation rules/domain logic.
Events here is not suitable for validation, rather it is used to synchronize states between Aggregates using eventual consistency. When Events are published and being processed, you want to make sure that the Aggregate that produces the events is already in a consistent state (in this case, the Job Application aggregate).
Here is my personal rule of thumb: Try to create an Aggregate from static factory method to contain the creation logic. If the creation requires something outside of the boundary of the Aggregate itself, refactor it to a Domain Service.
Well, if CriminalCheckPassed are domain events, then they need to somehow mutate the domains state, so you need to store it within your domain (which will be restored when you load your domain entity), say a private readonly List<RequiredCheck> RequiredChecks and check these on recieving of any of the responsible events, then decide.
If it's not a domain event and is not persisted with the aggregate root, then have a process manager (aka Saga) (i.e. UserApprovalProcessmaanger) collect these external events and process/persist them and once all of them are collected fire off an UserApproved / UserDeclined event which is processed by the domain model/aggregate root

Does SP in db2 waits for triggers to execute

We have scenario where we want user to update certain tables in DB2. Which we are doing using a SP and transaction management is done for same. However, now we need to introdue one new table for logging user actions, but we don't want to keep user waiting for same. Can we write trigger in this scenrio.
If I call SP from outside someother language like java, when the this SP is updating the row, a trigger will called on that row.
In such scneario , is SP going to wait for trigger to complete execution or will return just by completing udpate execution of row and trigger will run in separate thread.
I tried to implement same , not sure how to be confirm.
No, DB2 does not have asynchronous triggers. Triggers are compiled as part of the SQL statement being executed that will necessitate their use. You can see this by explaining a query.

What is a correct design pattern for an API mailing/notification system?

I am developing a Rest API using node js, mongo and express as technologies. My models include users, venues, etc. In addition each user has states. Examples of states could be when a user signup the first state is 'new_user', after one week the state must be 'first_week_user' and so on.
The purpose of these states is to notify the user according to his or her state. For example if a user like a picture and the user is in the first week (he has the 'first_week' state) so an email must be sent to him. I am in the design stage right now, so I want to know if somebody had to face the same issue before.
The design that I have in mind is to put a notification_profile inside the user object and using a cron job to check the state and the actions of the day and according to that send the emails/push notifications.
What do you think? Are there a better option? e.g. I can have an email API and queue the emails hitting this API. Do you know where I can find information about design patterns facing this problem?
Thanks a lot for your help.
Without more detail, this sounds like you need the Observer pattern.
Essentially, your Email component would subscribe to each Person object's like(photo photo) event, and either execute an email-send job immediately, or schedule the job to run later, as part of a batch.
One way to specify the state transitions would be as a hierarchical state machine. See http://www.eventhelix.com/realtimemantra/hierarchicalstatemachine.htm#.VNJIflXF--o and http://en.wikipedia.org/wiki/UML_state_machine
I don't have a good node.js example but here's a C# implementation that also includes the concept of timed events. Essentially the state machine keeps track of a NextTimedEventAt so you can efficiently pull it back out of a database at the right time to fire a time-based event.
Actions happen on state transitions: as you enter a state or leave a state.

CRM 2013 Plugins can some one explain to me, what is the difference In "Message,Pipepline Stage, Pre Image Alias, post ImageAlias, paramters

Can some one please explain to me, what is the difference in CRM 2013 plugins between:
-"Message" (Assign, Create, Delete, Grant Access, ModifiyAccess, retrieve, RetriveMuliple, RetrievePrincipalAccess, RetriveSharedPricipalAndAccess, Revoke Access, SetState, SetstateDynamicEnitity and update)
-Pipeline Stage (pre-Validation, Pre- Operation and Post Operation)
-Pre Image Alias (parameters)
-post ImageAlias ( parameters) please in details..
I am new to CRM and trying to create a Plugin, but I was googling in net to know the difference between them, but there was not enough information
Thanks in advance
The "message" is the actionable event that is taking place. On Create, a record is being inserted into CRM. For retrieve, a single record is being returned. Etc.
Pipeline Stage - Specifies when you want the plug-in to execute: before (Pre) or after (Post) the core operation that processes the message. For more information, see Event execution pipeline.
Pre Image Alias - A pre-image is a snapshot of the entity’s attributes before the core operation.
Post Image Alias - A post-image is a snapshot of the entity’s attribute after the core operation.
If you are getting started, I'd suggest looking into the SDK. There are samples to get you started and help to explain a lot of this. http://www.microsoft.com/en-us/download/details.aspx?id=24004
For your Question. Let's take an example on Creation of Entity record the field value should be Updated for that case "Create" is the Message in Plugin Registration Tool and Service is the Update. likewise there are More number of Messages According to Message Inputparameter will change accordingly. for yourself let's start from Crud operations you will Understood easily.
Coming to Pipeline stages:there are three
Pre-Validation(execute outside of the db transactions)
Pre- Operation(execute within the db transactions)
Post Operation(execute within the db transactions)
Take one plugin apply all above operations then you will understood.
Coming to Pre image and Post image:
Pre image will work on while update it will fetch data from sql db.
Post image will work on both create and update same as post fetch data from sql db.

How to provide Detail and Summary objects for my REST api with Node.js and Mongoose?

I want to provide some venue information over my node.js REST API build by mongoose and express.
In my model, I should take care of every details for a venue.
But when requested for summary, I should show only some of them.
And If requested for 1 venue in detail, I should show more.
What is the best way to do it?
If you want to achieve something like this why not create some custom queries for your detail and summary actions?
Basically what you need to do.
Create your custom queries that received the custom data.Do this in your model. (e.g the data for summary or details)
Create specific actions for these speficic type of API calls in your controllers and server it as you wish. (E.g create /getVenueDetail/venueId=213235 )

Resources