WebService AuditTrailng/Running Status

81 views
Skip to first unread message

norber...@multimageweb.com

unread,
Dec 6, 2018, 12:57:52 AM12/6/18
to iDempiere
Hi,

we have issue with soap initiated long running tasks in erp. for example let see 2 use cases
  1. Send soap request from mobile client -  run process which running avg 90 sec
  2. Send soap request from mobile client - starts composite service creating/update records eg. IM with 100 lines then an last step complete it. (duration let say 90 sec)
because idempiere running behind proxy (haproxy also we using aws api gateway) - there is always timeout because security and other reasons.
while backround tasks (process/create composite) duration is more then timeout treshold, then we lost result/response - controll over backgraound task status.

in case 1. we implemented a solution - just simple add runasjob as web service parameter - so when process start then we return process id. we create a processstatus soap endpoint and ask periodically about the status. When processing marked 'N',  then job is done and we can finish async js task and stop eg.. busy box and mark local record as processed (eg cant send multiple times)

in case 2. it is not possible make approach while no audit trail about action (composite create record) - what happening - our mobile client start create new document api gw timeout,  we lost connection in client side and our client has ad1. no response - eg which document no was created ad2. has no chance to know does doc creation was successful or rolled-back. (eg. mobile app local record has flag sent y/n - we cant mark y so left n, user has hanged up process later try it again - so wrong.)

my thoughts: we can implement a new object webservice responses or webservice audit_trail, where we can trail all  soap requests and their respones. This layer must be enough/scalable/customisable/configurable which details about background process results, statuses, errors, response codes must handle etc.

please share your ideas how to handle above issue.
probably we can sponsoring part of development costs.

any ideas or solution we not recognise ?
norbert

Heng Sin Low

unread,
Dec 6, 2018, 8:26:40 AM12/6/18
to idem...@googlegroups.com
Instead of composite web service, we use process call here. Client send the whole transaction in as one xml or json document and the process will do the parsing and db update. Since it is a process call, you have the process audit detail and where more logging is require, we just log the outgoing message the process log ( incoming message is already capture as the process parameter ). Also, with some work, you can use the process audit log to re-process incoming data that have issues.

This e-mail is confidential and may contain legally privileged information. It is intended only for the addressees and may not be reviewed or used in any way by other recipients. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message and any attachments thereto from your system.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/b4c1eb4e-b36e-40ac-b155-b3f8adbc76b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

norber...@multimageweb.com

unread,
Dec 6, 2018, 9:19:55 AM12/6/18
to iDempiere
thanks for response. you suppose to write a generic process this will refer to specific methods OR create per each task specific process ?
norbert

Carlos Antonio Ruiz Gómez

unread,
Dec 6, 2018, 9:48:55 AM12/6/18
to iDempiere
> in case 1. we implemented a solution - just simple add runasjob as web service parameter - so when process start then we return process id. 
> we create a processstatus soap endpoint and ask periodically about the status. When processing marked 'N',  then job is done and we can 
> finish async js task and stop eg.. busy box and mark local record as processed (eg cant send multiple times)

This sounds very interesting?  Is there a ticket for that?

Regards,

Carlos Ruiz

Alan Lescano

unread,
Dec 6, 2018, 11:11:54 AM12/6/18
to idem...@googlegroups.com
Hi!

> in case 1. we implemented a solution - just simple add runasjob as web service parameter - so when process start then we return process id. 
> we create a processstatus soap endpoint and ask periodically about the status. When processing marked 'N',  then job is done and we can 
> finish async js task and stop eg.. busy box and mark local record as processed (eg cant send multiple times)

I'm using this way here. Our payload has sometimes > 50mb (with some minutes of server processing time), and we use the async way. It's not a broad feature like "run as job"... was written just for a specific task, but works very well. It's a great approach

Alan



--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

norber...@multimageweb.com

unread,
Dec 6, 2018, 12:37:13 PM12/6/18
to iDempiere
DROP VIEW IF EXISTS ws_ad_pinstance_detail CASCADE;

CREATE OR REPLACE VIEW ws_ad_pinstance_detail
(
  ad_client_id,
  ad_org_id,
  created,
  createdby,
  updated,
  updatedby,
  isactive,
  ws_ad_pinstance_detail_id,
  ad_pinstance_id,
  isprocessing,
  result,
  errormsg
)
AS 
 SELECT pin.ad_client_id,
    pin.ad_org_id,
    pin.created,
    pin.createdby,
    pin.updated,
    pin.updatedby,
    pin.isactive,
    pin.ad_pinstance_id AS ws_ad_pinstance_detail_id,
    pin.ad_pinstance_id,
    pin.isprocessing,
    pin.result,
    pin.errormsg
   FROM ad_pinstance pin;


GRANT SELECT, DELETE, UPDATE, REFERENCES, TRUNCATE, INSERT, TRIGGER ON ws_ad_pinstance_detail TO adempiere;


COMMIT;


this view return status - but we tweak webservices to allow start process as RunAsJob.
if interesting i can create ticket.

however i would like to improve this and track all request and respones.
as i wrote above.

nb

Heng Sin Low

unread,
Dec 7, 2018, 9:36:19 AM12/7/18
to idem...@googlegroups.com
usually we create specific process for each task.

Reply all
Reply to author
Forward
0 new messages