[go: up one dir, main page]

JP2010198457A - Source code creation device and source code creation program - Google Patents

Source code creation device and source code creation program Download PDF

Info

Publication number
JP2010198457A
JP2010198457A JP2009044121A JP2009044121A JP2010198457A JP 2010198457 A JP2010198457 A JP 2010198457A JP 2009044121 A JP2009044121 A JP 2009044121A JP 2009044121 A JP2009044121 A JP 2009044121A JP 2010198457 A JP2010198457 A JP 2010198457A
Authority
JP
Japan
Prior art keywords
source code
executed
appending
activity
determination
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009044121A
Other languages
Japanese (ja)
Inventor
Arihito Nohara
有人 野原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP2009044121A priority Critical patent/JP2010198457A/en
Publication of JP2010198457A publication Critical patent/JP2010198457A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

【課題】アクティビティ情報、及び処理に対応するソースコードからアクティビティ図が示す処理を行なうためのソースコードを作成するソースコード作成装置、ソースコード作成プログラムを提供する。
【解決手段】単一処理か複合処理かを判定する第1判定処理、同期処理か順次処理かを判定する第2判定処理、終了したことを通知するための複合処理が存在するか否か判定する第3判定処理、最初に実行する順次処理を認識する第1認識処理、いずれの処理が実行中であるかを認識する第2認識処理、実行中の処理の次に実行する処理が存在するか否かを判定する第4判定処理、順次処理を実行した際に実行中の処理の次に実行する複数の処理が存在する場合に、いずれの処理を次に実行するかを判定する第5判定処理、同期処理において同時に実行する複数の処理を認識する第3認識処理、及び実行中の各処理の終了を同期させるための終了同期処理をソースコードに追記する。
【選択図】図4
A source code creation device and a source code creation program for creating a source code for performing processing shown in an activity diagram from activity information and source code corresponding to the processing are provided.
A first determination process for determining whether the process is a single process or a composite process, a second determination process for determining whether the process is a synchronous process or a sequential process, and determining whether there is a composite process for notifying completion There are a third determination process to be performed, a first recognition process for recognizing a sequential process to be executed first, a second recognition process for recognizing which process is being executed, and a process to be executed next to the process being executed. A fourth determination process for determining whether or not there is a plurality of processes to be executed next to a process that is being executed when the sequential processes are executed; A third recognition process for recognizing a plurality of processes executed simultaneously in the determination process and the synchronization process, and an end synchronization process for synchronizing the end of each process being executed are added to the source code.
[Selection] Figure 4

Description

本発明は、ソースコード作成装置、ソースコード作成プログラムに関する。   The present invention relates to a source code creation device and a source code creation program.

特許文献1には、オブジェクト指向システム開発において、テスト性、及びメインテナンス性に優れたサブシステムを構成するためのソフトウェア・インタフェース・デザインパターンが開示されている。   Patent Document 1 discloses a software interface design pattern for configuring a subsystem excellent in testability and maintenance in object-oriented system development.

特許文献2には、自然言語で記述されたシステムの振る舞いを記したシナリオを作成し、定型化された分析方法に従い図解編集装置を用いて分析作業を行うことで、オブジェクトモデルを構築することを目的とした分析方法と支援装置が開示されている。   In Patent Document 2, a scenario describing the behavior of a system described in a natural language is created, and an object model is constructed by performing analysis work using a graphic editing device according to a standardized analysis method. An intended analysis method and support apparatus are disclosed.

特開平10−105404号公報JP-A-10-105404 特開2004−157950号公報JP 2004-157950 A

本発明は順序処理、同期処理、及び分岐処理を含む処理で構成されるアクティビティ図を示すアクティビティ情報、及び前記処理に対応するソースコードからアクティビティ図が示す処理を行なうためのソースコードを作成するソースコード作成装置、ソースコード作成プログラムを提供することを目的とする。   The present invention provides activity information indicating an activity diagram composed of processes including sequence processing, synchronization processing, and branch processing, and a source for generating source code for performing the processing indicated by the activity diagram from the source code corresponding to the processing It is an object to provide a code creation device and a source code creation program.

