Posts

Enable ECR image scanning on push for all the existing ECR repositories

Say that you want to start using ECR image scanning and you want to enable scanonPush for all the existing repositories .. Below AWC cli command will do just that ! aws ecr describe-repositories |grep REPOSITORIES|awk -F" " '{print $6}' | while read line; do aws ecr put-image-scanning-configuration --repository-name $line --image-scanning-configuration scanOnPush=true ; done

Filtering CloudWatch logs for a long time window

Recently I needed to filter cloud watch logs for a keyword, since the time window was too long and it was container based app, there were too many log streams to filter on. So not a task that can be done manually using console. AWS cli came handy and below did the magic .. aws logs filter-log-events --log-group-name production/ecs-service --log-stream-name-prefix my-service-prod --filter-pattern user111  --start-time 1561997947000 --end-time 1574698747000 --output text >> user1.txt Time filter is given in milliseconds since 1970 .. This web site was handy to come up for those https://www.epochconverter.com/

After a long time

I just realized that I haven't posted anything since 2014.. Hey, seeing my last post was about BPM/ADF .. many things changed since then.. I am not mostly working with AWS services.. Recently worked on a migration project that includes containerizing web services that used to be deployed on Weblogic and running them with Glassfish .. Good bye WebLogic ! Still struggling  with an ADF app though .. is not very suitable to run with ADF essentials ..so not sure how to migrate it to AWS yet .. Feeling motivated to start writing about my journey to AWS from ADF/BPM..

Retrieve BPM composite version from ADF

It is a common scenario that you use the same ADF app for different versions of the BPM flow. In those cases you would like to control the visibility of the new features of the ADF app that supports the BPM flow changes .. Here is the way to read this info from ADF Add below to you page definitions.. <accessorIterator id="scaIterator" MasterBinding="taskIterator" Binds="sca" RangeSize="25" DataControl="Details" BeanClass="Details.scaType"/> <attributeValues IterBinding="scaIterator" id="compositeVersion"> <AttrNames> <Item Value="compositeVersion"/> </AttrNames> </attributeValues>                And then control your features as below, assuming the new button is visible at 1.10 rendered="#{bindings.compositeVersion.inputValue  >= 1.10 }”

How to avoid timeouts with Oracle BPM loops

Image
Say that you have a loop in your flow and you send some notification to all of your customers. This might be thousands of executions. And if things go wrong you may hit the timeout limit and end up with a suspended/halted bpm instance. To avoid this we can use a Timer in our loop even though we don’t need one. Here is the idea. In my environment the timeout is set to 30 seconds to simulate the issue and the solution. Each service call takes 10 seconds. The loop cardinality is 5. So it will timeout after the 3rd call. Lets see. Yep it faulted As it can be seen in EM it made the 4th call but never came back. Now lets add timers to our flow. I am adding a dummy timer that will hold the execution for a second. Now we didn’t have any issues and process executed properly, Update: I found out that this is called "Forced Dehydration" in Oracle terminology, more info

How Parallel Is the Oracle Bpm's loop ?

Image
I found out that  when you create a loop in your BPM flow and mark its mode as Parellel  it is actually not running in real parallel execution. Instead it creates loop instances first and runs the 1st activity of all of them . Then it starts running the 2nd activity and so for.. In my test case I pass the service name  and loop counter to the WS and WS just prints the string input. And here is the output : Service : First Call :1 Service : First Call :2 Service : First Call :3 Service : First Call :4 Service : First Call :5 Service : Second Call :1 Service : Second Call :2 Service : Second Call :3 Service : Second Call :4 Service : Second Call :5 As it can be seen clearly that ot doesn’t execute in parallel. Meaning in case something goes wrong at one loop instance others won’t be executed until it is fixed. By the way if you wonder same applies to parallel executions that are forked at a gate as well.

An error occurred while trying to retrieve audit trail for this instance. Please review log files for detailed reasons.

