Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » Attaching Notes via Startdust API(create notes out of user data entry on Stardust Portal)
Attaching Notes via Startdust API [message #1066296] Tue, 02 July 2013 04:41
Vikash Pandey is currently offline Vikash PandeyFriend
Messages: 12
Registered: October 2011
Junior Member
Use Case: Consider a scenario where you need to create and attach notes to the process instance out of the data entered by user, while working on a manual activity. E.g. There is a remarks field on the UI while user is capturing details of a dispute, and you are required to attach all the text entered in remarks field as notes to the process instance.

Steps to do it:
Ensure you pass ProcessOID data from model to the converted JSF activity's backing bean.
Use ProcessOID to get required details for adding notes using below code:
        public Long processOID;
	public ProcessInstance processInstance;
	private ProcessInstance scopeProcessInstance;
	private ProcessInstanceAttributes attributes;
	public Long getProcessOID() {
		return processOID;
	}

	public void setProcessOID(Long processOID) {
		this.processOID = processOID;
	}

	@SuppressWarnings("deprecation")
	public void attachNotes(String notes){
		processInstance =    
                ProcessInstanceUtils.getProcessInstance(processOID);
		
		scopeProcessInstance =        
                ProcessInstanceUtils.getProcessInstance
               (this.processInstance.getScopeProcessInstanceOID());
		attributes = scopeProcessInstance.getAttributes();
		scopeProcessInstance.getAttributes().addNote(notes , 
                ContextKind.ProcessInstance, processInstance.getOID());
		 
                ServiceFactoryUtils.getWorkflowService().
                setProcessInstanceAttributes(this.attributes);


	}
	
	public void complete() {
                //getting the required data and pass it as arg to attachNotes
		attachNotes(getData().get("Remarks").toString());
		mergeDataForList(Data, (Map)getData("Data"));
	}


on completion of the activity, the text entered in remarks field on UI will be added to Notes of the PI.
Previous Topic:MySQL 5.6
Next Topic:RowSelectorEvent and updating the controls on UI
Goto Forum:
  


Current Time: Fri Apr 26 18:43:32 GMT 2024

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

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

Back to the top