上記目的を達成するために、請求項1の発明は、順序処理、同期処理、及び分岐処理を含む処理で構成されるアクティビティ図を示すアクティビティ情報、及び前記処理に対応するソースコードを取得する取得手段と、前記取得手段により取得されたアクティビティ情報に示される前記処理が単一処理か複合処理かを前記処理毎に判定する第1判定処理を前記ソースコードに追記する第1追記手段と、前記第1判定処理により複合処理と判定された処理が、同期処理か順次処理かを判定する第2判定処理を前記ソースコードに追記する第2追記手段と、前記処理を実行した際に、前記処理が終了した場合に終了したことを通知するための前記第1判定処理により判定された複合処理が存在するか否か判定する第3判定処理を前記ソースコードに追記する第3追記手段と、前記第2判定処理により判定された順次処理のうち、最初に実行する処理を示す開始処理を認識する第1認識処理を前記ソースコードに追記する第4追記手段と、前記順次処理を実行した際に、いずれの処理が実行中であるかを認識する第2認識処理を前記ソースコードに追記する第5追記手段と、前記順次処理を実行した際に、実行中の処理の次に実行する処理が存在するか否かを判定する第4判定処理を前記ソースコードに追記する第6追記手段と、前記順次処理を実行した際に、実行中の処理の次に実行する複数の処理が存在する場合に、いずれの処理を次に実行するかを判定する第5判定処理を前記ソースコードに追記する第7追記手段と、前記第2判定処理により判定された同期処理において実行する複数の処理を認識する第3認識処理を前記ソースコードに追記する第8追記手段と、実行中の各処理の終了を同期させるための終了同期処理を前記ソースコードに追記する第9追記手段と、を有する。   In order to achieve the above object, the invention of claim 1 acquires activity information indicating an activity diagram composed of processing including sequential processing, synchronization processing, and branch processing, and acquisition of source code corresponding to the processing. A first appending unit for appending to the source code a first determination process for determining for each process whether the process indicated by the activity information acquired by the acquiring unit is a single process or a composite process; A second appending means for appending a second determination process for determining whether the process determined to be a composite process by the first determination process is a synchronous process or a sequential process to the source code; and when the process is executed, the process A third determination process for determining whether or not there is a composite process determined by the first determination process for notifying that the process has ended when the process ends. A third appending means for appending; and a fourth appending means for appending to the source code a first recognition process for recognizing a start process indicating a process to be executed first among the sequential processes determined by the second determination process. , When executing the sequential process, a fifth recognition unit for adding a second recognition process for recognizing which process is being executed to the source code; and executing when the sequential process is executed A fourth determination process for adding a fourth determination process to the source code to determine whether there is a process to be executed next to the process, and a process that is being executed when the sequential process is executed. When there are a plurality of processes to be executed, a seventh determination unit that adds a fifth determination process to determine which process to execute next to the source code, and the synchronization determined by the second determination process Execute in processing An eighth appending unit for appending a third recognition process for recognizing a number of processes to the source code; and a ninth appending unit for appending an end synchronization process for synchronizing the end of each process being executed to the source code; Have.

上記目的を達成するために、請求項2の発明は、コンピュータを、順序処理、同期処理、及び分岐処理を含む処理で構成されるアクティビティ図を示すアクティビティ情報、及び前記処理に対応するソースコードを取得する取得手段と、前記取得手段により取得されたアクティビティ情報に示される前記処理が単一処理か複合処理かを前記処理毎に判定する第1判定処理を前記ソースコードに追記する第1追記手段と、前記第1判定処理により複合処理と判定された処理が、同期処理か順次処理かを判定する第2判定処理を前記ソースコードに追記する第2追記手段と、前記処理を実行した際に、前記処理が終了した場合に終了したことを通知するための前記第1判定処理により判定された複合処理が存在するか否か判定する第3判定処理を前記ソースコードに追記する第3追記手段と、前記第2判定処理により判定された順次処理のうち、最初に実行する処理を示す開始処理を認識する第1認識処理を前記ソースコードに追記する第4追記手段と、前記順次処理を実行した際に、いずれの処理が実行中であるかを認識する第2認識処理を前記ソースコードに追記する第5追記手段と、前記順次処理を実行した際に、実行中の処理の次に実行する処理が存在するか否かを判定する第4判定処理を前記ソースコードに追記する第6追記手段と、前記順次処理を実行した際に、実行中の処理の次に実行する複数の処理が存在する場合に、いずれの処理を次に実行するかを判定する第5判定処理を前記ソースコードに追記する第7追記手段と、前記第2判定処理により判定された同期処理において実行する複数の処理を認識する第3認識処理を前記ソースコードに追記する第8追記手段と、実行中の各処理の終了を同期させるための終了同期処理を前記ソースコードに追記する第9追記手段と、として機能させるためのソースコード作成プログラムである。   In order to achieve the above-mentioned object, the invention of claim 2 provides a computer with activity information indicating an activity diagram composed of processes including order processing, synchronization processing, and branch processing, and source code corresponding to the processing. Acquiring means for acquiring, and first appending means for appending to the source code a first determination process for determining for each process whether the process indicated by the activity information acquired by the acquiring means is a single process or a composite process And a second appending means for appending a second determination process to the source code for determining whether the process determined to be a composite process by the first determination process is a synchronous process or a sequential process, and when executing the process A third determination process for determining whether or not there is a composite process determined by the first determination process for notifying that the process has ended when the process ends. The third additional recording means for adding to the source code and the first recognition process for recognizing the start process indicating the process to be executed first among the sequential processes determined by the second determination process are added to the source code. 4 additional writing means, when the sequential processing is executed, when the sequential processing is executed, the fifth additional writing means for adding a second recognition process for recognizing which processing is being executed to the source code, and when the sequential processing is executed In addition, when a fourth determination process for determining whether or not there is a process to be executed next to the process being executed is added to the source code, and when the sequential process is executed, When there are a plurality of processes to be executed next to the process, a seventh determination process for adding a fifth determination process to determine which process to execute next is added to the source code, and the second determination process. Determined synchronization processing In the second code, a third recognition process for recognizing a plurality of processes to be executed is added to the source code, and an end synchronization process for synchronizing the end of each process being executed is added to the source code. 9 is a source code creation program for functioning as additional writing means.

請求項1記載の発明によれば、順序処理、同期処理、及び分岐処理を含む処理で構成されるアクティビティ図を示すアクティビティ情報、及び前記処理に対応するソースコードからアクティビティ図が示す処理を行なうためのソースコードを作成するソースコード作成装置を提供することができる。   According to the first aspect of the present invention, in order to perform the process shown in the activity diagram from the activity information indicating the activity diagram configured by the process including the order process, the synchronization process, and the branch process, and the source code corresponding to the process. It is possible to provide a source code creation device for creating the source code of the source code.

