Thursday, July 8, 2021
Django - create your first project and runservers and urls and views
Tuesday, July 6, 2021
OIC - Integration properties
Why we need Integration properties and uses:
- OIC allows us to externalize the properties whose values can be updated without modifying the integration.
- Developer can define the properties with their default values.
- Max 10 perperties can be created per integration.
- These properties values cant be modified inside the integration using any action like assign.
- This feature is available in both app driven and scheduled orchestration.
- You can update the integration properties value from outside of the regular integration design time.
- To override the integration properties, for scheduled integration - it must be in active state and for app driven - it must be in draft or configured state.
- Integration properties are user defined properties available for usage by activities like Notification, Log etc. as read only data.
Steps:
Step1: Create an app driven integrarion and drag and drop a rest trigger connection and set response as below:
{
"status": "messgae sent"
}
Step2: Click on the rest trigger and click on more actions and click on edit integration properties.
Add the parametes From and To and set their default values.
Close
Step3: Drag and drop Notification from action and assign these 2 paramaters From and To and provide some default value to subject and body.
Step4: Save and add a tracking like rest method etc.
Save and it will be now in configure state.
Step5: Go to the integration actions and click on update property values. Click on respective parameter and update with new value if needed. And submit it.
Step6: Activate and test.
OIC - Replace existing connection with the new connection in OIC integration
Why do we need this?
- This new update allows us to replace any existing connection used in an integration with another connection of same Type and Role. In earlier version, first we need to delete the exisitng connection used in the integration amd then create a new connecrion for that. So lot of changes needed in the downstream flow or integrations.
- Sometimes we may need to change the connection name used in an integration.
In simple, it saves a lot time and reduces rework.
Steps to follow:
Step1: Deactivate the integration.
Step2: Click on the actions(hamburger sign) and then click Configure.
Step3: Select the connection which you want to replace and click the replace button to select the new connection of the same type and role. For instance suppose your connection type is rest and role is trigger so you have to choose same rest type and role for the new connection.
Step4: Done and click save and close.
Step5: Activate your integration ans check from open details if the new connection is showing and then test.
Note: Suppose all your integrations are in a package then whole package components will be showing in the actions --configure step and you can change the connection used for the entire package too.
Monday, July 5, 2021
Django - Introduction & Install django and PyCharm CE
Introduction:
"Django is a high-level Python web framework that enables rapid development of secure and maintainable websites. Built by experienced developers, Django takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. It is free and open source, has a thriving and active community, great documentation, and many options for free and paid-for support. "
Where did it come from?
"Django was initially developed between 2003 and 2005 by a web team who were responsible for creating and maintaining newspaper websites. After creating a number of sites, the team began to factor out and reuse lots of common code and design patterns. This common code evolved into a generic web development framework, which was open-sourced as the "Django" project in July 2005. "
Django MVT
The MVT (Model View Template) is a software design pattern. It is a collection of three important components Model View and Template.
- The Model helps to handle database. It is a data access layer which handles the data.
- The Template is a presentation layer which handles User Interface part completely.
- The View is used to execute the business logic and interact with a model to carry data and renders a template.
Here, a user requests for a resource to the Django, Django works as a controller and check to the available resource in URL. If URL maps, a view is called that interact with model and template, it renders a template. Django responds back to the user and sends a template as a response.
Install Django:
go to the windows power shell and run the following cmd:
pip install django
Check installed django version:
python -m django --version
3.2.5
Check python version:
python --version
Python 3.9.5
Install PyCharm CE:
go to the browser and search with PyCharm download and go to the 1st one Jetbrains.com download PyCharm community edition. It will download around 366MB space.
OIC - Global variable and Data Stitch action
Global variables are the variables which will be available throughout the integration. The variable can be any types as mentioned:
- String
- Boolean
- Date
- DateTime
- Object
- Number
Sunday, July 4, 2021
PowerShell - Solution to “Running Scripts Is Disabled On This System” Error On Powershell
While I was trying to create a virtual environment in VS code with PS, I got below error:
Error:
.\env1\Scripts\activate.ps1 : File C:\Users\abc\Desktop\python\script\inheritance\env1\Scripts\activate.ps1 cannot be loaded because
running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\env1\Scripts\activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Solution:
Step1 : Open windows in powershell as admin.
Open the Start menu on Windows and search for powershell and right-click on it. Click on “run as administrator”.
Step2: run below command:
set-executionpolicy remotesigned
Step3: You will be prompted to run accept the change, type Y(Yes) and press enter on your keyboard to allow the change.
Step4: When you are done, you can set the policy back to its default value with:
Set-ExecutionPolicy Restricted
Saturday, July 3, 2021
Python - Virtual env, pip freeze, Lambda function, join method, format method and map, filter, reduce
Virtual Env:
An environment which is same as the system interpreter but is isolated from the other python environments on the system.
Installation:
to use virtual environment:
pip install virtualenv
to create:
virtualenv myprojectenv
to activate:
activate
pip freeze:
It returns all the packages installed in a given env along with the versions.
pip freeze > list.txt
we can share the this file to other user and they can recreate the same env using:
pip install -r list.txt
Lambda function:
syntax:
lambda arguments: expressions
instance:
square = lambda a : a * a
square(2)
Join method:
It creates a string from iterable objects.
l=["apple","mango","banana"]
" and ".join(l)
output: "apple and mango and banana"
format method:
formats the values inside a string into a desired output.
template.format(arguments)
example:
"{} is a good {}".format("john","boy")
or
"{1} is a good {0}".format("boy","john")
output: john is a good boy
Map, filter and reduce:
Map:
map applies a function to all the items in a input list.
map(function,list)
Filter:
It creates a list of items for which the function returns true.
list(filter(function,list))
Reduce:
It applies a rolling computation to sequential pair of elements.
from functools import reduce
val=reduce(function, list)
if the function computes the sum of two numbers and the list is [1,2,3,4], the output will be 10.
Practice:
Create two virtual environments , install few packages in the first one. create a similar env in the 2nd one.
pip install virtualenv
virtualenv env1
virtualenv env2
.\env1\Scripts\activate.ps1
pip install pandas
pip freeze > 2.txt
deactivate
.\env2\Scripts\activate.ps1
pip install -r .\2.txt
deactivate
WAP to input name, marks and phone numbers of a student and format it using the format function like "The name of the student is Sri and his marks are 65 and phone number is 0000000000.
a list contains the multiplication table of 7. WAP to convert to a vertical string of the same numbers.
WAP to filter a list of numbers which are divisible by 5.
WAP to find the max of the numbers in a list using reduce function.
Featured Post
11g to 12c OSB projects migration points
1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper: File⇾Import⇾Service Bus Resources⇾ Se...
-
Please find the following links for OIC hands on and relevant information: Oracle Integration Cloud Introduction | Benefits | Services offer...
-
What is Throttling: Throttling is termed as "regulate the flow". Oracle Service Bus has throttling feature and by using that f...
-
OIC interview Q & A: 1. FBDI approach with an example https://soalicious.blogspot.com/2022/02/oic-erp-supplier-bulk-import-and.html 2. O...