If you face this error while trying to access the BPM process instances in EM , there is a setting on the Adminserver that you need to increase. You should be seeing below error in admin server logs. IOException occurred on socket: Socket[addr=egw-bpm1-mnad-nsc.wfs.com/10.10.224.65,port=8001,localport=43747]  weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3'. weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3' at weblogic.socket.BaseAbstractMuxableSocket.incrementBufferOffset(BaseAbstractMuxableSocket.java:230) at weblogic.rjvm.t3.MuxableSocketT3.incrementBufferOffset(Mux...

Get list of Data Souces on weblogic

In case you need to give the user option to select a data source before executing a query below might be helpful It will return a list of select items that contains the data sources under jdbc/ List list = new ArrayList (); try { InitialContext initialContext = new InitialContext(); if (initialContext != null) { NamingEnumeration ne = initialContext.list("jdbc"); while (ne.hasMore()) { NameClassPair nc = (NameClassPair)ne.next(); list.add(new SelectItem("jdbc/" + nc.getName())); } } }

Logging web services request/response messages in WLS

This comes very handy while debugging an issue with Oracle BPM Suite Add those parameters to server start script or through the console change the startup parameters. -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true -Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true -Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true -Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true

Refreshing Data Controls When the BPM Payload is changed

As you all know by now that simple things can get complicated with JDeveloper. This is one of them, While working with BPM you sometime need to alter the Payload type and add new attributes to it. In able make those new attributes visible at the ADF taskflow side you need to refresh the data control definitions. This is a very simple, straighforward task. The issue comes around when you work with a team , where each member uses a different folder structure for their dev box. The project that you have the ADF pages and taskflows keeps a reference to the payload's schema definition files. The problem is this reference uses an absolute path instead of a relative path. So once you move your workspace to a different folder you can no longer do a "Refresh Data Control". To workaround this open DataControls.dcx file and update the references to the PayLoad XSD files.

Adhoc SQL Query Addon For Your ADF 11g Application

Image
It is very common that once you release your application you may need to execute some SQL queries through your application for trouble shooting purposes etc. I wanted to try how possible to implement  this in ADF and here is what I found in a very primitive way. I have a text area for the user to enter the SQL query and when the execute button is clicked the results will be displayed in the table below. In able to achieve this I am creating a View Object from a SQL statement in my AM. AM code ... @Override protected void prepareSession(Session session) { super.prepareSession(session); if (findViewObject("SQLVo") == null) { createViewObjectFromQueryStmt("SQLVo", " select 1 from dual "); } } public void executeSQL(String pSQLQuery){ ViewObjectImpl vo = null; if (findViewOb...

Microsoft Code Camp

Last Saturday I attended a Microsoft developer's code camp event in Fort Lauderdale. You might be wondering why I am attending a MS event while working with ADF and Java. First of all these events are really great opportunities to see what is going on in the Microsoft world. Secondly I usually try to attend more generic sessions so that I can benefit more. I really enjoyed it again .. Those were the keywords from the event Azure - MS's cloud computing platform Silverlight -MS technology that corresponds to flash/ JavaFX SQL Sharepoint WCF  I wonder why Oracle or Sun doesn't organize events like this .. Is that that tough ? Microsoft is putting a great effort to build and support their developer's community. I expect something similar from Oracle as an Oracle Developer. 

Custom Declarative Component- Multi-Select LOV

Image
 I needed to implement a multi select LOV solution for a requirement and I thought that building a declarative component would be the ideal way to go ..   Here I will give a sample of that component, you can enhance it according to your needs. 1-Start a new application and add a new generic application 2-From the new gallery pick "JSF Declarative Component" 3-Provide details for the component 4-Edit MultiSelect.jspx and add your components. I will use an inputText and an icon to simulate the LOV. When the icon is clicked I will launch a popup and in the popup I will use a af:query and af:table . LovModel has attributes for af:query and af:table. Those attributes will be utilized to fetch the lov data and search areas. Make sure you set the Simple attribute to true. Otherwise it wont align well in panelFormLayout Now we need to add the popup .. Pay attention to the af table I used here. It is a dynamic table and it forms itself from the lovModel. It is se...

Launching an LOV by clicking a link or button 11g

I needed to launch the LOV by clicking a link and found the below solution.. Basically I have a RichInputListOfValues on my page but it is set to invisible and I am using a commandlink to popup the LOV .. See the code below.. RichInputListOfValues lovComp = getPostingTemplate(); FacesCtrlLOVBinding.ListOfValuesModelImpl lovModel = null; lovModel = (FacesCtrlLOVBinding.ListOfValuesModelImpl)lovComp.getModel(); lovModel.performQuery(lovModel.getQueryDescriptor()); LaunchPopupEvent e = new LaunchPopupEvent(lovComp); e.queue();

Soft delete with ADF entities

Say that you have a table created with this script, create table users(user_name varchar2(20) primary key, name varchar2(100),active_yn varchar2(1) default 'Y') And you want to set the active_yn to N when a delete occurs instead of doing a hard delete. I found this solution working, I am still not sure whether it is the best way or not.. I created my entity by using the wizard . Then edit the entity and on the Java tab select the below check boxes to generate the required Java classes. 1-Generate entity object class 2-Remove method 3-Data manipulation methods Then in the generated Java file change the remove and doDml methods as below /**Add entity remove logic in this method. */ public void remove() { setActiveYn("N"); super.remove(); } /**Custom DML update/insert/delete logic here. */ protected void doDML(int operation, TransactionEvent e) { if (operation != DML_DELETE) super.doDML(operation, e); ...

Handling the navigation from a backing bean

Yesterday I was experiencing some login form, in which I am calling a backing bean when the login button is pressed. In the backing bean depending on the return of the operation call I want to redirect the navigation to the corresponding page. After doing some research in the forums I found the below solution. We use NavigationHandler class to redirect the flow of the application. public String doLogin() { BindingContainer bindings = getBindings(); OperationBinding operationBinding = bindings.getOperationBinding("login"); Object result = operationBinding.execute(); FacesContext context = FacesContext.getCurrentInstance(); NavigationHandler nh = context.getApplication().getNavigationHandler(); if (((String)result).equals("SUCCESS")) nh.handleNavigation(context, null, "SUCCESS"); else nh.handleNavigation(context, null, "ERROR"); return null; }

ADF Methodology email list

Some ADF experts created a mailing list on Google to discuss the best practices with ADF. Here is the link to be part of that group http://groups.google.com/group/adf-methodology?hl=en

Calling a PL/SQL function from ADF using JDeveloper 11G TP4

Image
I will go over how to call a PL/SQL function from Jdeveloper 11G Tp4 First create a function that you will use , for this I used JDeveloper's database editor Then create an ADF project and an Application Modulu within the new project. Follow the wizard until the Java screen, there we need to check the first check box to generate the Java class file for the application module. Once you are done with the wizard you will see that a Java file was created under the application module. Edit this file and add the a public method to call the PL/Sql API. For more information you can check the developer's guide documentation . Now we need to expose this function . To do this edit the application module and go to Java tab. There click the pen for client interface. You should the newly created function on the left side. Select it and move it to right. After completing the previous step you should be seeing your function under Data controls. Everything is ready now. We need to create a page...

JDeveloper 11G TP4

I started to work with the IDE 3 weeks ago. My company decided to migrate our existing forms application to ADF. My first impression with IDE was not so positive but it is still a preview release so I hope it will be better once released. I decided to write my experiences with this tool from now on..Lets see how it will be .. Wait me JDeveloper , I am coming to explore you !!

.Net Seminar About Orcas

Yesterday I have attended to a .Net seminar at Naples. It was about the newcoming Visual Studio code named Orcas. What I learnt from the seminar is They will make the new IDE multi targetted. This means you will be able to compile your project against diffrent .Net versions. IDE will support nested masterpages at design time There will be more components for AJAX as expected IntelliSense will be supported for JavaScript also JavaScript debugging will be added. C# will support a Query language against collections. Class extensions will be possible for sealed classes. LINQ= Query language for every source of data. -No more strings for writing queries.Compiler will be aware of the query sytax, this will avoid mistyping ,sytax errors etc. ORM-Object Relational Mapping ; There will be OR designer in the IDE for mapping your relational data to your Object domain.