請求項2記載の発明によれば、順序処理、同期処理、及び分岐処理を含む処理で構成されるアクティビティ図を示すアクティビティ情報、及び前記処理に対応するソースコードからアクティビティ図が示す処理を行なうためのソースコードを作成するソースコード作成プログラムを提供することができる。   According to the second aspect of the present invention, in order to perform the process shown in the activity diagram from the activity information indicating the activity diagram composed of the process including the order process, the synchronization process, and the branch process, and the source code corresponding to the process. It is possible to provide a source code creation program for creating the source code.

実施の形態に係るソースコード作成装置の構成を示す図である。It is a figure which shows the structure of the source code production apparatus which concerns on embodiment. 順序処理、同期処理、及び分岐処理の一例を示す図である。It is a figure which shows an example of an order process, a synchronous process, and a branch process. 順序処理、同期処理、及び分岐処理を組み合わせた一例を示す図である。It is a figure which shows an example which combined the order process, the synchronous process, and the branch process. 実施の形態に係るデザインパターンを示すクラス図である。It is a class diagram which shows the design pattern which concerns on embodiment. ソースコード作成処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a source code creation process. 順序Activityオブジェクト、及び同期Activityオブジェクトの振る舞いを示す図である。It is a figure which shows the behavior of an order Activity object and a synchronous Activity object. Activity図に示される処理を実行した際の各オブジェクトの動きを示す図である。It is a figure which shows the motion of each object at the time of performing the process shown by Activity figure. C言語用に作成したデザインパターンを示すクラス図である。It is a class diagram which shows the design pattern produced for C languages.

以下、図面を参照して、本発明の実施の形態について詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

次に、図2を用いて、ソースコード作成装置12の構成について説明する。ソースコード作成装置12は、CPU(Central Processing Unit)18と、HDD(Hard Disk Drive)20と、RAM(Random Access Memory)22と、ネットワークI/F部24と、ROM(Read Only Memory)26と、表示部28と、操作入力部30と、バス32とを含む。   Next, the configuration of the source code creation device 12 will be described with reference to FIG. The source code creation device 12 includes a CPU (Central Processing Unit) 18, an HDD (Hard Disk Drive) 20, a RAM (Random Access Memory) 22, a network I / F unit 24, a ROM (Read Only Memory) 26, , A display unit 28, an operation input unit 30, and a bus 32.

CPU18は、ソースコード作成装置12の全体の動作を司るものであり、後述するソースコード作成装置12の処理を示すフローチャートは、CPU18により実行される。HDD20は、各データベース、ソース作成プログラムなどのプログラム、OS(Operating System)などが記録される不揮発性の記憶装置である。RAM22は、OSやプログラムやデータが展開される揮発性の記憶装置である。ネットワークI/F部24は、ネットワークに接続するためのものであり、NIC(Network Interface Card)やそのドライバで構成される。ROM26は、ソースコード作成装置12の起動時に動作するブートプログラムなどが記憶されている不揮発性の記憶装置である。表示部28は、ソースコード作成装置12に関する情報をオペレータに表示するものである。操作入力部30は、オペレータがソースコード作成装置12の操作や情報を入力する際に用いられるものである。バス32は、情報のやりとりが行われる際に使用される。   The CPU 18 governs the overall operation of the source code creation device 12, and a flowchart showing processing of the source code creation device 12 described later is executed by the CPU 18. The HDD 20 is a non-volatile storage device that records each database, a program such as a source creation program, an OS (Operating System), and the like. The RAM 22 is a volatile storage device in which the OS, programs, and data are expanded. The network I / F unit 24 is for connecting to a network, and includes a NIC (Network Interface Card) and its driver. The ROM 26 is a nonvolatile storage device that stores a boot program that operates when the source code creation device 12 is started up. The display unit 28 displays information related to the source code creation device 12 to the operator. The operation input unit 30 is used when an operator inputs operations and information of the source code creation device 12. The bus 32 is used when information is exchanged.

次にアクティビティ図について説明する。アクティビティ図は、順序処理、同期処理、及び分岐処理を含む処理で構成されるため、まずこれらの処理の一例を、図2を用いて説明する。   Next, an activity diagram will be described. Since the activity diagram is composed of processing including order processing, synchronization processing, and branch processing, an example of these processing will be described with reference to FIG.

図2(A)は、順序処理を示すアクティビティ図の一例である。同図の順序処理は、ステップ101の単一Activity1、及びステップ102の単一Activity2の処理を順番に実行することを示している。   FIG. 2A is an example of an activity diagram showing order processing. The order process in FIG. 11 indicates that the process of the single activity 1 in step 101 and the process of the single activity 2 in step 102 are executed in order.

図2(B)は、同期処理を示すアクティビティ図の一例である。同図の同期処理は、ステップ201の単一Activity3、及びステップ202の単一Activity4の処理をそれぞれ独立して実行し、ステップ201、202の処理が終了すると、ステップ203の単一Activity5を実行することを示している。   FIG. 2B is an example of an activity diagram showing the synchronization process. In the synchronization process of FIG. 9, the single activity 3 in step 201 and the single activity 4 in step 202 are executed independently, and when the processes in steps 201 and 202 are completed, the single activity 5 in step 203 is executed. It is shown that.

