vTiger create activity meeting from custom workflow - vtiger

In vtiger open source, client wants to create a meeting invite on calendar once certain conditions are satisfied. is there any method/api exposed in vtiger to which we can pass the event parameters and it will create the event?How to create meeting event from code?

Yes, you can create an Activity once conditions are satisfied. Set his arguments to those you want and then do an Activity->save()
Other option is to create the event directly on the database (you could do it through a query from the PHP code)

Related

How to create User Task only once a day

We want to collect data during the day and create an User Task once a day. How can that be done with camunda? Is there a possibility to use process variables or do we need to access our own database and mark the corresponding items as processed (as soon as we create the daily user task)?
Do we need to create these user tasks programmatically? (We are using embedded Spring Boot Camunda instance)
One very good option would be to use a Timer Start Event per the documentation here: https://docs.camunda.org/manual/7.10/reference/bpmn20/events/timer-events/#timer-start-event.
It seems that you may want to use that in conjunction with a Timer Intermediate Catching Event (https://docs.camunda.org/manual/7.10/reference/bpmn20/events/timer-events/#timer-intermediate-catching-event) in something like the following manner:
Start a process instance at a specific time in the morning with the Timer Start Event. Perhaps 6:30AM in your local time zone?
Execute certain steps to gather data, perhaps through external service invocations, etc.
At a specific time (in the afternoon?), create the User Task and present the data. The User Task could follow the Timer Intermediate Catching Event noted above.
I hope this helps!

WSO2 DAS SiddhiQL : Dynamic event table / persist event stream

I would like to know if WSO2 Data Analytics Server allows to define a dynamic events tables or dynamic streams.
For example, imagine one event represent a car, and in this event, an attribute is the 'brand' of the car (Ford, Mercedes, Audi ...).
And I would like to add a column each time there is a new different brand. So my table would look like this :
And thus, if I receive an event with the brand 'Toyota', it would add a column to my table which would look like this:
Considering that I don't know in advance the number of different brands I will receive, I need this to be dynamic.
Dynamically changing the schema of an event table is not possible.
This is because the schema of the event table is defined when the Siddhi execution plan is deployed. Once it is deployed, the schema cannot be changed.
On the other hand,
it looks like what you need here is not an event table.
Perhaps, what you need to do is to update the schema of a table (an RDBMS table) when a certain event happens (for example, when a car event arrives with a new brand). Do you use this updated table in your Siddhi execution plan? If you do not use it, then you do not need an event table.
Please correct me if I have misunderstood your requirement.
If your requirement is to update the schema of a table when a certain event happens, then you might need to write a custom event publisher to do that. If so, please refer the document on the same: Building Custom Event Publishers.

Microsoft Calendar Graph API : Id of event not shared between users

I'm currently working on the Microsoft Calendar Graph API and I ran into some problems when trying to synchronize events.
Basically what I have is 2 users on my web service : they both have an Outlook adress. User A create an event on my web service, and add User B as an attendee. The event is then send to Outlook using the REST API. It's created on User A Outlook calendar, and User B receive an invitation on Outlook and the event is created as well in his Outlook calendar.
Now, on my web service, when the event is created, I retrieve the Microsoft ID of the event and store it in my database. This way, when I want to synchronize events between Outlook calendar and my calendar, all I do is retrieve all Outlook events, check their ID and see if they are stored in my database : if they are, then the event already exists on my web service, if they are not then I create the event in my web service.
The problem I have is that when I try to get the Outlook events from User B, the ID of the event is different than the one I stored earlier, and therefore it creates a duplicate that I don't need.
Basically, the event on User A outlook calendar and User B outlook calendar have different ID. I don't understand what's the point of this, because they are the same, the one on User B outlook calendar is just an invitation to the one from User A outlook calendar.
My question is : is there any way I can get around that ? Is there any kind of ID that is shared through users in Outlook/Office365 ? Thanks a lot !
This is precisely what the iCalUId property is for. The id is by design different, as it's a sort of "primary key" for the user's mailbox database. The iCalUId is supposed to be the same across calendars.
From https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/event:
iCalUId - String - A unique identifier that is shared by all instances of an event across different calendars.
There is AFAIK no property that is unique and also constant across different mailboxes. You can add custom properties to events, and make sure that the property value is unique and constant. That would require you to be able to write to User A's events.

sitecore publish item from web to master

I am working with Sitecore Intranet Portal. I am using web database for CD.
If a user change his email Id. How would I publish this to master database.
I am using this code to publish item from web to master db.
// The publishOptions determine the source and target database,
// the publish mode and language, and the publish date
var publishOptions =
new PublishOptions(Database.GetDatabase("web"), Database.GetDatabase("master"),
PublishMode.SingleItem,
item.Language,
DateTime.Now);
var publisher = new Publisher(publishOptions);
// Choose where to publish from
publisher.Options.RootItem = item;
// Publish children as well?
publisher.Options.Deep = true;
// Do the publish!
publisher.Publish();
It would be nice to know the correct procedure.
To publish from web to master is a bad practice.
This kind of content is named User Generated Content. I suggested to use this approach :
https://sitecore.unic.com/2015/07/16/user-generated-content-in-a-security-hardened-environment
Or you can use webservices. This allows all content (even user-generated) to be authored in your CM instance. This allows you to leverage the capabilities of the platform for workflow, publishing, etc.
Either use an external database or use Sitecore users for a certain domain and store everything in the core database. The core database is commonly shared between all environments
You can make use of package to transfer your item from web to master. You can follow the following steps:
Create your item package from web.
Use the tool that i have developed to convert the destination of the items. That is, change from web to master. The tool is found on marketplace at Sitecore package modifier.
Install the modified package on the master database.
Another solution is to have a schedule job that create the package from web, modified it and install it on the master database. This hence require no manual intervention.
I prefer to use this method than the sitecore transfer method because the transfer method tends to timeout or cause an error if there are lots of items to transfer.
The best practice to store the user information in the Core database. Sitecore is using ASP.NET membership to manage the user accounts. I recommend you to store all the user info in the core DB.
Sitecore doesn't provide any option to publish data from web to master, however, it has provides you an option to transfer data from web DB to master DB.
Check out my blog Transfer Items from Web to Master Database for complete details on transferring the data from one DB to another DB
Step 1: Login to Sitecore desktop mode.
Step 2: Select the source database from where you need to transfer the items. If you want to transfer from Web to Master then select Web Database in the right-hand bottom corner.
Step 3: Open the content editor and select the item which you would like to transfer.
Step 4: Right click on the Item and select Copying>>Transfer and click on the transfer button
Step 5: In the Transfer window verify if the source item is selected properly or not.
Step 6: Click on Next to continue. In this window first thing is to select the destination database to which you need to transfer. The second thing is to select the parent item or the destination folder where you need to place this item. In my case, I need to select Layout because sublayouts are present in the layouts item.
Step 7: Click on next, here you will get an option which says include subitems. Select the checkbox if you need to restore the subitems also else uncheck the box to transfer only the selected item.
Step 8: Click on transfer button and it will start the transfer process. Close the dialog box once the transfer is completed.

Multiple SqlDependencies firing the same OnChange Event

I have a product catalog with a few hundred categories in it and I am dynamically creating an SqlDependency for each category in the catalog. The SqlCommands that these dependencies will be based on, will differ only on the categoryID. The problem that I have is that I want all these dependencies to perform different actions depending on the SqlDependency that fired them. How can I do that? Do I have to create a different OnChange event for each SqlDependency? Is there a way all these dependencies to fire the same OnChange event and this event to know which dependency fired it or receive a parameter which will be passed during the dependency creation?
This problem arised trying to create a Sql Dependency mechanism that will work with AppFabric Cache.
Thank you in advance.
See if you can look into the cache tables that asp.net is creating for you and the triggers that are being created on the original tables. Once you see what is going on, you can create the tables and triggers yourself and can implement the caching through your own asp.net code. It really is not that hard. Then, not when a table is updated(when you use SQLDependency), but relevant rows in that table are updated, you can refresh the relevant cache or write your own code to perform the whatever unique actions you want. Better off doing it yourself when you learn how to!