Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » what is the best way to log all form fields from an external mashup?(when a task is completed we want to make a log of all fields on the form)
what is the best way to log all form fields from an external mashup? [message #1486300] Tue, 25 November 2014 00:30 Go to next message
Dan Cimpoesu is currently offline Dan CimpoesuFriend
Messages: 23
Registered: August 2014
Junior Member
Hi

Here is the business case.

For auditing purposes we want to keep a log of all input fields on the form when a task is completed (a new log entry for every task completed).

On forms we have two types of fields:

- fields bound to data objects (such as customer details, order information ...)
- instruction fields (a check list such as: sms sent, invoice sent, customer contacted ...)

Instruction fields are task instance specific and are not used by following tasks or processes. We want to log these form fields so we can review them in case of a dispute or incident.

We have a current solution but I am looking to alternatives. We created a log list data object and we link it to every single manual task. When the user clicks complete button on the form we iterate through all input fields on the form and build a name/value comma separated string; we assign this string to a new entry in log list data object. The problem with this approach is that it creates clutter in our models as every single manual task is linked to the log data object.

Do you have any alternatives to achieve this business use case?

Regards
Dan
Re: what is the best way to log all form fields from an external mashup? [message #1486925 is a reply to message #1486300] Tue, 25 November 2014 11:56 Go to previous messageGo to next message
Robert Emsbach is currently offline Robert EmsbachFriend
Messages: 186
Registered: October 2011
Location: Singapore
Senior Member

Dan,

so the regular audit trail does not satisfy your requirement because the data may be overwritten in later steps and you need versioning?

If instruction fields are not accessed after the activity instance anymore then you don't need versioning for those and can simply use out data mappings to store them in the audit trail. If you need to keep a copy of the same process data's values over several executions of activity instances that possibly modify them, then you can use sub processes with scope sync separate. That way each sub process gest its own data scope. The separate scope of the sub processes will not be accessed anymore once the subprocess is completed. That approach would work purely with modelling.

If you want to avoid any impact on the model and adding code is acceptable then you can leverage the SPI IActivityInstanceMonitor

You could also come up with an approach that leverages the versioning mechanism of the document management system or combine it with this SPI.

Does that help?

Best regards

Rob
Re: what is the best way to log all form fields from an external mashup? [message #1487923 is a reply to message #1486925] Wed, 26 November 2014 07:05 Go to previous messageGo to next message
Dan Cimpoesu is currently offline Dan CimpoesuFriend
Messages: 23
Registered: August 2014
Junior Member
Thanks Rob,

You are right, data is overwritten in later steps and we need versioning.

The second option you mentioned would result in every manual task to be put in a separate sub-process (most manual tasks have instruction fields). This is not practical however it would work.

I think SPI IActivityInstanceMonitor and document versioning options would work but it is something I need to investigate and prototype. For document versioning option I guess we need to implement a handler on complete and save the form fields in a document.

Is it possible to bind programatically an output data object to a manual task? In our current approach we need to bind every manual task to a log data object and that creates clutter in the model.

Best Regards
Dan




Re: what is the best way to log all form fields from an external mashup? [message #1487967 is a reply to message #1487923] Wed, 26 November 2014 07:52 Go to previous messageGo to next message
Robert Emsbach is currently offline Robert EmsbachFriend
Messages: 186
Registered: October 2011
Location: Singapore
Senior Member

Dan,

agree, if you need this for every manual activity then the sub process approach is not the solutions.

a) Usually I would simply call a REST service from a custom HTML5 UI to write away the data. However, if you want to keep using manual activities with generated UIs then that is not an option. (The subject says external Ui mashup. If those pages are under your control then this option is valid).

b) Binding between an activity and a data is usually done via data mappings. You could implement a data type which stores data externally (like the Hibernate or EJB data types) but supports versioning. (If I remember it correctly a project implemented this for SDOs, but I don't have access to the code). The source of the Hibernate or Documente data type could serve you as a starting point and give you the structure / interface Stardust requires. The implementation of the load and save methods would have to be exchanged with the desired logic.

This approach would allow you to keep using manual activities and write the data via the out data mapping. The model would look nice and you would not require an extra service call.

c) It is very easy to hook into the SPI I mentioned. It gives you access to the complete activity instance. In your custom implementation you could distinguish between activities for which you want to version the data and others, then call the service that versions the data.


I any case the persistence could be the DMS (or not). The benefit I see is the ootb versioning. You certainly know that a "document" can be any kind of file including e.g. JSON or XML files.

IMO b) would be the nicest solution while c) would likely be the fastest. If we came to a nice result then it would also be worth adding it to Stardust so the maintenance is ensured.

Best regards

Rob

[Updated on: Wed, 26 November 2014 08:02]

Report message to a moderator

Re: what is the best way to log all form fields from an external mashup? [message #1497884 is a reply to message #1487967] Thu, 04 December 2014 03:44 Go to previous messageGo to next message
Dan Cimpoesu is currently offline Dan CimpoesuFriend
Messages: 23
Registered: August 2014
Junior Member
Hi Rob,

As I mentioned before on task forms we have two types of fields:

- data bound fields
- instruction fields (not defined in the model)

Because instruction fields are not in the model we can not handle them on the servers side; our solution must be based on REST calls initiated from the task form.

Here is our current solution:

- on task forms we tag all data and instruction fields with a CSS class (eg. "logged")

- when user clicks SAVE or COMPLETE buttons:
-- build a comma separated string of key=value with all tagged fields
-- call web service IWorkflowService.writeLogEntry to save the fields information in audit trail database
-- do the SAVE or COMPLETE function

- when a task is activated and task form loaded:
-- call web service IQueryService.findLogEntries
-- if log entry found for current task restore the instruction fields from the audit trail log

This way when we look to a process / activity history we can see both data fields and instruction fields of the task at the point it was saved / completed.

This solution appears conceptually right as we literally want to have a log of task forms and using audit trail logs feels natural.

The caveat is that the entries in the audit trail logs are marked as warning. This does not look good but it works in regard of functionality. Do you have a suggestion on how to fix this presentation issue?

Please let me know what you think about our solution?

Regards
Dan
Re: what is the best way to log all form fields from an external mashup? [message #1499045 is a reply to message #1497884] Thu, 04 December 2014 21:57 Go to previous message
Dan Cimpoesu is currently offline Dan CimpoesuFriend
Messages: 23
Registered: August 2014
Junior Member
I want to mention another issue. We could not propagate the logged in user credentials to the task form. To work around we created a special user and hard codded that user credentials in JavaScript. This is a workaround that need removed.

Regards
Dan
Previous Topic:Data mapping could not be resolved during model deployment
Next Topic:AtomicReference error
Goto Forum:
  


Current Time: Tue Mar 19 02:35:46 GMT 2024

Powered by FUDForum. Page generated in 0.02097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top