同図(C)は、分岐処理を示すアクティビティ図の一例である。同図の分岐処理は、ステップ301の単一Activity6を実行後に、条件A、Bにより分岐する処理である。条件Aの場合は、ステップ302の単一Activity7の処理が実行され、条件Bの場合は、ステップ303の単一Activity8の処理を実行後、ステップ302の処理を実行することを示している。   FIG. 6C is an example of an activity diagram showing branch processing. The branch process in FIG. 6 is a process that branches according to conditions A and B after executing the single activity 6 in step 301. In the case of condition A, the process of single activity 7 in step 302 is executed. In the case of condition B, the process of step 302 is executed after the process of single activity 8 in step 303 is executed.

以上が順序処理、同期処理、及び分岐処理の一例であるが、これらを組み合わせた処理を、図3を用いて説明する。図3に示されるActivity図は、順序Activity1を実行する処理を示している。この順序Activity1は、同期Activity1、単一Activity15を実行するようになっている。   The above is an example of the order process, the synchronization process, and the branch process. A process combining these processes will be described with reference to FIG. The Activity diagram shown in FIG. 3 shows processing for executing the order Activity1. In this order Activity1, synchronous Activity1 and single Activity15 are executed.

更に、同期Activity1は、順序Activity2と同期Activity2を実行するようになっている。このうち、順序Activity2は、分岐処理が含まれ、その分岐処理は単一Activity9を実行後に、条件により単一Activity10又は単一Activity11の処理が実行され、単一Activity11の処理を実行した場合は、その後単一Activity10の処理を実行するようになっている。   Furthermore, the synchronous activity 1 executes the order activity 2 and the synchronous activity 2. Among these, the order Activity2 includes a branch process, and when the branch process executes a single activity 9, a process of a single activity 10 or a single activity 11 is executed according to a condition, and a process of a single activity 11 is executed. Thereafter, the processing of a single activity 10 is executed.

一方、同期Activity2は、同期処理が含まれ、その同期処理は、単一Activity12と順序Activity3を独立して実行する処理である。更に順序Activity3は、単一Activity13、単一Activity14を順番に実行する処理である。   On the other hand, the synchronization activity 2 includes a synchronization process, and the synchronization process is a process for executing the single activity 12 and the sequence activity 3 independently. Further, the order Activity 3 is a process for executing the single Activity 13 and the single Activity 14 in order.

以上がアクティビティ図の説明である。次に、図4を用いて本実施の形態に係るデザインパターンを、クラス図を用いて説明する。   The above is the description of the activity diagram. Next, the design pattern according to the present embodiment will be described using a class diagram with reference to FIG.

まず、同図に示されるActivityオブジェクト50は、取得したアクティビティ情報の各アクティビティを定義するものである。また、Activityオブジェクト50と単一Activityオブジェクト52及び複合Activityオブジェクト54との継承関係を示すR9は、処理が単一処理か複合処理かを前記処理毎に判定する第1判定処理を示している。   First, the Activity object 50 shown in the figure defines each activity of the acquired activity information. R9 indicating the inheritance relationship between the Activity object 50, the single Activity object 52, and the composite Activity object 54 indicates a first determination process for determining whether the process is a single process or a composite process.

複合Activityオブジェクト54と同期Activityオブジェクト56及び順序Activityオブジェクト58との継承関係を示すR10は、複合処理と判定された処理が、同期処理か順次処理かを判定する第2判定処理を示している。   R10 indicating the inheritance relationship between the composite activity object 54, the synchronous activity object 56, and the order activity object 58 indicates a second determination process for determining whether the process determined as the composite process is a synchronous process or a sequential process.

Activityオブジェクト50と複合Activityオブジェクト54との関連を示すR7は、処理を実行した際に、処理が終了した場合に終了したことを通知するための第1判定処理により判定された複合処理が存在するか否か判定する第3判定処理を示している。   R7 indicating the relationship between the Activity object 50 and the composite Activity object 54 includes the composite process determined by the first determination process for notifying the end of the process when the process is executed. 3 shows a third determination process for determining whether or not.

順序Activityオブジェクト58と順序Activity仕様オブジェクト60との関連を示すR1、順序Activity仕様オブジェクト60と順序オブジェクト68との関連を示すR2、順序Activity仕様オブジェクト60とActivityオブジェクト50との関連を示すR4、及び順序オブジェクト68は、第2判定処理により判定された順次処理のうち、最初に実行する処理を示す開始処理を認識する第1認識処理を示している。   R1 indicating the relationship between the sequence Activity specification object 58 and the sequence Activity specification object 60, R2 indicating the relationship between the sequence Activity specification object 60 and the sequence object 68, R4 indicating the relationship between the sequence Activity specification object 60 and the Activity object 50, and The order object 68 indicates a first recognition process for recognizing a start process indicating a process to be executed first among the sequential processes determined by the second determination process.

また、関連R3、R4及び順序オブジェクト68は、順次処理を実行した際に、いずれの処理が実行中であるかを認識する第2認識処理を示している。   The relations R3, R4 and the order object 68 indicate a second recognition process for recognizing which process is being executed when the sequential process is executed.

