Sample Scenario: SAP Analytics Designer API integr...
Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
In fact, SAC's calendar provides an integration into Analytics Designer. Analytic Applications can easily interact with SAC calendar processes and workflows via API. Moreover, Analytic Applications can programmatically participate in workflows to submit, approve or even reject SAC calendar events. Next to that, an Analytic Application can even create new workflows directly into the SAC calendar. The scenario in the video shown below will explain the capabilities along one scenario of Human Resources planning.
Great you appreciate the content. I pasted the code snippet below to start a new workflow:
var newTask = CalendarIntegration.createCompositeTask({
name: "Approve new Headcount",
startDate:new Date(Date.now() + 10000),
dueDate: new Date(Date.now() + 259200000), //+3 days
workFiles: [{ //one single file, the current opened file
//id: Application.getInfo().id,
id: '99183002E75E0E06CD6D1CE0193D526B',
type: CalendarTaskWorkFileType.AnalyticApplication,
}],
//each user is a string
assignees: ["SMILLER" , "MYUSER"]
});
thanks Johannes. In the meantime I finally found a way and did that script and added 2 rounds for reviewers. I also added a "non member by email" but I don't ubderstand how it works. The non member received the email but he still needs an SAC access when clicking the link received by email. Unfortunately, we cannot add viewers for the moment :
Thanks Johannes for your video it was really helpful!
I am looking for a way to get the names of the assignees and reviewers through the Calendar API but I can't find the proper API statement for that.
Seems like you can create a Composite Task but what about if you have an already created Composite task (via your calendar) and just want to see the assignees and reviewers in your Analytic Application? Essentially I want to have the same information as when I click calendar toolbar->details where I can see the people involved.
I have an application where projects will be created and we need to create a task for each project. We successfully tested the api to create a task in calendar from analytic designer but we would like the person who will approve (reviewer of the task) could reach the right project when clicking for approve or reject.
Eg : we created a task with API to approve or reject the project ABC123. When the reviewer wants to approve, it should see only the project ABC123 and not an report where all project are displayed.
Is there alread a solution to passing context filters from a (API created) CalendarTask to open a pre-filtered application/story workfile?
We want to pass a URLparameter (those starting with p_ in application designer).
Or perhaps a story filter as context.
e.g. we want analytics designer to generate a bunch of tasks and then centrally monitor data collection (e.g. to ten's of sales manager responsible for a certain region or customer group). Instead of manual process to generate them with calendar task wizard.
I can create the Composite task on the fly in the Story however, To submit and Approve the code is not throwing error upon button onclick :
1.
Submit :
var calendarTask = CalendarIntegration_1.getCurrentTask(); var isAssignee = calendarTask.hasUserRole(CalendarTaskUserRoleType.Assignee); var calendarTaskStatus = calendarTask.getStatus(); var calendarTaskType = calendarTask.getType(); if (isAssignee && calendarTaskType === CalendarTaskType.CompositeTask && calendarTaskStatus === CalendarTaskStatus.InProgress) { var compositeTask = cast(Type.CalendarCompositeTask, calendarTask); var isSuccessfullySubmitted = compositeTask.submit(); if (isSuccessfullySubmitted) { console.log("You have successfully submitted your task."); } else { console.log("Sorry, something went wrong."); } }
2.
Approve:
var calendarTask = CalendarIntegration_1.getCurrentTask(); var isReviewer = calendarTask.hasUserRole(CalendarTaskUserRoleType.Reviewer); var calendarTaskType = calendarTask.getType(); if (isReviewer && calendarTaskType === CalendarTaskType.ReviewTask) { var reviewTask = cast(Type.CalendarReviewTask, calendarTask); var isSuccessfullyApproved = reviewTask.approve(); if (isSuccessfullyApproved) { console.log("You have successfully approved the task of the assignee."); } else { console.log("Sorry, something went wrong."); } }
3. Is it possible to add context filter like it can be done from Generate Events Widzard in the Context?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.