Commit f7a7eef2 authored by Marco Descher's avatar Marco Descher
Browse files

[16515] Remove message parties

parent b433214a
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ import org.slf4j.LoggerFactory;
import ch.elexis.core.model.IMessage;
import ch.elexis.core.model.IUser;
import ch.elexis.core.model.message.MessageCode;
import ch.elexis.core.model.message.MessageParty;
import ch.elexis.core.model.message.MessageParty.MessagePartyType;
import ch.elexis.core.model.tasks.IIdentifiedRunnable;
import ch.elexis.core.model.tasks.IIdentifiedRunnable.ReturnParameter;
import ch.elexis.core.model.tasks.IIdentifiedRunnableFactory;
@@ -277,8 +275,7 @@ public class TaskServiceImpl implements ITaskService {
	
	private void sendMessageToOwner(ITask task, IUser owner, TaskState state){
		IMessage message = messageService
			.prepare(new MessageParty(contextService.getRootContext().getStationIdentifier(),
				MessagePartyType.STATION), new MessageParty(owner.getId()));
			.prepare(contextService.getRootContext().getStationIdentifier(), owner.getId());
		message.addMessageCode(MessageCode.Key.SenderSubId, "tasks.taskservice");
		message.setSenderAcceptsAnswer(false);
		
+19 −24
Original line number Diff line number Diff line
@@ -899,26 +899,34 @@
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="IMessage" abstract="true" interface="true"
      eSuperTypes="#//Identifiable #//Deleteable">
    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
      <details key="documentation" value="A message sent between the involved message parties (see IMessageParty)"/>
    </eAnnotations>
    <eOperations name="setSender">
      <eParameters name="user" eType="#//IUser"/>
    </eOperations>
    <eOperations name="addReceiver">
      <eParameters name="addReceiver" eType="#//IMessageParty"/>
    </eOperations>
    <eOperations name="addMessageCode">
      <eParameters name="key" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
      <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="sender" lowerBound="1"
        eType="#//IMessageParty"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="receiver" lowerBound="1"
        upperBound="-1" eType="#//IMessageParty"/>
    <eOperations name="addReceiver">
      <eParameters name="receiver" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    </eOperations>
    <eOperations name="addReceiver">
      <eParameters name="receiver" eType="#//IUser"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="sender" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The sender of the message. Possibly a userid that may be resolved to an IUser or another identifier (e.g. a station or system name)."/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="receiver" upperBound="-1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The list of receivers. If empty, send message to everybody."/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="senderAcceptsAnswer" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="wether the sender of this message will accept or handle answer (e.g. a message sent by the system to an IUser will not necessarily be handled)"/>
        <details key="documentation" value="wether the sender of this message will accept or handle an answer, i.e. unidirectional communication."/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="createDateTime" eType="ecore:EDataType types.ecore#//LocalDateTime"/>
@@ -939,17 +947,4 @@
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="messagePriority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
        defaultValueLiteral="0"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="IMessageParty" abstract="true" interface="true">
    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
      <details key="documentation" value="A station, user or other type if message party."/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="identifier" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
        changeable="false"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
        changeable="false" defaultValueLiteral="0">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The message party type: 0=user (default), 1=station; more to follow on requirement"/>
      </eAnnotations>
    </eStructuralFeatures>
  </eClassifiers>
</ecore:EPackage>
+8 −9
Original line number Diff line number Diff line
@@ -611,8 +611,8 @@
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//IAccount/numeric"/>
    </genClasses>
    <genClasses image="false" ecoreClass="model.ecore#//IMessage">
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model.ecore#//IMessage/sender"/>
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model.ecore#//IMessage/receiver"/>
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EAttribute model.ecore#//IMessage/sender"/>
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EAttribute model.ecore#//IMessage/receiver"/>
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//IMessage/senderAcceptsAnswer"/>
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//IMessage/createDateTime"/>
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//IMessage/messageText"/>
@@ -621,17 +621,16 @@
      <genOperations ecoreOperation="model.ecore#//IMessage/setSender">
        <genParameters ecoreParameter="model.ecore#//IMessage/setSender/user"/>
      </genOperations>
      <genOperations ecoreOperation="model.ecore#//IMessage/addReceiver">
        <genParameters ecoreParameter="model.ecore#//IMessage/addReceiver/addReceiver"/>
      </genOperations>
      <genOperations ecoreOperation="model.ecore#//IMessage/addMessageCode">
        <genParameters ecoreParameter="model.ecore#//IMessage/addMessageCode/key"/>
        <genParameters ecoreParameter="model.ecore#//IMessage/addMessageCode/value"/>
      </genOperations>
    </genClasses>
    <genClasses image="false" ecoreClass="model.ecore#//IMessageParty">
      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//IMessageParty/identifier"/>
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//IMessageParty/type"/>
      <genOperations ecoreOperation="model.ecore#//IMessage/addReceiver">
        <genParameters ecoreParameter="model.ecore#//IMessage/addReceiver/receiver"/>
      </genOperations>
      <genOperations ecoreOperation="model.ecore#//IMessage/addReceiver.1">
        <genParameters ecoreParameter="model.ecore#//IMessage/addReceiver.1/receiver"/>
      </genOperations>
    </genClasses>
  </genPackages>
</genmodel:GenModel>
+29 −19
Original line number Diff line number Diff line
@@ -20,10 +20,6 @@ import java.util.Map;
 * A representation of the model object '<em><b>IMessage</b></em>'.
 * <!-- end-user-doc -->
 *
 * <!-- begin-model-doc -->
 * A message sent between the involved message parties (see IMessageParty)
 * <!-- end-model-doc -->
 *
 * <p>
 * The following features are supported:
 * </p>
@@ -43,53 +39,59 @@ import java.util.Map;
 */
public interface IMessage extends Identifiable, Deleteable {
	/**
	 * Returns the value of the '<em><b>Sender</b></em>' reference.
	 * Returns the value of the '<em><b>Sender</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Sender</em>' reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Sender</em>' reference.
	 * @see #setSender(IMessageParty)
	 * <!-- begin-model-doc -->
	 * The sender of the message. Possibly a userid that may be resolved to an IUser or another identifier (e.g. a station or system name).
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Sender</em>' attribute.
	 * @see #setSender(String)
	 * @see ch.elexis.core.model.ModelPackage#getIMessage_Sender()
	 * @model required="true"
	 * @generated
	 */
	IMessageParty getSender();
	String getSender();

	/**
	 * Sets the value of the '{@link ch.elexis.core.model.IMessage#getSender <em>Sender</em>}' reference.
	 * Sets the value of the '{@link ch.elexis.core.model.IMessage#getSender <em>Sender</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Sender</em>' reference.
	 * @param value the new value of the '<em>Sender</em>' attribute.
	 * @see #getSender()
	 * @generated
	 */
	void setSender(IMessageParty value);
	void setSender(String value);

	/**
	 * Returns the value of the '<em><b>Receiver</b></em>' reference list.
	 * The list contents are of type {@link ch.elexis.core.model.IMessageParty}.
	 * Returns the value of the '<em><b>Receiver</b></em>' attribute list.
	 * The list contents are of type {@link java.lang.String}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Receiver</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Receiver</em>' reference list.
	 * <!-- begin-model-doc -->
	 * The list of receivers. If empty, send message to everybody.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Receiver</em>' attribute list.
	 * @see ch.elexis.core.model.ModelPackage#getIMessage_Receiver()
	 * @model required="true"
	 * @model
	 * @generated
	 */
	List<IMessageParty> getReceiver();
	List<String> getReceiver();

	/**
	 * Returns the value of the '<em><b>Sender Accepts Answer</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * wether the sender of this message will accept or handle answer (e.g. a message sent by the system to an IUser will not necessarily be handled)
	 * wether the sender of this message will accept or handle an answer, i.e. unidirectional communication.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Sender Accepts Answer</em>' attribute.
	 * @see #setSenderAcceptsAnswer(boolean)
@@ -226,7 +228,7 @@ public interface IMessage extends Identifiable, Deleteable {
	 * @model
	 * @generated
	 */
	void addReceiver(IMessageParty addReceiver);
	void addMessageCode(String key, String value);

	/**
	 * <!-- begin-user-doc -->
@@ -234,6 +236,14 @@ public interface IMessage extends Identifiable, Deleteable {
	 * @model
	 * @generated
	 */
	void addMessageCode(String key, String value);
	void addReceiver(String receiver);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	void addReceiver(IUser receiver);

} // IMessage
+0 −62
Original line number Diff line number Diff line
/**
 * Copyright (c) 2019 MEDEVIT <office@medevit.at>.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     MEDEVIT <office@medevit.at> - initial API and implementation
 */
package ch.elexis.core.model;


/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>IMessage Party</b></em>'.
 * <!-- end-user-doc -->
 *
 * <!-- begin-model-doc -->
 * A station, user or other type if message party.
 * <!-- end-model-doc -->
 *
 * <p>
 * The following features are supported:
 * </p>
 * <ul>
 *   <li>{@link ch.elexis.core.model.IMessageParty#getIdentifier <em>Identifier</em>}</li>
 *   <li>{@link ch.elexis.core.model.IMessageParty#getType <em>Type</em>}</li>
 * </ul>
 *
 * @see ch.elexis.core.model.ModelPackage#getIMessageParty()
 * @model interface="true" abstract="true"
 * @generated
 */
public interface IMessageParty {
	/**
	 * Returns the value of the '<em><b>Identifier</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Identifier</em>' attribute.
	 * @see ch.elexis.core.model.ModelPackage#getIMessageParty_Identifier()
	 * @model changeable="false"
	 * @generated
	 */
	String getIdentifier();

	/**
	 * Returns the value of the '<em><b>Type</b></em>' attribute.
	 * The default value is <code>"0"</code>.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The message party type: 0=user (default), 1=station; more to follow on requirement
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Type</em>' attribute.
	 * @see ch.elexis.core.model.ModelPackage#getIMessageParty_Type()
	 * @model default="0" required="true" changeable="false"
	 * @generated
	 */
	int getType();

} // IMessageParty
Loading