更に、順序オブジェクト68の再帰関連を示すR8、上記R3、R4、及び順序オブジェクト68は、順次処理を実行した際に、実行中の処理の次に実行する処理が存在するか否かを判定する第4判定処理を示している。   Further, R8 indicating the recursive relationship of the order object 68, R3, R4, and the order object 68 determine whether or not there is a process to be executed next to the process being executed when the sequential process is executed. The 4th determination process is shown.

再帰関連R8、分岐オブジェクト62、順序オブジェクト68、及び関連R4は、順次処理を実行した際に、実行中の処理の次に実行する複数の処理が存在する場合に、いずれの処理を次に実行するかを判定する第5判定処理を示している。   When the recursive association R8, the branch object 62, the order object 68, and the association R4 execute a sequential process, if there are a plurality of processes to be executed next to the process being executed, any process is executed next. 5 shows a fifth determination process for determining whether to do.

また、Activityオブジェクト50と同期Activity仕様オブジェクト64との関連を示すR6、同期Activity仕様オブジェクト64と同期Activityオブジェクト56との関連を示すR5、及び同期Activityオブジェクト56は、同期処理において実行する複数の処理を認識する第3認識処理を示している。   R6 indicating the relationship between the Activity object 50 and the synchronous Activity specification object 64, R5 indicating the relationship between the synchronous Activity specification object 64 and the synchronous Activity object 56, and the synchronous Activity object 56 are a plurality of processes executed in the synchronous process. The 3rd recognition process which recognizes is shown.

同期Activityオブジェクト56の属性である実行中Activity数は、同期Activityが現在実行中のActivityの数を示しており、現在実行中の全てのActivityの終了を同期させるために使用する。同期オブジェクト66は、Activityオブジェクト50と同期Activity仕様64との関連クラスである。   The number of activities being executed, which is an attribute of the synchronization activity object 56, indicates the number of activities currently executed by the synchronization activity, and is used to synchronize the end of all activities currently being executed. The synchronization object 66 is a related class between the Activity object 50 and the synchronization Activity specification 64.

以上説明したクラス図に示される処理を実行するためのソースコードをアクティビティ図に示される各処理を行なうソースコードに追記する。具体的には、図5のフローチャートを用いて説明する。このフローチャートに示されるソースコード作成処理は、CPU18により実行される。   The source code for executing the processing shown in the class diagram described above is added to the source code for performing each processing shown in the activity diagram. Specifically, this will be described with reference to the flowchart of FIG. The source code creation process shown in this flowchart is executed by the CPU 18.

まずステップ401で、例えば予めHDD20に記憶されているアクティビティ情報、処理を示すソースコードを取得する。処理を示すソースコードの一例として、各処理を示す関数を示すソースコードが挙げられる。そしてこれらのソースコードは、テキストファイルで記憶されている。従って、以下の追記する処理では、このテキストファイルに各処理を示すソースコードが追記されることとなる。   First, in step 401, for example, activity information stored in advance in the HDD 20 and a source code indicating processing are acquired. As an example of the source code indicating the process, there is a source code indicating a function indicating each process. These source codes are stored as text files. Accordingly, in the following additional processing, source code indicating each processing is additionally written in this text file.

次のステップ402で、上述した第1判定処理をソースコードに追記し、ステップ403で、上述した第2判定処理をソースコードに追記し、ステップ404で上述した第3判定処理をソースコードに追記し、ステップ405で上述した第1認識処理をソースコードに追記し、ステップ406で上述した第2認識処理をソースコードに追記し、ステップ407で上述した第4判定処理をソースコードに追記し、ステップ408で上述した第5判定処理をソースコードに追記し、ステップ409で上述した第3認識処理をソースコードに追記し、ステップ410で上述した終了同期処理をソースコードに追記して処理を終了する。   In step 402, the first determination process described above is added to the source code. In step 403, the second determination process described above is added to the source code. In step 404, the third determination process described above is added to the source code. In step 405, the first recognition process described above is added to the source code. In step 406, the second recognition process described above is added to the source code. In step 407, the fourth determination process described above is added to the source code. In step 408, the fifth determination process described above is added to the source code. In step 409, the third recognition process described above is added to the source code. In step 410, the end synchronization process described above is added to the source code. To do.

これにより、上記図4に示したクラス図の処理がアクティビティ図に示される処理に追加されることで、アクティビティ図が示す処理を実行するためのソースコードが作成される。   As a result, the processing of the class diagram shown in FIG. 4 is added to the processing shown in the activity diagram, so that source code for executing the processing shown in the activity diagram is created.

次に、図6を用いて、順序Activityオブジェクト58、及び同期Activityオブジェクト56の振る舞いについて説明する。   Next, the behavior of the order Activity object 58 and the synchronous Activity object 56 will be described with reference to FIG.

同図(A)は、順序Activityオブジェクト58の振る舞いを示している。ステップ501は、最初に実行する処理を獲得するもので、関連R1、R2で関係する順序をR3に関係させる。次のステップ502で関連R3、R4で関連づけられたActivityを実行し、実行したActivityに、自順序Activity(複合Activity)をR7で関連させ、実行したActivityから実行完了の通知を受けると、ステップ503でR3、R8で関係する順序から分岐の判定メソッド(図4の分岐オブジェクト62参照)の結果を元に選択した順序をR3に設定する。R3に設定されていればそれを実行し、設定されていなければステップ503を終えてステップ504の終了処理を行なう終了中に移行する。ステップ504では、R7に複合Activityが設定されていれば、その複合Activityに実行完了を通知し、振る舞いを終了する。   FIG. 4A shows the behavior of the order activity object 58. Step 501 obtains the process to be executed first, and associates the order of relations R1 and R2 with R3. In the next step 502, the activities associated by the relations R3 and R4 are executed, the self-ordered activity (composite activity) is related to the executed activity by R7, and when the execution completion notification is received from the executed activity, step 503 is executed. Then, the order selected based on the result of the branch determination method (see the branch object 62 in FIG. 4) from the order related to R3 and R8 is set to R3. If it is set to R3, it is executed. If it is not set, step 503 is ended and the process proceeds to the end of performing the end processing of step 504. In step 504, if composite activity is set in R7, the composite activity is notified of execution completion, and the behavior is terminated.

同図(B)は、同期Activityオブジェクト56の振る舞いを示している。まず、ステップ601で、R5、R6で関係する全てのActivityの実行を開始し、実行したActivityの個数を実行中のActivity数(図4の同期Activityオブジェクト56参照)に設定し、更に実行した全てのActivityのR7に自同期Activity(複合Activity)を設定する。   FIG. 5B shows the behavior of the synchronous activity object 56. First, in Step 601, the execution of all the activities related to R5 and R6 is started, the number of the executed activities is set to the number of active activities (see the synchronous activity object 56 in FIG. 4), and all the executed activities are further performed. Set self-synchronization activity (composite activity) in R7 of activity.

次のステップ602では、実行したActivityから実行完了通知を受けるとActivity数を1減算する。Activity数が0となる、すなわち実行した全てのActivityが終了すると、次のステップ603に移行する。ステップ603では、R7に複合Activityが設定されていれば、その複合Activityに実行完了を通知し、振る舞いを終了する。   In the next step 602, when the execution completion notification is received from the executed activity, the number of activities is decremented by one. When the number of activities becomes 0, that is, when all the activities that have been executed are completed, the process proceeds to the next step 603. In step 603, if composite activity is set in R7, the composite activity is notified of execution completion, and the behavior is terminated.

次に図7を用いて、図3に示したActivity図に示される処理を実行した際の各オブジェクトの動きについて説明する。   Next, the movement of each object when the process shown in the Activity diagram shown in FIG. 3 is executed will be described with reference to FIG.

まず、ステップ701で、Actor1が順序Activity1を実行すると、ステップ702で同期Activity1が実行される。そして、ステップ703で順序Activity2が、ステップ704で同期Activity2がそれぞれ同期Activity1により実行される。更にステップ705で単一Activity9が順序Activity2により実行される。   First, when Actor1 executes the order Activity1 in Step 701, Synchronous Activity1 is executed in Step 702. Then, in step 703, the order Activity 2 is executed by the synchronous activity 1 and in step 704 the synchronous activity 2 is executed. Further, in Step 705, a single Activity 9 is executed by the order Activity2.

次のステップ706で、単一Activity12が同期Activity2により実行され、ステップ707で順序Activity3が同期Activity2により実行される。そしてステップ708で単一Activity13が順序Activity3により実行される。   In the next step 706, a single activity 12 is executed by the synchronous activity 2, and in step 707 the sequence activity 3 is executed by the synchronous activity 2. In step 708, the single activity 13 is executed by the sequence activity 3.

単一Activity12の実行が完了すると、ステップ709で実行が完了したことを示す実行完了が同期Activity2に通知される。また、単一Activity9の実行が完了すると、ステップ710で実行完了が順序Activity2に通知される。これを受けて、ステップ711で単一Activity10が順序Activity2により実行される。   When the execution of the single Activity 12 is completed, the execution completion indicating that the execution is completed is notified to the synchronous Activity 2 in Step 709. When the execution of the single Activity 9 is completed, the execution completion is notified to the order Activity 2 in Step 710. In response to this, a single Activity 10 is executed by the sequence Activity 2 in Step 711.

次のステップ712で、順序Activity3が単一Activity13により実行され、ステップ713で単一Activity14が順序Activity3により実行される。そしてステップ708で単一Activity13が順序Activity3により実行される。   In the next step 712, the order Activity 3 is executed by the single Activity 13, and in Step 713, the single Activity 14 is executed by the order Activity 3. In step 708, the single activity 13 is executed by the sequence activity 3.

また、単一Activity14の実行が完了すると、ステップ714で実行完了が順序Activity3に通知される。これを受けて、ステップ715で実行完了が順序Activity3に通知される。更にこれを受けて、ステップ716で実行完了が同期Activity1に通知される。   When the execution of the single Activity 14 is completed, the execution completion is notified to the order Activity 3 in Step 714. In response to this, the completion of execution is notified to the sequence Activity 3 in step 715. In response to this, the completion of execution is notified to the synchronous activity 1 in step 716.

単一Activity10の実行が完了すると、ステップ717で実行完了が順序Activity2に通知される。これを受けて、ステップ718で実行完了が同期Activity1に通知される。更にこれを受けて、ステップ719で実行完了が順序Activity1に通知される。   When the execution of the single Activity 10 is completed, the completion of execution is notified to the order Activity 2 in Step 717. In response to this, the completion of execution is notified to the synchronous activity 1 in step 718. In response to this, in step 719, the completion of execution is notified to the order Activity1.

次のステップ720で、単一Activity15が順序Activity1により実行され、ステップ721で実行完了が順序Activity1に通知される。これを受けて、ステップ722で実行完了がActor1に通知される。   In the next step 720, the single Activity 15 is executed by the order Activity1, and in Step 721, the completion of execution is notified to the order Activity1. In response, the completion of execution is notified to Actor 1 in step 722.

上述した実施形態では、図4に示したデザインパターンを用いて説明したが、このデザインパターンはC++言語用に作成されたものである。図4に示したデザインパターンをC言語用に作成したものを、図8に示す。図8に示すデザインパターンは、単にC言語用としたものであるので、図4に示したデザインパターンと同じ処理を示している。   In the embodiment described above, the design pattern shown in FIG. 4 has been described, but this design pattern is created for the C ++ language. FIG. 8 shows the design pattern shown in FIG. 4 created for the C language. Since the design pattern shown in FIG. 8 is simply for the C language, it shows the same processing as the design pattern shown in FIG.

なお、以上説明した図7のシーケンス図の処理の流れは一例であり、本発明の主旨を逸脱しない範囲内で処理順序を入れ替えたり、新たなステップを追加したり、不要なステップを削除したりすることができることは言うまでもない。   Note that the processing flow of the sequence diagram of FIG. 7 described above is an example, and the processing order is changed, new steps are added, and unnecessary steps are deleted without departing from the gist of the present invention. It goes without saying that you can do it.

12 ソースコード作成装置
18 CPU
20 HDD
22 RAM
50 Activityオブジェクト
52 単一Activityオブジェクト
54 複合Activityオブジェクト
56 同期Activityオブジェクト
58 順序Activityオブジェクト
60 順序Activity仕様オブジェクト
62 分岐オブジェクト
64 同期Activity仕様オブジェクト
66 同期オブジェクト
68 順序オブジェクト
12 Source code generator 18 CPU
20 HDD
22 RAM
50 Activity object 52 Single Activity object 54 Compound Activity object 56 Synchronous Activity object 58 Sequence Activity object 60 Sequence Activity specification object 62 Branch object 64 Synchronization Activity specification object 66 Synchronization object 68 Sequence object

Claims (2)

順序処理、同期処理、及び分岐処理を含む処理で構成されるアクティビティ図を示すアクティビティ情報、及び前記処理に対応するソースコードを取得する取得手段と、
前記取得手段により取得されたアクティビティ情報に示される前記処理が単一処理か複合処理かを前記処理毎に判定する第1判定処理を前記ソースコードに追記する第1追記手段と、
前記第1判定処理により複合処理と判定された処理が、同期処理か順次処理かを判定する第2判定処理を前記ソースコードに追記する第2追記手段と、
前記処理を実行した際に、前記処理が終了した場合に終了したことを通知するための前記第1判定処理により判定された複合処理が存在するか否か判定する第3判定処理を前記ソースコードに追記する第3追記手段と、
前記第2判定処理により判定された順次処理のうち、最初に実行する処理を示す開始処理を認識する第1認識処理を前記ソースコードに追記する第4追記手段と、
前記順次処理を実行した際に、いずれの処理が実行中であるかを認識する第2認識処理を前記ソースコードに追記する第5追記手段と、
前記順次処理を実行した際に、実行中の処理の次に実行する処理が存在するか否かを判定する第4判定処理を前記ソースコードに追記する第6追記手段と、
前記順次処理を実行した際に、実行中の処理の次に実行する複数の処理が存在する場合に、いずれの処理を次に実行するかを判定する第5判定処理を前記ソースコードに追記する第7追記手段と、
前記第2判定処理により判定された同期処理において実行する複数の処理を認識する第3認識処理を前記ソースコードに追記する第8追記手段と、
実行中の各処理の終了を同期させるための終了同期処理を前記ソースコードに追記する第9追記手段と、
を有するソースコード作成装置。
Activity information indicating an activity diagram composed of processing including sequence processing, synchronization processing, and branch processing, and an acquisition unit for acquiring source code corresponding to the processing;
First appending means for appending a first determination process to the source code for determining whether the process indicated by the activity information acquired by the acquiring means is a single process or a composite process;
A second appending unit for appending a second determination process to the source code for determining whether the process determined as the composite process by the first determination process is a synchronous process or a sequential process;
When the process is executed, a third determination process for determining whether or not there is a composite process determined by the first determination process for notifying that the process has ended when the process is completed is the source code A third appending means for appending to,
A fourth appending means for appending a first recognition process to the source code for recognizing a start process indicating a process to be executed first among the sequential processes determined by the second determination process;
A fifth appending means for appending a second recognition process to the source code for recognizing which process is being performed when the sequential process is performed;
A sixth appending means for appending a fourth determination process to the source code for determining whether or not there is a process to be executed next to the process being executed when the sequential process is performed;
When there are a plurality of processes to be executed next to the process being executed when the sequential processes are executed, a fifth determination process for determining which process to execute next is added to the source code. A seventh appending means;
An eighth appending means for appending, to the source code, a third recognition process for recognizing a plurality of processes executed in the synchronization process determined by the second determination process;
Ninth appending means for appending an end synchronization process for synchronizing the end of each process being executed to the source code;
A source code creating device.
コンピュータを、
順序処理、同期処理、及び分岐処理を含む処理で構成されるアクティビティ図を示すアクティビティ情報、及び前記処理に対応するソースコードを取得する取得手段と、
前記取得手段により取得されたアクティビティ情報に示される前記処理が単一処理か複合処理かを前記処理毎に判定する第1判定処理を前記ソースコードに追記する第1追記手段と、
前記第1判定処理により複合処理と判定された処理が、同期処理か順次処理かを判定する第2判定処理を前記ソースコードに追記する第2追記手段と、
前記処理を実行した際に、前記処理が終了した場合に終了したことを通知するための前記第1判定処理により判定された複合処理が存在するか否か判定する第3判定処理を前記ソースコードに追記する第3追記手段と、
前記第2判定処理により判定された順次処理のうち、最初に実行する処理を示す開始処理を認識する第1認識処理を前記ソースコードに追記する第4追記手段と、
前記順次処理を実行した際に、いずれの処理が実行中であるかを認識する第2認識処理を前記ソースコードに追記する第5追記手段と、
前記順次処理を実行した際に、実行中の処理の次に実行する処理が存在するか否かを判定する第4判定処理を前記ソースコードに追記する第6追記手段と、
前記順次処理を実行した際に、実行中の処理の次に実行する複数の処理が存在する場合に、いずれの処理を次に実行するかを判定する第5判定処理を前記ソースコードに追記する第7追記手段と、
前記第2判定処理により判定された同期処理において実行する複数の処理を認識する第3認識処理を前記ソースコードに追記する第8追記手段と、
実行中の各処理の終了を同期させるための終了同期処理を前記ソースコードに追記する第9追記手段と、
として機能させるためのソースコード作成プログラム。
Computer
Activity information indicating an activity diagram composed of processing including sequence processing, synchronization processing, and branch processing, and an acquisition unit for acquiring source code corresponding to the processing;
First appending means for appending a first determination process to the source code for determining whether the process indicated by the activity information acquired by the acquiring means is a single process or a composite process;
A second appending unit for appending a second determination process to the source code for determining whether the process determined as the composite process by the first determination process is a synchronous process or a sequential process;
When the process is executed, a third determination process for determining whether or not there is a composite process determined by the first determination process for notifying that the process has ended when the process is completed is the source code A third appending means for appending to,
A fourth appending means for appending a first recognition process to the source code for recognizing a start process indicating a process to be executed first among the sequential processes determined by the second determination process;
A fifth appending means for appending a second recognition process to the source code for recognizing which process is being performed when the sequential process is performed;
A sixth appending means for appending a fourth determination process to the source code for determining whether or not there is a process to be executed next to the process being executed when the sequential process is performed;
When there are a plurality of processes to be executed next to the process being executed when the sequential processes are executed, a fifth determination process for determining which process to execute next is added to the source code. A seventh appending means;
An eighth appending means for appending, to the source code, a third recognition process for recognizing a plurality of processes executed in the synchronization process determined by the second determination process;
Ninth appending means for appending an end synchronization process for synchronizing the end of each process being executed to the source code;
Source code creation program to function as
JP2009044121A 2009-02-26 2009-02-26 Source code creation device and source code creation program Pending JP2010198457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009044121A JP2010198457A (en) 2009-02-26 2009-02-26 Source code creation device and source code creation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009044121A JP2010198457A (en) 2009-02-26 2009-02-26 Source code creation device and source code creation program

Publications (1)

Publication Number Publication Date
JP2010198457A true JP2010198457A (en) 2010-09-09

Family

ID=42823100

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009044121A Pending JP2010198457A (en) 2009-02-26 2009-02-26 Source code creation device and source code creation program

Country Status (1)

Country Link
JP (1) JP2010198457A (en)

Similar Documents

Publication Publication Date Title
JP5376509B2 (en) Execution history trace method
CN104204975B (en) Sequencer debugging auxiliary device
JP2009265810A (en) Status transition test support device, status transition test support program and status transition test support method
JP2012221380A (en) Automatic program generation device, method and computer program
CN106709985B (en) Virtual sacrifice three-dimensional scene generation method and device
CN108897569A (en) The method for cleaning and computer readable storage medium of iOS engineering discarded record
CN106815022A (en) A kind of general UI interface creating methods and device based on tree data structure
US9342064B2 (en) Motion SFC program component creation device
US20130263143A1 (en) Information processing method and system
CN111506306A (en) Method and device for compiling Ansible script and electronic equipment
CN107220044B (en) Method and device for driving business object based on meta-model
JP2010198457A (en) Source code creation device and source code creation program
JP4889338B2 (en) Screen program layout changing method, information processing apparatus, program, and recording medium
JP2008293186A (en) Method and apparatus for automatically generating steel plant control program
JP2008052356A (en) Source code automatic generation device
JP2008052359A (en) Test case generation device, test case generation method, and test case generator
JP2010198479A (en) System for automatically executing application test
JP6025955B1 (en) Program analysis apparatus and program analysis method
JP2018022433A (en) Control program, apparatus, and method
CN116431627A (en) Electronic equipment database table generation method, system, equipment and medium
JP3930255B2 (en) System specification information processing apparatus, system specification information processing method, and program
JP2016042317A (en) Software design support apparatus and method
CN113238742A (en) Method, device, terminal and medium for modifying and replaying direct-current control protection page program
JP2016081126A (en) Job control language automatic generation program
KR20210061156A (en) System and method of providing civil model linking 3 dimensional model and analysis model